Sure, but I currently have them disabled due to issues with pfSense not coming back up properly.
Modem
alias: Reboot cable modem if Google DNS ping timer finishes, and restart timer
description: ""
mode: single
triggers:
- event_type: timer.finished
event_data:
entity_id: timer.googlednstimer
trigger: event
conditions: []
actions:
- data: {}
target:
entity_id: switch.power_switch_2
action: switch.turn_off
- delay:
hours: 0
minutes: 0
seconds: 30
milliseconds: 0
- data: {}
target:
entity_id: switch.power_switch_2
action: switch.turn_on
- data: {}
target:
entity_id: timer.googlednstimer
action: timer.start
Router :
alias: Reboot router if not pingable for 30 minutes
description: ""
mode: single
triggers:
- entity_id:
- binary_sensor.routerping
to: "off"
for:
hours: 0
minutes: 30
seconds: 0
trigger: state
conditions: []
actions:
- data: {}
target:
entity_id: switch.power_switch
action: switch.turn_off
- delay:
hours: 0
minutes: 0
seconds: 30
milliseconds: 0
- data: {}
target:
entity_id: switch.power_switch
action: switch.turn_on
Timer start helper
alias: Start Google DNS ping timer
description: Start timer when Google DNS becomes unreachable
mode: single
triggers:
- entity_id:
- binary_sensor.googlednsping
to: "off"
trigger: state
conditions: []
actions:
- data:
duration: "00:30:00"
target:
entity_id: timer.googlednstimer
action: timer.start
Timer reset helper
alias: Reset Google DNS ping timer
description: Reset timer when Google DNS becomes reachable
mode: single
triggers:
- entity_id:
- binary_sensor.googlednsping
to: "on"
trigger: state
conditions: []
actions:
- target:
entity_id:
- timer.googlednstimer
device_id: []
area_id: []
data: {}
action: timer.cancel
There is no YAML definition for the ping integration devices.
GoogleDNSPing :
RouterPing :
This works if I test it, for example by forcibly unplugging the modem from the router.
Somehow, it doesn’t work in an actual extended power outage, when the ISP’s power goes down too. I have not figured out why yet.
One problem is a timing issue in pfSense - it seems to hang in some cases when the ISP is in the process of powering up. Only 2 people on planet earth have reported seeing this so far, and unfortunately I’m one of the 2.
Another problem is that sometimes, my HAOS VM will not come back up after a power outage. I have seen it hang during boot, waiting for Internet access, which it never gets. That defeats the entire purpose of the automation.
Another problem I saw is that the disk array on which my HAOS VM is stored didn’t come back online. Only 2 of the 5 NVMe drives showed up in the Windows device manager somehow. This is very rare, but also seems to happen only during extended power outages. I don’t know how to reproduce it. The boot drive is SATA, and is always OK, but it’s 256GB and a bit small to have the HAOS VM on it, on top of the OS and host applications. I might be able to live with a 128GB VM size, but in the long run would probably want to buy a larger SATA boot drive. I would also need to find a way to automatically reboot the host, so that all 5 drives power up, and the array can come back online. That’s tricky to do. Probably involves using something like rsh . But if the host reboots, the VM may get corrupt. Well, it would alerady risk getting corrupt during the power outage anyway, after the UPSes run out …
TLDR I’m very far from having a system resilient to ISP & power outages, despite all the hardware I invested in, which should allow it.