I have a a bunch of sonoff devices around my house that turn off/on via MQTT at certain hours of the day.
The problem is that we had a power outtage and my UPS couldn’t keep server online so the Hassio VM went down, along with my MQTT service.
My raspberry was online so i’m wondering if I can implement a quick lovelace page with a button to execute 4 different http requests to each sonoff device to turn them off/on when I push the button.
A type of backup if the server isn’t online.
Is it best to configure an entity button and use a local script that does wget’s or is there a better way to trigger all 4 at the same time without MQTT (The do have Http:/x.x.x.x/cmnd/power=off or power=on type command options
If there is a power surge/outtage and upon restoration, the sonoff’s come back and are on but the server is not (or has crashed, or any other of a myriad of issues) – is there a way to use a script to execute HTTP commands to the wifi switches?
Actually, I have 3 instances of HA running, the two raspberry Pi’s are on different floors of my house and each has a z-wave stick. The reason is concrete/rebar walls and a poorly meshed network so i’ve just split it up. The server runs the MQTT broker and other centralized things such as Sonoff (my wifi network is on Meraki equipment and is rock solid) — I have z-wave events on each PI sent via MQTT to the central broker too. But in this case, the VM just turns the sonoff on at night and off during the day.
The problem is if the VM craps out, I’d like a raspberry to watch for this and have a backup. Thinking a button to press on a dashboard is easy for the wife too.
Then call the service shell_command.sonoff_65_152_off from any automation, script or Lovelace control.
There is no feedback to tell if the switch is off with this method, unlike nick’s suggestion, where you can incorporate state feedback from the sonoff: