Because of where my hass.io device is, occasionally it loses wifi connection.
Then I have to turn the device off and on again to reconnect the wifi and all works fine.
Is there anyway for this to happen automatically? Its annoying that my home automation system, needs manual intervention at times.
Thanks
francisp
(Francis)
December 13, 2019, 3:33pm
2
You can create a binary_sensor that pings google. If google is not available for 5 minutes, start an automation that restarts HA.
TazUk
(Taz Uk)
December 13, 2019, 4:46pm
3
Similar to @francisp suggests, I monitor my internet connection so that my system can switch to SMS notifications in the event of a supplier outage:
binary_sensor:
- platform: ping
host: bbc.co.uk
count: 3
scan_interval: 300
name: 'WAN_Check_BBC'
- platform: ping
host: 208.67.222.222
count: 3
scan_interval: 300
name: 'WAN_Check_OpenDNS'
I then combine then into a template sensor and test against that for my automations.
- platform: template
sensors:
# online / offline
wan:
friendly_name: 'Internet Connection'
entity_id:
- binary_sensor.WAN_Check_BBC
- binary_sensor.WAN_Check_OpenDNS
value_template: '{% if is_state("binary_sensor.WAN_Check_BBC","off") and is_state("binary_sensor.WAN_Check_OpenDNS", "off") %}Offline{% else %}Online{% endif %}'
2 Likes
Thanks Both.
I have the sensor and automation setup.
@francisp Im using HASSIO - so will homeassistant.restart restart the docker container? or just the home assistant app?
Thanks
francisp
(Francis)
December 24, 2019, 12:16pm
5
FattusMannus:
homeassistant.restart
It will do the same as when you click configuration → server controls → restart.
Then i dont think this answers my question.
Im assuming its the device that loses connection, so restarting just the HA app wont help
francisp
(Francis)
December 29, 2019, 11:13am
7
There is the service hassio.host_reboot
1 Like
jd1900
April 12, 2020, 8:00am
9
I guess there must be a simpler answer, to modify the connection settings and avoid restarting, not always desired.