After a powercut my Wemo devices remain off - which is annoying
Does anyone know a way/automation to makesure it is kept on
- id: Make sure Billion is on
alias: Make sure Billion is on
trigger:
platform: state
entity_id: switch.billioninternet
to: 'off'
for:
minutes: 5
action:
service: homeassistant.turn_on
entity_id: switch.billioninternet
If you always want it to be on, then why are you using a switch?
But seriously, if you always want the switch to be turned on when HA starts, then:
- id: Make sure Billion is on
alias: Make sure Billion is on
trigger:
platform: homeassistant
event: start
action:
service: homeassistant.turn_on
entity_id: switch.billioninternet
But there is a reason. I use the switch to hard reset the router if the internet goes down. So it’s like a local reboot after all other internet repair attempts fail.
Only issue is after a power cut the switch is off.
Is there a way to detect if the switch is off for a period of time and turn it on?
does the switch report its state to home assistant? That is, if you flip the switch on, does the GUI change to show it’s on? If so:
- id: Make sure Billion is on
alias: Make sure Billion is on
trigger:
platform: state
entity_id: switch.billioninternet
state: "off"
for:
minutes: 5
action:
service: homeassistant.turn_on
entity_id: switch.billioninternet
That will turn the switch on if it has been off for more than 5 min. It looks like you had it right the first place, does it not work?
Configuration invalidCHECK CONFIG
Invalid config for [automation]: [state] is an invalid option for [automation]. Check: automation->trigger->0->state. (See ?, line ?). Please check the docs at https://home-assistant.io/components/automation/
I think a combination of the following should work
- id: Make sure Billion is on
alias: Make sure Billion is on
trigger:
platform: state
entity_id: switch.billioninternet
to: 'off'
for:
minutes: 5
action:
service: homeassistant.turn_on
entity_id: switch.billioninternet
- id: Make sure Billion is on at HA Startup
alias: Make sure Billion is on at HA Startup
trigger:
platform: homeassistant
event: start
action:
service: homeassistant.turn_on
entity_id: switch.billioninternet