Time of last point where value = 1

Hi all,
I am using Grafana to display data from various Z-Wave (Zooz 4-in-1) motion sensor. I would like to get the time of the last detected motion (i.e. where AlarmMotion = 1).

The last motion detected was Dec 27, 2019 at 18.15.

Any help would be appreciated.