How to get current motion detector state?

Is there a way in the API to query the current active-cleared state for a motion detector sensor? I don’t see one. The Device table (as returned by core.get_devices) doesn’t include the current state. Am I missing something?

We need this ability to compare the device states as understood by the controller, with the device states we have in our system (which are driven by item_update events).

Hi @richK it should be items that you should get value from, not devices.
so you can get the items of a device by get_items_by_device_id() and then you can get the value by item.value

Thank you!