We have moved at community.getvera.com

Author Topic: EventWatcher - simple events, logs, and device status snapshots  (Read 132890 times)

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +291/-70
  • "Less is more"
EventWatcher - simple events, logs, and device status snapshots
« on: October 10, 2013, 12:32:26 pm »
--- EventWatcher is now available from the App Store --- http://apps.mios.com/plugin.php?id=4726

Here's a plugin called EventWatcher, which does three things: [Edit: actually, rather more now - see the documentation PDF for details]
  • functions as a local 'Alternate Event Server' for Vera notifications
  • watches selected device categories and logs key variable changes
  • generates snapshots of current device variable values and time last changed
...all the above written to plain text files, very simple formats, viewable with a web browser.

The whole point is to address the needs voiced by those who want:
  • access to events locally and independently of Mios.com
  • much simpler and less cluttered logging
  • simple reporting of device status
This, in no way, is meant to replace LogViewer or InfoViewer.  It's just a simple tool that may be useful.

Events:

The functionality of an Alternate Event Server is described here http://wiki.micasaverde.com/index.php/AlternateEventServer and elsewhere, but all that's need is to browse this URL
Code: [Select]
http://[your Vera IP]:3480/data_request?id=variableset&Variable=AltEventServer&Value=127.0.0.1
and you should receive the status OK.

EventWatcher then writes each event to a file specified by the variable eventFilename (by default "/www/events.txt") which is over-written on every restart (to keep the size down).  If this variable is blank, then EventWatcher doesn't run this functionality.

In addition, a JSON string with the event parameters is written to the variable jsonString which can be watched by another application and read to process the event further. (This string doesn't display correctly in UI5 because it contains quote characters, but it's really all there.)


Watched Variables:

