I have a little programming issue that I’d like to resolve nicely and not with complicated code I have a water heater that I want to get on only during night ! My initial plan was to put it on at let say 8pm and then off at 8am. My issue is this one:
Setup is done in a place where we have often electricity cut or problem like that so it might happen pretty regularly that whole system restarts after an electricity cut.
How to be sure each night my water heater will be on just for time specified ? as if there is an electric cut at 7h59pm till 8:04 pm for example it means my automation at 8pm won’t trigger right ?? Is there a way to do some time comparisons ? such as if time is “above” 8pm and “under” 8am then trigger that ???
Great. Adding more relays to the same automation is simple on your entity_id you can just add the second relay like this: switch.switch_sonoff_4_relais_1, switch.switch_sonoff_4_relais_2
Sorry but I noticed that HA doesn’t like that syntax in fact complaining about duplicate keys in configuration file Any suggestions what’s wrong here ??
Nope it complains about duplicate entries (the ones I had to duplicate for on and off states) and in fact HA executes only the first service action for each trigger and not both