Hi, I have a z-wave plug connected to my router.
If my internet connection fails I want this plug to be turned off, and turned on again after 30 seconds.
I set up the automation using the buit-in wizard. Here’s the code from automation.yaml
The binary_sensor.google is a ping sensor that pings 8.8.8.8 every 10 seconds. If this fails, I want the switch
switch.get_router_plug_switch
to be turned off.
When this switch is off, I want it to be turned back on again after 30 seconds.
However nothing happens when the ping fails (I’ve testet this using a local client as target for the ping.)
What’s wrong in this code?
is google available
no -
turn off router
delay 30s
turn on router
yes-
do nothing
It’s almost impossible to debug the builtin editor code as it’s such a mess (not your fault)
but I would assume it’s the trigger that’s not working one or the other or both.
Thanks, I’m trying to get my head around this.
In the script I’m making for this automation want to check if internet is back online after reboot, if not stop the automation, else if OK notify.
Apparantly I can’t have service inside a condition block. How could I accomplish what I want to?
Thanks for the reply conditions is supposed to work within actions, or am I wrong?
However I’m not sure what to do about the service within the condition. I figure I can’t have a service statement within a condition, so how can I do this the right way?
After the switch is turned back on I want to check if internet is available again, then send a notify, if it’s not available it should turn off the automation so that it don’t run in an “eternal” loop.