To make it simple to specify which variables to watch, EventWatcher uses the Luup device categorisation listed here: (http://wiki.micasaverde.com/index.php/Luup_UPNP_Files#Device_Categories). 

The numeric values have been mapped to a single character symbol, and a variable WatchCategories containing a string of these letters specifies which categories to watch.  Within each category, there is the choice to watch either ALL the variables of the matching service, or just the most significant one (eg. CurrentTemperature, or CurrentLevel), as defined by WatchAllVsInService (enabled by the value "1"). The category number, symbol, service and variable names are defined in the table below:

Code: [Select]
1. "F",                                                                          --  DEVICE_CATEGORY_INTERFACE
 2. "X", "urn:upnp-org:serviceId:SwitchPower1",              "Status"             --  DEVICE_CATEGORY_DIMMABLE_LIGHT
 3. "X", "urn:upnp-org:serviceId:SwitchPower1",              "Status"             --  DEVICE_CATEGORY_SWITCH   
 4. "S", "urn:micasaverde-com:serviceId:SecuritySensor1",    "Tripped"            --  DEVICE_CATEGORY_SECURITY_SENSOR
 5. "K",                                                                          --  DEVICE_CATEGORY_HVAC
 6. "C",                                                                          --  DEVICE_CATEGORY_CAMERA
 7. "D",                                                                          --  DEVICE_CATEGORY_DOOR_LOCK
 8. "W",                                                                          --  DEVICE_CATEGORY_WINDOW_COV
 9. "R",                                                                          --  DEVICE_CATEGORY_REMOTE_CONTROL
10. "I",                                                                          --  DEVICE_CATEGORY_IR_TX
11. "O",                                                                          --  DEVICE_CATEGORY_GENERIC_IO
12. "G", "urn:micasaverde-com:serviceId:GenericSensor1",     "CurrentLevel"       --  DEVICE_CATEGORY_GENERIC_SENSOR
13. "B",                                                                          --  DEVICE_CATEGORY_SERIAL_PORT
14. "Y", "urn:micasaverde-com:serviceId:SceneController1",   "sl_SceneActivated"  --  DEVICE_CATEGORY_SCENE_CONTROLLER
15. "V",                                                                          --  DEVICE_CATEGORY_AV
16. "H", "urn:micasaverde-com:serviceId:HumiditySensor1",    "CurrentLevel"       --  DEVICE_CATEGORY_HUMIDITY
17. "T", "urn:upnp-org:serviceId:TemperatureSensor1",        "CurrentTemperature" --  DEVICE_CATEGORY_TEMPERATURE
18. "L", "urn:micasaverde-com:serviceId:LightSensor1",       "CurrentLevel"       --  DEVICE_CATEGORY_LIGHT_SENSOR
19. "Z",                                                                          --  DEVICE_CATEGORY_ZWAVE_INT
20. "J",                                                                          --  DEVICE_CATEGORY_INSTEON_INT
21. "M", "urn:micasaverde-com:serviceId:EnergyMetering1",    "Watts"              --  DEVICE_CATEGORY_POWER_METER
22. "A",                                                                          --  DEVICE_CATEGORY_ALARM_PANEL
23. "P",                                                                          --  DEVICE_CATEGORY_ALARM_PARTITION
You'll see that some services/variables are missing - I'm open to suggestions as to how to populate these items.

Every time a watched variable changes, a line is written to a file specified by the variable WatchFilename (by default "/www/watch.txt"), which is similarly over-written on every restart. To keep the file length down, PING sensors are excluded from the watched security devices.

The default WatchCategories string is "XYSM", which watches switches and dimmers, scene controllers, security devices, and meters.

Status Reports:

Currently, status reports may be generated for two major groups of sensors: environmental measurements (Temperature, Humidity, Light, Generic), and security devices (category 4). Whether these reports are generated depends on the value of two variables (SensorFilename and SecurityFilename) with appropriate defaults ("/www/sensors.txt" and "/www/security.txt").  These reports are generated on regular intervals as specified by the variable SensorBlogInterval (in units of minutes).

Installation:

The key and certificate files should go into a top-level directory (you will have to create) /eventServer/.  The icon file goes to /www/cmh/skins/default/icons/.  Other files can be uploaded via UI5 using Luup files > Browse > Upload.


[---Edit" Most of the above text is hopelessly out of date now, but I keep it for posterity.  Read the documentation PDF for THE TRUTH ---]

Comments/ideas welcomed.

--- EventWatcher is now available from the App Store --- http://apps.mios.com/plugin.php?id=4726
« Last Edit: December 08, 2014, 04:25:21 pm by akbooer »
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline SOlivas

  • Sr. Member
  • ****
  • Posts: 282
  • Karma: +1/-1
Re: EventWatcher - simple events, logs, and device status snapshots
« Reply #1 on: October 11, 2013, 01:06:45 am »
Sounds like a great idea.  Have you thought about expanding this further to supporting an external server as well instead of being kept on the unit itself?



Vera 3 (1.5.622) / 9x GE/Jasco 45609 / 2x GE/Jasco 45612 / 2x GE/Jasco 45614 / 1x MIMO Lite
1x Twine (http://forum.micasaverde.com/index.php/topic,15617.0.html), DSC Security System, Honeywell  YTH8320ZW1007 Thermostat, 1x Fortrezz WWA-01, 1x CA9000 Wireless PIR Sensor

Offline korttoma

  • Hero Member
  • *****
  • Posts: 729
  • Karma: +26/-5
Re: EventWatcher - simple events, logs, and device status snapshots
« Reply #2 on: October 11, 2013, 02:38:59 am »
thanks a million for this akbooer! I will try it out when I get a chance.

Br,
Tomas
- Tomas

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +291/-70
  • "Less is more"
Re: EventWatcher - simple events, logs, and device status snapshots
« Reply #3 on: October 11, 2013, 06:31:16 am »
Sounds like a great idea.  Have you thought about expanding this further to supporting an external server as well instead of being kept on the unit itself?
One of the original aims was to be self-contained, in particular NOT to have to set up an external server for event.  However, for archiving it would be good to copy the files before they are over-written on restart.  Could easily do this with scp or some such utility.

For the log files I was inspired by the work of Dream Green House http://www.dreamgreenhouse.com/plans/hcs/logs.php and after the date/time each line has single letter indicating which class of device the log comes from, followed by device number and name.  Here are some snippets of the files currently produced:

Events: (not very interesting, I've only got my front door set up to produce events!)

Code: [Select]
2013-10-10 22:59:51 E [000] "Event Watcher" Vera = RESTART
2013-10-10 22:59:53 E [207] "Event Watcher" Front Door = Tripped
2013-10-11 08:56:06 E [207] "Event Watcher" Front Door = Tripped
2013-10-11 08:58:16 E [207] "Event Watcher" Front Door = Tripped
2013-10-11 09:25:43 E [207] "Event Watcher" Front Door = Tripped

Watched Variables:

Code: [Select]
2013-10-10 22:59:51 E [000] "Event Watcher" Vera = RESTART
2013-10-10 22:59:53 S [294] "Barn 4-in-1 (motion)" Tripped = 0
2013-10-10 23:12:30 X [146] "Bedside 1" Status = 1
2013-10-10 23:12:30 X [147] "Bedside 2" Status = 1
2013-10-10 23:12:30 Y [170] "MiniMote #2" sl_SceneActivated = 4
2013-10-10 23:17:47 M [174] "Power Meter" Watts = 3717

Environmental Sensors: (by category and sorted by name)

Code: [Select]
11-Oct-2013 11:25:09   Environmental sensor snapshot:

LightSensor1:
     197  [295] Barn 4-in-1 (light)
       ?  [261] Dummy Light Sensor
      48  [279] Hall 4-in-1 (light)
     328  [283] Studio 4-in-1 (light)

TemperatureSensor1:
      18  [296] Barn 4-in-1 (temp)
    11.8  [324] Garage - Temperature
      11  [048] Garage Temperature
      20  [051] Greenhouse Temperature
    19.1  [318] Guest - Temperature
      23  [280] Hall 4-in-1 (temp)
      16  [006] High Temperature
    19.2  [310] Indoor - Temperature
      12  [005] Low Temperature
      20  [272] Max/Min Temp (greenhouse)
    12.2  [308] Outdoor - Temperature
      11  [055] Shed Temperature
    14.3  [326] Studio - Temperature
      14  [284] Studio 4-in-1 (temp)
    13.3  [004] Temperature
    13.3  [273] Temperature Statistics

HumiditySensor1:
      57  [297] Barn 4-in-1 (humidity)
      80  [325] Garage - Humidity
      87  [047] Garage Humidity
      37  [050] Greenhouse Humidity
      59  [319] Guest - Humidity
      45  [281] Hall 4-in-1 (humidity)
      74  [007] Humidity
      65  [317] Indoor - Humidity
      83  [316] Outdoor - Humidity
      90  [054] Shed Humidity
      72  [327] Studio - Humidity
      60  [285] Studio 4-in-1 (humidity)

GenericSensor1:
     702  [320] Guest - CO2
     450  [313] Indoor - CO2
      43  [315] Indoor - Noise
  1024.2  [314] Indoor - Pressure
     594  [328] Studio - CO2
      35  [330] Studio - Noise
  1024.0  [329] Studio - Pressure

Security: (sorted by date/time of last state change)

Code: [Select]
Security snapshot at 11-Oct-2013 11:25:06

Friday, Oct 11:
  11:21:31  (0)  [207] Front Door
  11:13:25  (0)  [294] Barn 4-in-1 (motion)
  10:55:31  (0)  [214] Ping Apple TV Barn
  08:56:22  (0)  [282] Studio 4-in-1 (motion)
  04:55:46  (1)  [009] Ping Vera #1

Thursday, Oct 10:
  18:18:15  (1)  [212] Ping Vera #2
  16:31:05  (0)  [259] Garage Door
  16:12:00  (0)  [262] Shed Door

Saturday, Oct 05:
  17:57:39  (0)  [251] Studio Door
  12:26:10  (0)  [253] Studio Window

Tuesday, Aug 13:
  07:21:07  (1)  [277] Hall 4-in-1 (motion)

Monday, Aug 12:
  12:08:28  (0)  [215] Ping Studio-Humax

Thursday, May 16:
  11:59:01  (0)  [235] Barn Door

These are the reports that I have found useful.  However, it would be easy to add more.  One thought is something which lists out all devices and scenes, as has been done by others already.

« Last Edit: October 11, 2013, 11:21:06 am by akbooer »
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline emtschei

  • Jr. Member
  • **
  • Posts: 98
  • Karma: +0/-0
Re: EventWatcher - simple events, logs, and device status snapshots
« Reply #4 on: November 11, 2013, 12:57:04 pm »
I found this great plugin sometime end of October and installed it to cover my 'needs' to see events happening in an easier way than going thru the Luup log.

At that time I got output like:
Code: [Select]
19:30:52.450 S [029] "Entrance door sensor" Tripped = 1
19:30:56.584 S [029] "Entrance door sensor" Tripped = 0
19:31:29.250 S [032] "Heartbeat motion sensor" Tripped = 1
19:33:56.119 S [032] "Heartbeat motion sensor" Tripped = 0

It bugged me though that I did not have a date stamp and wondered if I can adapt the code to fix this.
Today I went back to this post and actually noticed that the example given shows the date of the event.
Aha! So I figured I re-download the zip file and re-install the Luup files - and true enough, I have a proper time stamp of my events.

However, I noticed that now multiple lines are written for the same events (I have not changed anything else).

Code: [Select]
2013-11-11 13:38:32 S [032] "Heartbeat motion sensor" Tripped = 1
2013-11-11 13:38:33 S [032] "Heartbeat motion sensor" Tripped = 1
2013-11-11 13:38:33 S [032] "Heartbeat motion sensor" Tripped = 1
2013-11-11 13:40:48 S [032] "Heartbeat motion sensor" Tripped = 0
2013-11-11 13:40:49 S [032] "Heartbeat motion sensor" Tripped = 0
2013-11-11 13:40:49 S [032] "Heartbeat motion sensor" Tripped = 0
2013-11-11 13:40:50 S [032] "Heartbeat motion sensor" Tripped = 0
2013-11-11 13:40:50 S [032] "Heartbeat motion sensor" Tripped = 0
2013-11-11 13:40:51 S [032] "Heartbeat motion sensor" Tripped = 0
2013-11-11 13:40:51 S [032] "Heartbeat motion sensor" Tripped = 0
2013-11-11 13:40:56 S [029] "Entrance door sensor" Tripped = 1
2013-11-11 13:40:57 S [029] "Entrance door sensor" Tripped = 1
2013-11-11 13:40:57 S [029] "Entrance door sensor" Tripped = 1
2013-11-11 13:41:01 S [029] "Entrance door sensor" Tripped = 0
2013-11-11 13:41:01 S [029] "Entrance door sensor" Tripped = 0
2013-11-11 13:41:02 S [029] "Entrance door sensor" Tripped = 0

I am wondering what causes this behavior all in a sudden or whether maybe the code has changed between my downloads (as the milliseconds disappeared too).

MJ
« Last Edit: November 11, 2013, 02:00:00 pm by emtschei »

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +291/-70
  • "Less is more"
Re: EventWatcher - simple events, logs, and device status snapshots
« Reply #5 on: November 11, 2013, 01:33:13 pm »
I am wondering what causes this behavior all in a sudden or whether maybe the code has changed between my downloads (as the milliseconds disappeared too).
So I did change the code to remove milliseconds (which, frankly, seemed pointless, because the timing of events, etc. is unlikely to be that accurate) and also added a date.  My assumption is that your original download was from an earlier post of what I originally called "Event Server" here: http://forum.micasaverde.com/index.php/topic,9525.msg128860.html#msg128860

What I'm, less certain about is why you're getting multiple events... does this just happen at startup, or does it persist?  I've notices that some old notifications seem to be hanging around after a restart.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +291/-70
  • "Less is more"
Re: EventWatcher - simple events, logs, and device status snapshots
« Reply #6 on: November 11, 2013, 01:39:40 pm »
Actually, here's an updated Lua file which adds a few more things that you can 'watch' (see the new device variables for filename parameters - it watches system parameters of cpu and memory usage, and produces a file of your device configuration at startup).
 
Does this still give you the problem?
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline emtschei

  • Jr. Member
  • **
  • Posts: 98
  • Karma: +0/-0
Re: EventWatcher - simple events, logs, and device status snapshots
« Reply #7 on: November 11, 2013, 02:02:26 pm »
Thanks for your reply @akbooer.
I don't think I downloaded from the EventServer thread as my first downloaded file was named EventWatcher.zip downloaded on 11-Oct-2013.
I was restoring this download from my backup and strangely enough the time stamps of your files from the October download and today's are the same  ???.

As for multiple events .. this is persistent. Each event is reported multiple time on each occurrence. I even rebooted the Vera3.

I noticed though that in the Luup log I have multiple entries too. I think it could have to do with the scenes that respond to these sensors.

Code: [Select]
06 11/11/13 14:46:18.498 Device_Variable::m_szValue_set device: 32 service: urn:micasaverde-com:serviceId:SecuritySensor1 variable: Tripped was: 1 now: 0 #hooks: 2 upnp: 0 v:0xb500d0/NONE duplicate:0 <0x2f5a0680>
07 11/11/13 14:46:18.499 Event::Evaluate 8 Heartbeat triggered scene 1) I'm alive (reset timers) is false repeat 0/-1 <0x2f5a0680>
50 11/11/13 14:46:18.997 luup_log:13: Parsing : 23.22.32:000B,02 - 23.22.32 is closed. <0x2f5a0680>
50 11/11/13 14:46:18.997 luup_log:13: Sending to child id 32 (23.22.32) <0x2f5a0680>
06 11/11/13 14:46:18.998 Device_Variable::m_szValue_set device: 32 service: urn:micasaverde-com:serviceId:SecuritySensor1 variable: Tripped was: 0 now: 0 #hooks: 2 upnp: 0 v:0xb500d0/NONE duplicate:0 <0x2f5a0680>
07 11/11/13 14:46:18.998 Event::Evaluate 8 Heartbeat triggered scene 1) I'm alive (reset timers) is false repeat 0/-1 <0x2f5a0680>
50 11/11/13 14:46:19.507 luup_log:13: Parsing : 23.22.32:000B,00 - 23.22.32 is closed. <0x2f5a0680>
50 11/11/13 14:46:19.507 luup_log:13: Sending to child id 32 (23.22.32) <0x2f5a0680>
06 11/11/13 14:46:19.508 Device_Variable::m_szValue_set device: 32 service: urn:micasaverde-com:serviceId:SecuritySensor1 variable: Tripped was: 0 now: 0 #hooks: 2 upnp: 0 v:0xb500d0/NONE duplicate:0 <0x2f5a0680>
07 11/11/13 14:46:19.508 Event::Evaluate 8 Heartbeat triggered scene 1) I'm alive (reset timers) is false repeat 0/-1 <0x2f5a0680>
50 11/11/13 14:46:20.027 luup_log:13: Parsing : 23.22.32:000B,01 - 23.22.32 is closed. <0x2f5a0680>
50 11/11/13 14:46:20.027 luup_log:13: Sending to child id 32 (23.22.32) <0x2f5a0680>
06 11/11/13 14:46:20.028 Device_Variable::m_szValue_set device: 32 service: urn:micasaverde-com:serviceId:SecuritySensor1 variable: Tripped was: 0 now: 0 #hooks: 2 upnp: 0 v:0xb500d0/NONE duplicate:0 <0x2f5a0680>
07 11/11/13 14:46:20.028 Event::Evaluate 8 Heartbeat triggered scene 1) I'm alive (reset timers) is false repeat 0/-1 <0x2f5a0680>
50 11/11/13 14:46:20.747 luup_log:13: Parsing : 23.22.32:000B,02 - 23.22.32 is closed. <0x2f5a0680>
50 11/11/13 14:46:20.747 luup_log:13: Sending to child id 32 (23.22.32) <0x2f5a0680>
06 11/11/13 14:46:20.748 Device_Variable::m_szValue_set device: 32 service: urn:micasaverde-com:serviceId:SecuritySensor1 variable: Tripped was: 0 now: 0 #hooks: 2 upnp: 0 v:0xb500d0/NONE duplicate:0 <0x2f5a0680>
07 11/11/13 14:46:20.748 Event::Evaluate 8 Heartbeat triggered scene 1) I'm alive (reset timers) is false repeat 0/-1 <0x2f5a0680>

