I have a Windows 10 PC running a webservice that fires a BSOD about once a week because of some bad software on it. I can’t remove that software unfortunately. When this happens, I can open up HA and turn off the switch it’s plugged into and turn it back on. I’d like to automate this, but on occasion I install something on the Win10 server, so I don’t want a single failure to cause a reboot.
I added a binary_sensor
based on some information I found here:
- platform: command_line
name: 'jriver_status'
command: curl -s -m 3 /dev/null http://<internal ip>:52199 && echo ON || echo OFF
scan_interval: 600
I thought I could up the -m delay to be 600, so that it would check for 600 seconds, but I thought that might leave the curl command running too long. If the server doesn’t respond within 3 seconds, I should consider it dead, no reason to just keep waiting.
Is there an easier way to track two failures in a row?