Author Topic: List all Motion Sensors by Name, in Date/Time order when they were last Tripped  (Read 225 times)

Offline parkerc

  • Sr. Hero Member
  • ******
  • Posts: 2330
  • Karma: +32/-44
  • Life Moves Pretty Fast....
    • Node Central
This is likely a long shot, but after adding a DSC Alarm Panel to my Vera set up I now have a lot of motion sensors reporting in.

Has anyone created a dynamic list/report that shows all their door and motion sensors by name and sorts them all by when they were last Tripped - (with the most recent at the top of the list, ideally showing the date/time value too) ?

Ideally the generated list would be viewable via Vera's web interface.
« Last Edit: August 19, 2017, 07:13:49 pm by parkerc »

Online akbooer

  • Master Member
  • *******
  • Posts: 5131
  • Karma: +221/-67
  • "Less is more"
Yes, I've done exactly that in the past.  I may even have posted it.  I'll take look.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P.
Razberry, MySensors Arduino, HomeWave, AltUI, DataYours, openLuup, ZWay, ZeroBrane Studio.

Offline parkerc

  • Sr. Hero Member
  • ******
  • Posts: 2330
  • Karma: +32/-44
  • Life Moves Pretty Fast....
    • Node Central
That's great - thanks @akbooer

I hoped someone had already done it.

Online akbooer

  • Master Member
  • *******
  • Posts: 5131
  • Karma: +221/-67
  • "Less is more"
This functionality is already available to you through the EventWatcher plugin.  It will give a table, sortable by columns, including deviceId, name, last tripped, and status, in response to an HTTP request

Code: [Select]
http://VeraIP/port_3480/data_request?id=lr_EventWatcher&report=security
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P.
Razberry, MySensors Arduino, HomeWave, AltUI, DataYours, openLuup, ZWay, ZeroBrane Studio.

Offline parkerc

  • Sr. Hero Member
  • ******
  • Posts: 2330
  • Karma: +32/-44
  • Life Moves Pretty Fast....
    • Node Central
Great reminder, it's been a while since I've looked at your EventWatcher plugin, but that sounds perfect.

One observation -  the security report URL includes all (sub device) elements of a 3in1 sensor i.e

Quote
Last Trip               Device No.     Name   Current Status
21 Aug 2017, 21:17:17   351   12. Kitchen   0
21 Aug 2017, 21:13:12   353   02. Landing   0
21 Aug 2017, 21:10:33   176   Kitchen - 3-in-1 sensor   0
21 Aug 2017, 21:10:33   177   Kitchen - Motion Sensor   0
21 Aug 2017, 21:10:33   179   Kitchen Temperature   0
21 Aug 2017, 21:10:33   178   Kitchen - Light Sensor   0
21 Aug 2017, 21:06:03   378   18. Hallway   0
21 Aug 2017, 21:01:29   345   14. Kitchen Door.         0


Is there a way to hide the sub devices ; even though it looks like they also include the motion sensor's service/variable ?
« Last Edit: August 21, 2017, 05:31:58 pm by parkerc »

Online akbooer

  • Master Member
  • *******
  • Posts: 5131
  • Karma: +221/-67
  • "Less is more"
Is there a way to hide the sub devices ; even though it looks like they also include the motion sensor's service/variable ?

A good question.  IIRC (it was a very long time ago that I wrote EventWatcher) the functionality is based on sensor category.  I'll have to look again at the code, but it may be that the child devices have the wrong category number and actually indicate that they are motion devices.  If so, changing that should remove them from the list.  Of course, I could be wrong...
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P.
Razberry, MySensors Arduino, HomeWave, AltUI, DataYours, openLuup, ZWay, ZeroBrane Studio.

Offline parkerc

  • Sr. Hero Member
  • ******
  • Posts: 2330
  • Karma: +32/-44
  • Life Moves Pretty Fast....
    • Node Central

.. IIRC (it was a very long time ago that I wrote EventWatcher) the functionality is based on sensor category. 

By category, do you mean the following, which is showed against the device ?

-- cat2 = urn:schemas-upnp-org:device:DimmableLight:1   
-- cat2 = urn:schemas-micasaverde-com:device:PhilipsHueLuxLamp:1
-- cat3 = urn:schemas-upnp-org:device:BinaryLight:1
-- cat4 = urn:schemas-micasaverde-com:device:MotionSensor:1
-- cat4 = urn:schemas-micasaverde-com:device:DoorSensor:1
-- cat5 = urn:schemas-upnp-org:device:HVAC_ZoneThermostat:1
-- cat5 = urn:schemas-upnp-org:device:Heater:1
-- cat6 = urn:schemas-upnp-org:device:DigitalSecurityCamera:1
-- cat18 = urn:schemas-micasaverde-com:device:LightSensor:1
Etc.

If so, then looking at the individual light, motion and temp sensors (that are part of the 3in1 sensor) ; they all have the expected category number (above) assigned ?