Hello,
I am trying to write an automation to reboot become unavailable hub.
Idea is to turn off/turn on switch for power of this hub, until one of switches connected to this hub gets on OR off state.
- alias: Sonoff_hub_reboot
initial_state: true
trigger:
- platform: state
entity_id: switch.sonoff_a48002531e_1
to: 'unavailable'
for:
minutes: 2
action:
- alias: Hub reboot sequence
repeat:
sequence:
- service: switch.turn_off
entity_id: switch.gateway_sonoff_power
- delay: 00:00:10
- service: switch.turn_on
entity_id: switch.gateway_sonoff_power
- delay: 00:03:00
until:
condition: or
conditons:
- condition: state
entity_id: switch.sonoff_a48002531e_1
state: 'on'
- condition: state
entity_id: switch.sonoff_a48002531e_1
state: 'off'
Automation is okay, configuration check doesn’t give any errors, but problem is that this automation works only once and doesn’t repeat.
Please point me, where am i wrong?