EventWatcher - simple events, logs, and device status snapshots

Hi

Great glad you liked the idea - what I can share is that it was not a straight forward process for me ;), i always tried to mount the drive so it would work as a local share, but that has proven problematic I think due to permissions. Plus I have two NAS drives each with adifferent linux distribution on and they seemed to work differently. (Nothing is ever plain sailing for me :slight_smile: )

In the end I somehow got it to work, and I could open and append a line of text to a remote text.txt file on my NAS

I’d ideally like it to work as a network share, rather than having to mount the drive as I’ve not had much luck with Vera and mounting drives (I still can’t get DataMine to write to that external mount)

But then again, I 'm not a technical guy, so it very much trial and lots of errors, but if you are linux minded then I’m sure something can be worked out.

[quote=“akbooer, post:18, topic:177299”]Sounds like an install problem, indeed.

[ul][li]what version number is given under the Advanced settings?[/li]
[li]what EventWatcher messages are written to the log on startup?[/li]
[li]do other reports work, like: [tt]&report=log[/tt]?[/li][/ul]

That’ll give us something to go on…[/quote]

Yes it is installation problem. The device icon doe not show up on Device tab at all. I uploadrd the event viewer files through Vera upload page and reloaded Vera. But no device icon showed up.

Sounds, perhaps, like you may not have quite done the install as per the instructions at the start of this thread? You will have to use scp or Winscp or other similar utility for these particular files…

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.
Sounds, perhaps, like you may not have quite done the install as per the instructions at the start of this thread? You will have to use scp or Winscp or other similar utility for these particular files...

These are all EventWatcher I have on my Vera. Are they correct (see the pic please ) ?

==update

I recreated the device and it is working.

Thanks

Akbooer,

How difficult is to create something like the attached pic to monitor and control devices?

Thanks

First, I’m glad that you got it working at last!

Secondly, monitoring is easy - I saw your earlier post (I think it was you*) with a Homeseer screenshot and thought, yes, I can add rooms and current status and last time changed easily. But control is a different matter. I do not do Web GUIs. It’s almost trivial, I’m sure, but that’s not what I do. More than happy if someone else can!


Hi @akbooer

Please forgive my ignorance, but why is a key and certificate file needed for this to work?

It’s only required for the Alternate Event Server functionality, that is event logging, where it is needed for the secure HTTPS protocol. Everything else (variable watch, reports, graphs, …) will function without them.

Hi @akbooer

Considering i now have Datamine logging to an external NAS, would it be possible for you to help me set your EventWatcher plugin to also write to the external NAS too ?

Either the same share or as you have added web functionality i could write it to the web area on the NAS…

What is it you want write? I actually removed the file write functionality when I added the dynamic web pages, but I can put it back. I suppose you are after a simple log-type file. Should it be machine readable (JSON, etc) ? Or CSV ? Or plain text … ?

[quote=“akbooer, post:30, topic:177299”]What is it you want write? I actually removed the file write functionality when I added the dynamic web pages, but I can put it back. I suppose you are after a simple log-type file. Should it be machine readable (JSON, etc) ? Or CSV ? Or plain text … ?[/quote]Not sure :wink:

I’m looking to have all watched events stored continuously on an external share, so I’m not sure what the best route is.

I’m currently torn between what I get from DataMine and what your eventwatcher seeks to captures. The graphing on DM is great for temperature changes etc, but things like door opened and closed or on/off changes at nicer in a listed log file.

So just to confirm my thoughts are to have a continious log maintained of watched events stored externally to Vera. How best should that be done do you think ?

Have you seen the security event display format at:[url=http://www.dreamgreenhouse.com/projects/2012/visualisation/index.php]Stylish and environmental smart home design & build

So just to confirm my thoughts are to have a continious log maintained of watched events stored externally to Vera. How best should that be done do you think ?

Depends what you want to use it for… browse to be informed about recent events / archived for later programmatic analysis.

No, but I was only checking that site out the other day (i like a lot of what they are doing) - I’ll look at the link

Both.

To have the ability to check what’s occurred during the day or to look back at the last week or two (for example if you have been a way on business or vacation) and to be able to compare against last years trends/activity.

OK, I’ve reinstated writing a physical file log, but with a somewhat different modus operandi. There’s a new device variable [tt]LogDirectory[/tt] - if it’s blank then no file is written; if it’s non-blank it’s the path to an existing directory where the log file is written, surviving restarts, one file per week.

The file name is [tt]NNNN.txt[/tt], where NNN is the Unix epoch week number - we’re currently in week 2296 which starts on a Thursday. OK, a bit bizarre, but easy to compute and, in fact, compatible with the way that dataMine arranges its file system. Typical entries are as follows:

2014-01-06 20:02:51.144 M 174 Power Meter, Watts = 2541
2014-01-06 20:05:59.134 X 346 Chandelier, Status = 0
2014-01-06 20:12:51.128 X 190 Dining Table, Status = 0
2014-01-06 20:20:35.235 S 294 Barn 4-in-1 (motion), Tripped = 1
2014-01-06 20:20:51.146 M 174 Power Meter, Watts = 3495

Assuming you have dataMine running and writing to a NAS mount on /dataMine/, then setting [tt]LogDirectory[/tt] to ‘/dataMine/EventWatcher/’, after having created that directory manually on the NAS, will result in a file there: 2296.txt (this week, 2297.txt next week, etc…) File size will depend, of course, on what you choose to watch and whether you also choose to monitor events, but currently I’m estimating about 500 lines per day for my largest system, which would mean ~200kB per file per week, or about 10Mb per year. Very manageable, and MUCH easier than trawling a full Vera log file.

I’ve made a few other changes. After the recent interesting discussion on memory usage, I’ve added ‘free’ memory to the [tt]&report=memory[/tt] plot - example attached.

Comments welcomed.

I've added 'free' memory to the [tt][b]&report=memory[/b][/tt] plot - example attached.

…and here’s the way it was heading just before my last restart.

What’s the blue line ?
And do you have a graph showing pre/post restart memory usage ?

[quote=“RichardTSchaefer, post:36, topic:177299”]What’s the blue line ?
And do you have a graph showing pre/post restart memory usage ?[/quote]

Blue line is Available Memory, that is, Cached + Free. So the blue area is cached, the red area is free.

EventWatcher currently overwrites its own log on restart (a design feature). I’ve just started logging free memory, as well as available memory, with dataMine to get a clearer picture across restarts.

Hi @akbooer

Thanks for the updates, it’s looking good from what you’ve shared so far.

Where is the latest version, would you be able to update your very first post so it always has the very latest build?

I followed the instructions on the first post but it is not creating the device… I tried uploading the files twice now.

The LUUP files are showing as uploaded and I reloaded a few times. No TXT files are being created in WWW.

I did receive the ‘OK’ on screen when I ran…
http://[your Vera IP]:3480/data_request?id=variableset&Variable=AltEventServer&Value=127.0.0.1

thoughts?

I’ll revise the first post to reflect the latest, as @parkerc suggests.
You do have to create the device manually, once you’ve downloaded the files.

Recent versions do not write files to www, but generate pages dynamically on demand (see major update earlier in this thread)

The ‘OK’ comes from Vera, not the plugin itself.