Persistence (yet another thread (sorry!))

Okay - so I looked up a few OH2 persistence threads and all said “follow the wiki for OH1” and I did - but there is no designer (I haven’t downloaded Eclipse designer yet - I’m tethered on my phone on the road ATM!) but I found a sample file for both the mapdb.persist and the openhab config file for the default persistence engine. I installed through PaperUI. THEN updated the config files.

Let me share the configs for good prosperity!
mapdb.persist

Strategies {
        default = everyUpdate
}

Items {
        // persist all items on every change and restore them from the db at startup
        * : strategy = everyChange, restoreOnStartup
}

I changed the default persistence via PaperUI (expert view on system > persistence) = mapdb

Keep in mind I’m clueless with some things OH1 related, and it seems like the designer was pretty critical for keeping people for retarded formatting and stuff - but I’m only extrapolating my long reading session of past threads.

Any help would be appreciated.

Also!!! Is it possible to use the REST API to update the mapdb? I’d love to be able to have my camera at my driveway (long driveway, I’m not a creeper or a drug dealer :slight_smile: ) send something to openhab2 so I can automatically turn on my porch lights for us when we get home? (edit: my camera at the driveway already has “motion detection” where I can send signals via IO wires, but I can also send emails and other things - just thought something might be possible without running a long wire to my arduino or a usb relay).

Thanks!

As far as I remeber OH2 has removed the possibility to update data via REST API. AFAIK this is possible in OH1, but this option has gone in OH2.

The most easy way of getting data into OH2 without a sepcific binding is in my opinion MQTT. With MQTT you can subscribe to a topic for specific items. Check MQTT in the OpenHAB doc’s, it is quite powerfull. It does require that you have something that can publish data. I guess you have the same requirement for the REST API approach. The MQTT communication can be done via python or another script language.

I’ll check out MQTT - sounds pretty neat actually! Might be EXACTLY what I’m looking for.

Thanks!