Device Logs - Rule Engine

In Smartthings I can write a groovy script like

sensorType.eventsSince(date)

That allows me to query all sensors with a certain type and get the last event for all those sensors. This is useful for proof of life scenarios or elderly care should you wish to monitor all the sensors in a home and alert if there has been no movement from all sensors in a time frame.

My question, does the gateway currently store history for all devices and can it be queried? I am migrating from Smartthings and will need to build this into the gateway if not available.

I’m thinking a History adapter that allows you to select the event type in a rule for a single, multiple or all devices and set a condition to examine.

For instance Select motion sensors, event MOTION, select the period of time to check last motion.

Hello again @damooooooooooh,

Thanks for this question.

The new logging feature we added will log data for devices, but it will only log the properties the user chooses and they decide how long those logs are retained for. I don’t think we yet log events using the logging feature, but you can GET a log of recent events using the Web Thing API.

As far as I know, currently neither the Web Thing API nor the new logging API allow you to get all results for a certain sensor type (capability), but I can see that being possible.

I would suggest creating a new issue on GitHub to explain your use case and tagging it with “logs”.

Thanks