Code: [Select]
2013-11-11 14:46:18 S [032] "Heartbeat motion sensor" Tripped = 0
2013-11-11 14:46:18 S [032] "Heartbeat motion sensor" Tripped = 0
2013-11-11 14:46:19 S [032] "Heartbeat motion sensor" Tripped = 0
2013-11-11 14:46:20 S [032] "Heartbeat motion sensor" Tripped = 0
2013-11-11 14:46:20 S [032] "Heartbeat motion sensor" Tripped = 0

What confuses me is that this did not happen before my 're-install' today despite the fact that I always had multiple log entries in the Luup log.

MJ

PS: Thanks for the new file. I'll give it a try right away.

Offline emtschei

  • Jr. Member
  • **
  • Posts: 98
  • Karma: +0/-0
Re: EventWatcher - simple events, logs, and device status snapshots
« Reply #8 on: November 11, 2013, 02:26:54 pm »
Thanks for the new lua file. Nice new reports.

The behavior is still the same though (what was to be expected, I believe).

Code: [Select]
2013-11-11 15:12:46 S [029] "Entrance door sensor" Tripped = 1
2013-11-11 15:12:46 S [029] "Entrance door sensor" Tripped = 1
2013-11-11 15:12:47 S [029] "Entrance door sensor" Tripped = 1
2013-11-11 15:12:50 S [029] "Entrance door sensor" Tripped = 0
2013-11-11 15:12:51 S [029] "Entrance door sensor" Tripped = 0
2013-11-11 15:12:51 S [029] "Entrance door sensor" Tripped = 0

