Is there a way to test if a devices last event has been updated in the last x hours?

Preface:
I have a temperature/humidity probe connected to a Konnected board and it will eventually stop sending updates to the hub. In order to fix it I just pull the negative lead then plug it back in effectively rebooting that temperature probe. Since this probe is inside our shed were I cannot easily access during the winter, I cut the negative lead and put it through a relay connected to the same Konnected board so I can remotely cut power temporarily at a push of the momentary relay switch.

Question:
I'd like to be able to check if that device hasn't updated a value in the last 12 hours to have the momentary relay switch turned on to effectively reboot the device.

I was thinking of using the Last Event Device or some other method to check periodically say maybe every 6 hours if the device hasn't updated in the last 6 hours to have that momentary relay switch turned on to reset the sensor automatically. Although I'm guessing the Last Event Device is the same as the Last Updated dashboard attribute and that shows up as Date and Time so I'm not sure how I would go about testing that? The If Last Event Device options are standard operators like > a value but what value, how do i test for > 6 hours?

Thanks.

Woud @bptworld's Device Watchdog do the job for you.
It works well for me.

2 Likes

Device Watchdog is what is alerting me when it stops reporting but I didn't think to look at the options in there closer. There is an option to "Turn on this device on if there is activity data to report" which looks like it might do what I want so I created a new child object in Device Watchdog to only monitor that sensor and turn on the reset momentary switch for that relay and set it to run a couple of hours before the child object that notifies me if a device hasn't updated in the last 14 hours. I also set it to push a message anytime it reports (turns on the switch) for now so I know if it fixed the issue.

I'll know for sure the next time the device stops updating which could take anywhere from a few days to months, but I'm guessing your right that Device Watchdog is the answer.

Thanks!

1 Like

Device Watchdog worked great for this, last night I noticed that device hadn't updated since the night before so when my Device Watchdog rule ran again at 11pm it turned on the reset momentary switch (relay) which cut the power to the temperature sensor for a few seconds then the sensor updated the hub with both temp and humidity immediately after it's power was restored so when my next Device Watchdog child ran at 1am that checks for devices that have stopped responding it had nothing to report! Thanks again.