Logging all state changes

Discussions about Z-Way software and Z-Wave technology in general
Post Reply
melchoir55
Posts: 14
Joined: 13 Nov 2013 07:27

Logging all state changes

Post by melchoir55 »

Greetings,

We are trying to write a plugin which logs all sensor state changes. Light goes on, we log it. Temperature goes up, we log it. Motion sensor trips, we log it. You get the picture. In order to accomplish this, we want the plugin to forward notifications of sensor state changes to a separate api we have running on localhost. The code for communicating with the api is easy. Boilerplate JS stuff.

However, we are having difficulty understanding how to tell zway to push all sensor state changes this way. We understand the principle of binding a single explicit sensor state change to a function call, but we want something more dynamic and preferably less verbose. Is anyone aware of how to get it to, for example, log all sensor state changes in a text file? The principle would be the same, we would just be redirecting it to an api instead of a file.

We're pretty stuck on this, so I'd really appreciate the help. If someone is interested in actually writing the plugin we could probably come to an agreement on some sort of compensation as well.
melchoir55
Posts: 14
Joined: 13 Nov 2013 07:27

Re: Logging all state changes

Post by melchoir55 »

Thanks for pointing this out. The plugin is a great start, but it doesn't actually forward all state changes. It seems to be forwarding thermostat changes fine, but manual lock and dimmer state changes are ignored (even though we see them in the zway server log file).

We'll try to mess around with it a bit, but we'd welcome any advice others might have on the subject.
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: Logging all state changes

Post by pz1 »

Did you look in the Recipes section? Suggest to have a look here viewtopic.php?f=3424&t=20528. I haven't tried it, but the code is very readable.
Post Reply