Last Time a Device Was Active

device_health
piston

#1

Is there a way to capture the date and time of a device’s last activity?

I am trying to design a piston to monitor device heath and have already tried using $status which shows if it’s active, inactive, offline etc.

The problem is that variable is not very accurate in that a device’s battery can die and the $status variable is never update.

In the IDE each device has a data field containing the date and time of a devices activity labeled “Last Active At” and I am wondering if anyone knows how to get that info into a piston?


#2

You could use on events action for a device
Then from there use $now to set that value to a variable


#3

Thanks. Tried your suggestion and it didn’t work. I’ve been using Simple Device Viewer to notify me when devices fall off the system. I was hoping to accomplish that in webCore but it doesn’t seem possible at this time. Thanks again.


#4

@Gopack2’s suggestion works great for me. Below is a snapshot of the piston:

Snapshot

Using this with the new Smartthings Wifi Plug as I’ve been having a recurring issue with these dropping off the network and not reconnecting (already in contact with ST support on the topic). This will feed another piston I have for an offline alert / health check so I can be aware when this drop occurs.