Here too, this sensor is referenced in multiple scenes and I too have (always had) multiple entries from the scenes in the Luup log.

Btw. I did NOT have the files /www/security.txt and /www/sensors.txt files before me re-install today. Another  ???.

But I noticed in the security.txt file the following entry:
Code: [Select]
11-Nov-2013 15:17:00   Security sensor snapshot:

Tuesday, Sep 17:
  11:00:28  (0)  [032] Heartbeat motion sensor
Wonder what that September time stamp is all about. It might be around the time I first installed/configured this senor.

Btw2: The door lock is a Yale Realliving lock operating with Z-Wave. The motion sensor is an Insteon model 2842-222 connected to my Vera3 running the latest Fw with the PLM 2413U and Altsteon.

MJ


Offline emtschei

  • Jr. Member
  • **
  • Posts: 98
  • Karma: +0/-0
Re: EventWatcher - simple events, logs, and device status snapshots
« Reply #9 on: November 11, 2013, 04:01:13 pm »
Btw2: The door lock is a Yale Realliving lock operating with Z-Wave. The motion sensor is an Insteon model 2842-222 connected to my Vera3 running the latest Fw with the PLM 2413U and Altsteon.

Corrigendum: While the door lock is a Yale lock it is not part of the equation. The sensor in question here is an Insteon Open/Close Sensor model 2843-222 connected too to the PLM and operated via Altsteon.

