The post I deleted was a wash. I tried using the ping condition from the speedtest.net component. I posted the setup without testing. I quickly found out that the component holds its last state if connection is lost. I would be happy to show you what I did to make it work.
#Create a Shell Script
In the .homeassistant directory I made a file call ping.sh. The file looks like this.
ping -w 5 22.214.171.124 > /dev/null 2>&1
if [ $? -eq 0 ]; then
The script pings google five times and reports after its done. After you have that done you have to make it executable:
chmod +x ping.sh
Finally, modify your path to add the directory where your script is located:
To test it you can run:
it should return “Success” or “Fail”
Create a Sensor
I used the scan_interval in my setup but I am not sure if it is doing anything.
#Create an Automation
- alias: turn on light when internet goes down
You will need a second, similar automation to turn it off. Hope this works out for you!!