I have a Starlink connection and an Asus router. Every once in a while i get a dhcp error that only resolves with a router reboot.
I will set up a rule that pings google every 10 minutes and cycles a zigbee plug that the router is plugged into if it sees 100 percent packet loss.
I would like to also put something in the rule, however, that will only do this power cycle once every 12 hours just in case there is an actual internet outage. I don't want the router stuck in an endless reboot cycle.
I was thinking about setting a hub variable after the reset, then have the rule run only if the variable is not that value. Then have the variable reset every 12 hours or so.
There has got to be a simpler, more eloquent way to do this. I just cant wrap my head around it.
Set a variable to the last time you rebooted the router (unix timestamp style I think), then you just check if its been 12 hours worth of milliseconds since that was set when the rule triggers. If its too soon you bail, if its past it you set the variable again and reboot.
@aaiyar solution above is probably easiest, only downfall is if the hub reboots while the 12 hour delay is pending the delayed actions will never fire. So you could possibly get stuck where the Boolean is false and the rule will never trigger. For this reason I try to keep any delays in RM short.
Should be fine, ping is not very intense on the network. You could try it out and then check the Logs > App stats after a day or two and see how much CPU time that rule (app) is using up.
I also found out from someone else in another thread that delayed actions should actually survive a reboot as long as they were not supposed to happen DURING the reboot. Anything schedule during the hub being off/rebooting will be skipped.