Offline emtschei

  • Jr. Member
  • **
  • Posts: 98
  • Karma: +0/-0
Re: EventWatcher - simple events, logs, and device status snapshots
« Reply #10 on: November 11, 2013, 05:01:04 pm »
Some more info:

Using the Altsteon command line interface (altsteon_cli) I see that the multiple events seem to come from the sensors themselves (or Altsteon). Why? Who knows ...
So it does not look like an issue with the EventWatcher - which we never doubted, didn't we  :).

Code: [Select]
Motion Sensor:
23.22.32:000A,02 - 23.22.32 is open.
23.22.32:000A,02 - 23.22.32 is open.
23.22.32:000A,00 - 23.22.32 is open.
23.22.32:000B,02 - 23.22.32 is closed.
23.22.32:000B,02 - 23.22.32 is closed.
23.22.32:000B,00 - 23.22.32 is closed.
23.22.32:000B,01 - 23.22.32 is closed.
23.22.32:000B,02 - 23.22.32 is closed.

Open/Close sensor
23.39.E6:000A,02 - 23.39.E6 is open.
23.39.E6:000A,02 - 23.39.E6 is open.
23.39.E6:000A,00 - 23.39.E6 is open.
23.39.E6:000B,02 - 23.39.E6 is closed.
23.39.E6:000B,02 - 23.39.E6 is closed.
23.39.E6:000B,00 - 23.39.E6 is closed.

