I ran across a few things some openHAB users might find relevant and interesting.
AdaFruit has developed and released a script to turn your RPi into a read-only mode. One of the cool features is you can use a jumper switch to boot into read/write mode for situations where you need to write to the SD card (e.g. system updates). This is probably not going to be reasonable for running your openHAB server itself, but if you have remote devices running on a RPi like sensors or weather stations this could make the devices behave much more like a microcontroller when it comes to power loss and the like.
MagPi Issue #63 (PDF download) has a brief article about using the Raspberry Pi and home automation. See pg. 62. Back issues can be downloaded from
The makers of MagPi have also released a new magazine called Hack Space. Like MagPi it is free to download and at least from the first issue it looks like there will be many articles of interest to home automation.
Plex Labs has released a new Plex Pass feature called Webhooks that allows users to set up HTTP calls from the Plex Mediaserver to configured URLs based on events on the server. This could be used for some alternative ways to interact with openHAB and it might provide features not yet available in the Plex Binding (I don’t use it so can’t comment).
I’ve considered setting a Pi as read only since I have lost an SD card in the past as a result of a power outage. I opted just to image the SD card if I made a lot of changes. I can just restore it and carry on. If I wasn’t such a frequent tinkerer then read only sounds the way to go.
It is hard to make a server like openHAB read-only and still be useful. OH needs to write:
logs
persistence
any time there is any configuration change at all
This is why I wouldn’t recommend running OH read-only in most circumstances. I can see a good case if one is deploying lots of OH instances in a commercial type environment where their configs remain static and logging and persistence is hosted off the RPi.
For the rest of us, a good backup and restore procedure is something that will have to be done anyway and once you have that, the amount of work and inconvenience of running OH read-only does not, IMHO, justify the small increase in SD card life you might gain.
However, if you have a remote sensor reporting readings to OH over REST API or MQTT or something like that where you don’t care about the logs, there is no database running, and beyond system updates it doesn’t ever really need to change, a read-only config can be quite handy. I’ve used it myself in the past for this sort of application. However, I’ve since backed off and now do everything BUT make the SD card read-only so it reduces the writes but is not quite so inconvenient to perform updates.
Really, I should be using an Arduino in this sort of use case anyway, and maybe I will at some point.
I think, there’s some easy steps to avoid this (despite my SD-Card in my productive Pi works since 1,5years without a problem…
logs: use either an attached USB-harddrive or sambe to a NAS (as I intend to do)
persistence: use an external Server (I use my Synology for MySQL/MariaDB)
configuration change: this is a no-brainer, but of course you could also use your NAS for that one also
So, you could basically use a NAS for the main writing I/Os and an external Server for persistence. What hinders me at the moment are, that I don’t know what happens if my NAS restarts (as Synology brings out Patches roughly every month or so). If there’s no persistence, that’s not a biggie - but what happens, if there’s no log available? or the openhab-directories are down… I didn’t test this yet.
I originally ran my DHT22 on an ESP8266 (Arduino compatible firmware) to report temperature and humidity to OpenHab. This worked well. Then I added a PIR motion sensor to it and things went awry. It turns out that the radio on the ESP8266 interferes with the PIR motion sensor and causes false positives. That’s when I moved it to a Raspberry Pi and a Python script which I’ve just replaced with your excellent sensorReporter utility.
@binderth - Thanks for the idea. I’m not using persistence at the moment but I do have a Synology too. Putting it on there sounds like a good idea. Does it take much configuration? I’ve not looked at it at all yet.