Thanks for the really quick reply. I definitely should have at least included the code in the switch. I’ve exported the whole thing (less the notify nodes). I’m aware of the way the ping output varies depending on success or fail, and think I have that right, but you may see something I didn’t.
[{"id":"3cddf8bf.263148","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"a0d84cce.73759","type":"ping","z":"3cddf8bf.263148","mode":"timed","name":"Test Internet access","host":"1.1.1.1","timer":"20","inputs":0,"x":170,"y":240,"wires":[["b623cd47.4bc5a","f0187957.afb998"]]},{"id":"f0187957.afb998","type":"switch","z":"3cddf8bf.263148","name":"Unreachable?","property":"payload","propertyType":"msg","rules":[{"t":"false"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":400,"y":240,"wires":[["69ee2c72.f27534"],["2e05b581.ccdcca"]]},{"id":"69ee2c72.f27534","type":"counter","z":"3cddf8bf.263148","name":"Retry counter","init":"5","step":"1","lower":"0","upper":"","mode":"decrement","outputs":"1","x":690,"y":240,"wires":[["f5b557d3.0bcb98","e01664c1.117718"]]},{"id":"75dbb5d8.e57c7c","type":"delay","z":"3cddf8bf.263148","name":"Rate limit cycling","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"15","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":1130,"y":240,"wires":[["1d27d6b1.999099"]]},{"id":"f5b557d3.0bcb98","type":"switch","z":"3cddf8bf.263148","name":"Exhausted retries?","property":"count","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":900,"y":240,"wires":[["75dbb5d8.e57c7c","f35f654a.e27088","2e05b581.ccdcca"]],"info":"If the count hits zero, then continue to cycle the modem and reset the counter."},{"id":"e01664c1.117718","type":"debug","z":"3cddf8bf.263148","name":"Counter value","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"count","targetType":"msg","x":700,"y":560,"wires":[]},{"id":"b623cd47.4bc5a","type":"debug","z":"3cddf8bf.263148","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":390,"y":120,"wires":[]},{"id":"f35f654a.e27088","type":"debug","z":"3cddf8bf.263148","name":"Retries exhausted","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":970,"y":560,"wires":[]},{"id":"1d27d6b1.999099","type":"api-call-service","z":"3cddf8bf.263148","name":"Turn off modem","server":"8eacddf5.e8655","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.internet_modem_switch","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1380,"y":240,"wires":[["6fbfe15d.bdfc4"]]},{"id":"2e05b581.ccdcca","type":"change","z":"3cddf8bf.263148","name":"Reset counter","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":320,"wires":[["69ee2c72.f27534"]]},{"id":"df788bd8.d66a58","type":"inject","z":"3cddf8bf.263148","name":"Test unreachable","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"false","payloadType":"bool","x":180,"y":420,"wires":[["f0187957.afb998"]]},{"id":"1bdda3d6.25ec5c","type":"inject","z":"3cddf8bf.263148","name":"Test reachable","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":180,"y":560,"wires":[["f0187957.afb998"]]},{"id":"6fbfe15d.bdfc4","type":"delay","z":"3cddf8bf.263148","name":"Wait before turning on","pauseType":"delay","timeout":"30","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1740,"y":240,"wires":[["8ed46477.af72e8"]]},{"id":"8ed46477.af72e8","type":"api-call-service","z":"3cddf8bf.263148","name":"Turn on modem","server":"8eacddf5.e8655","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.internet_modem_switch","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1980,"y":240,"wires":[[]]},{"id":"8eacddf5.e8655","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]
Good point about multiple servers to ping. I should at least add Google’s 8.8.8.8 DNS as well, and only reboot if all of them fail.