Still puzzled though why I did not see this in the watch.txt file before my re-install - as mentioned earlier.

Thanks @akbooer.

MJ

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +291/-70
  • "Less is more"
Re: EventWatcher - simple events, logs, and device status snapshots
« Reply #11 on: November 11, 2013, 05:43:34 pm »
So it does not look like an issue with the EventWatcher - which we never doubted, didn't we  :).

Not for a moment.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +291/-70
  • "Less is more"
Re: EventWatcher - simple events, logs, and device status snapshots
« Reply #12 on: December 04, 2013, 08:03:56 am »
Here's a significant update to EventWatcher.  I've abandoned the static file snapshot concept and replaced it with dynamic server pages.  EventWatcher is now able to respond to a variety of HTTP requests for different report formats including: devices (and useful subsets of them), scenes, event logs, and system parameters.  All WATCH-ed events are stored in a one-day long buffer, available for analysis.

This change offers the following advantages:
  • takes up no extra filespace for the static snapshot files
  • reports are generated on-demand (not polled) and so are right up to date
  • reports are interactive tables which can be scrolled and sorted by column
  • graphical output for CPU usage, memory, and watched variables (since last restart or last 24 hours).
  • HTTP requests work both locally and over the internet via MiOS secure servers (unlike dataMine)
I've attached a couple of snapshots of reports to give the flavour.

