I hope this topic fits this category.
I’m using some Shelly devices in detached mode behind wall switches to have some special actions when switches are pressed two times in a row and so on. The lights are switched on/off via rules in Openhab. So far so good.
When my Openhab server is down (for whatever reason) I’d like to change the shellies back to “Edge” button mode. This can be achieved by sending http commands to the Shellys.
e.g. for a Shelly Dimmer:
Now my question:
What would you suggest to run these commands?
I thought of:
finding a way to have a Openhab Server shutdown rule
writing a script and execute it on a new Shelly plus to ping my server and if the server is unavailable send http commands to all the detached shellys. (I didn’t write/ test this yet)
I don’t want to setup a 2nd server. Hope to get your ideas, thx
There’s no built-in trigger to start a rule on system shutdown, because the rule engine gets killed pretty quickly. If you’re shutting down with an openHAB rule, then you can add the HTTP command to it (before your shutdown/reboot command) and set up a separate rule that runs on startup to revert.
Of course, this only works if you intentionally shut down your server, and not if it crashes or loses power.
I can’t help you with this specific idea, but really what you’re talking about is monitoring openHAB. You can find discussions about that in the community, such as this one. They’re likely more than you want/need, but you might get some ideas.