SmartApp to alert if a device hasn't sent data in the last 2 hours

(John Rucker) #1

I’m working on Smart App that monitors our new (soon to be released) ZigBee device and I want to send an alert if the device hasn’t sent an attribute report to the SmartThings hub in the last two hours. Can someone point me in the right direction? I already have the Smart App sending a text message to my phone if a value is to high (super easy) but I also want to get an alert if my ZigBee device hasn’t sent data to the hub for some period of time. Do I need to record a time stamp of the last update in my custom device type and expose that as a custom attribute or is there a time stamp already recorded somewhere I can use?


( co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #2

Just pull the Event log for each of the Preference selected Devices, … right? The event log has a maximum duration of 7 days, but there should be something there for all shorter time periods.

(John Rucker) #3

Thanks Terry this looks perfect. It looks like a good starting point for me. I will dig in tomorrow morning.