HTTP requests are of the form:
Code: [Select]
http://[your-Vera-IP]:3480/data_request?id=lr_eventWatcher&report=XXX

where XXX is one of the following (which may be truncated to three or more letters):
  • devices - lists all devices (physical and virtual) on the system
  • scenes - all scenes, their triggers, schedules, actions, and any attached Lua code
  • security - current status and last tripped time for security devices
  • environment - environmental sensors including temperature, humidity, light, and other generic types
  • batteries or battery - current level of all battery powered devices
  • log - log of monitored events and watched variables
  • cpu - graphical plot of CPU usage (5 minute averages)
  • memory - graphical plot of memory usage (5 minute averages)
  • plot&device=NNN - plots the major variable of the specified device number (if it is being watched)
Additionally, options may be added to size the report page, for example:
Code: [Select]
http://[your-Vera-IP]:3480/data_request?id=lr_eventWatcher&report=scenes&width=1200&height=750

These requests may also be embedded into other web pages, so, for example, I have a web page which shows the recent CPU and Memory statistics (image attached).

If you do want to try out the scenes report, then you need to have the JSON module described here installed:
http://forum.micasaverde.com/index.php/topic,17499.msg137677.html#msg137677

I'd be very grateful of any feedback. If positive, I'll release it on the App store.
 
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline korttoma

  • Hero Member
  • *****
  • Posts: 729
  • Karma: +26/-5
Re: EventWatcher - simple events, logs, and device status snapshots
« Reply #13 on: December 05, 2013, 02:47:05 pm »
Please do release it to the App store ;)
- Tomas

Offline betabob

  • Sr. Newbie
  • *
  • Posts: 46
  • Karma: +1/-0
Re: EventWatcher - simple events, logs, and device status snapshots
« Reply #14 on: December 05, 2013, 04:18:14 pm »
Please do release it to the App store ;)

+1
The nice thing about Standards is you have so many to choose from...