gpa18mx
(Gpa18mx)
June 2, 2017, 2:06pm
1
Hi!
I would like to know if there is a way to reload hass by automation, something like if device is not load correctly then reload hass?
My problem came because after some power cuts some devices didn’t load correctly so i would like that hass relod it until everything is normal
treno
(travis reno)
June 2, 2017, 7:51pm
2
service: homeassistant.restart
clintgeek
(Clint Crocker)
June 3, 2017, 3:35am
3
I use this to check for invalid config or missing wink. If the power goes out around here, the wink takes longer to reboot than HASS does. The following automations fix that.
sensor:
- platform: template
sensors:
invalid_config:
value_template: "{% if is_state_attr('persistent_notification.invalid_config', 'title', 'Invalid config') %}true{% else %}false{% endif %}"
friendly_name: 'Invalid Config'
wink_missing:
value_template: "{% if is_state('binary_sensor.hub', 'on') %}false{% else %}true{% endif %}"
friendly_name: 'Wink Missing'
automation:
# restart if wink not found (power outage / race condition)
- alias: Reboot Wink Check
trigger:
platform: state
entity_id: sensor.invalid_config
state: 'true'
for:
seconds: 60
condition:
condition: state
entity_id: sensor.wink_missing
state: 'true'
action:
service: homeassistant.restart
1 Like
gpa18mx
(Gpa18mx)
June 3, 2017, 4:14am
4
Thanks, something like this i was searching.
dclobato
(Daniel Correa Lobato)
July 15, 2018, 11:52pm
5
Do you mind to explain why do you test for invalid config? Testing for missing sensor is not enough?
Thanks
clintgeek
(Clint Crocker)
August 5, 2018, 9:48pm
6
Sorry for the really delayed response! If the wink hub doesn’t show up it throws an ‘invalid config’ error. Sometimes that one shows up first, sometimes it realizes the Wink hub is missing first. By testing for both, it reboots fastest regardless of which one pops up first.