Action on Remote Control Events

Discussions about RaZberry - Z-Wave board for Raspberry computer
Post Reply
Prometheus
Posts: 20
Joined: 27 Oct 2014 22:55

Action on Remote Control Events

Post by Prometheus »

As many others users I'm pretty new to the Z-Wave technology and my (little) network is running stable. Right now I'm "only" using: RaspiPi & Razberry, 1 x wall plug, 1 x roller shutter and 1 remote control (Key Fob 2). This will be increased in the next weeks. Anyway I started to create my own UI and surprisingly it works as well! Now to my question:

I have seen that the remote can differ between a simple click and a double click:

Code: Select all

[2015-02-15 13:27:48.741] [D] [zway] RECEIVED: ( 01 09 00 04 00 04 03 20 01 FF 2B )
[2015-02-15 13:27:48.742] [D] [zway] SENT ACK
[2015-02-15 13:27:48.743] [D] [zway] SETDATA devices.4.data.lastReceived = 0 (0x00000000)
[2015-02-15 13:27:48.744] [D] [zway] SETDATA devices.1.instances.0.commandClasses.32.data.srcNodeId = 4 (0x00000004)
[2015-02-15 13:27:48.745] [D] [zway] SETDATA devices.1.instances.0.commandClasses.32.data.srcInstanceId = 0 (0x00000000)
[2015-02-15 13:27:48.747] [D] [zway] SETDATA devices.1.instances.0.commandClasses.32.data.level = 255 (0x000000ff)

[2015-02-15 13:27:52.753] [D] [zway] RECEIVED: ( 01 09 00 04 00 04 03 20 01 00 D4 )
[2015-02-15 13:27:52.754] [D] [zway] SENT ACK
[2015-02-15 13:27:52.755] [D] [zway] SETDATA devices.4.data.lastReceived = 0 (0x00000000)
[2015-02-15 13:27:52.756] [D] [zway] SETDATA devices.1.instances.0.commandClasses.32.data.srcNodeId = 4 (0x00000004)
[2015-02-15 13:27:52.758] [D] [zway] SETDATA devices.1.instances.0.commandClasses.32.data.srcInstanceId = 0 (0x00000000)
[2015-02-15 13:27:52.759] [D] [zway] SETDATA devices.1.instances.0.commandClasses.32.data.level = 0 (0x00000000)
Is there any chance to execute also two different scripts? What I have in mind is something like this:
Single Click on Key 1: Drive all roller shutters to position xy (they will be different of course) --> daily mode
Double Click on Key1: Drive all roller shutters complete down --> vacation mode
Click on Key 3: Open all roller shutters

Click on Key 2: Turn on TV, AV-Receiver, (by sending a specific HTTP requests --> I'm working on it on my own UI but this is client-java so it would not help me at all, right?)
...

Anyway, could someone help me and explain how I can add this to my network? Which files do I need? What to change? I don't know even the term that I have to search for? Execute Server-side JavaScript???

Thanx in advance
Prometheus
Posts: 20
Joined: 27 Oct 2014 22:55

Re: Actions on Z-Wave-Command Events

Post by Prometheus »

Is there really no way to create/implement (or what ever) a "Z-Wave-Command-Event-Handler" on the server? Is this request too simple or too difficult? No one has ever thought about it!? This would mean the ultimate flexibilty, depending on the reliability of the Z-Way server of course :-)
I'm willing to try it but I have no clue where to start (which files to change, to add, to program...). I couldn't find any examples
skiv71
Posts: 124
Joined: 01 May 2014 13:46
Location: United Kingdom
Contact:

Re: Action on Remote Control Events

Post by skiv71 »

Hi Prometheus,

Can you explain your needs and the function of event handler?

I use the z-way server in conjunction with bmslink and it has a native event detector/handler system.

Neil
Prometheus
Posts: 20
Joined: 27 Oct 2014 22:55

Re: Action on Remote Control Events

Post by Prometheus »

Such an Event-Handler would give a much more flexibility then the “built-in” associations can provide. Just think of:

Sensor Data
If a sensor is sending cyclically new data to the server then within such an event handler you can perform individual commands (such as: send Z-Wave commands (to turn something on or off), create your own statistic (including a chart), etc.

Remote Controls
If any click (single or double) is done on the remote than you can perform individual commands (in my case I would like to: turn off 2 wall plugs, turn on the TV, turn on BluRay placer --> you get the idea)
My_Z-World.png
My_Z-World.png (24.69 KiB) Viewed 6749 times

I wondering if there is any place within the Z-Way server I can place a code like this:

Code: Select all

switch (<incomming Z-Wave message>)
{
   case <sensor data from node x>:
      mySensorFunction();
      break;

   case <single click on remote control button 1>:
      myRemoteFunction();
      break;

   case...
}
Something like this would be really cool ;)
skiv71
Posts: 124
Joined: 01 May 2014 13:46
Location: United Kingdom
Contact:

Re: Action on Remote Control Events

Post by skiv71 »

Regarding automation and associations, I agree entirely.

All my automation is via incoming and control messages to the z-way server.

Since I also support other interfaces (like rfxcom and wifi link), this allow's my system to provide a bridge between tech's, regardless of their nature.

The only time I've used association was to link i/p#2 of a fibaro dimmer directly to another fibaro relay o/p.

By the sounds of things, my system already does all that you need and you can provide automation by either time triggers, function blocks (inputs/logic to derive an output) or simple event detectors, used on their own to create an event handler, or by combining event detectors to create a compound event detector (and handler).
Prometheus
Posts: 20
Joined: 27 Oct 2014 22:55

Re: Action on Remote Control Events

Post by Prometheus »

I'm impressed! When I grow up then I would like to have exactly something like this...
May I ask you something different:
Your network seems to be quite comprehensive (> 20 Z-Wave nodes???), did you ever experienced problems that some users are describing here? They complaining about:
- Sensors not responding
- Failed device
- Not delivered to recipient
I just started with the Z-Wave technology and I like the idea not to stick to one specific manufacturer. So I'm planning to increase my network in the future.

Back to the topic: As a father of four I will check out your system as soon as I can, but I assume that you managed to access the Z-Way server with your own "BMS Link"-software!?
skiv71
Posts: 124
Joined: 01 May 2014 13:46
Location: United Kingdom
Contact:

Re: Action on Remote Control Events

Post by skiv71 »

Hello again,

No I don't have any of those problems and I currently have around 30 nodes.

I have written my own code (as I do with all my interfaces) that seamlessly integrate the z-way server into my system.

In actual fact, the system runs the z-way server itself, sort's out config settings and can accomodate multiple controller/server instances and present all detected nodes with their devices to the system automatically.

I have a system in place where all nodes are automatically polled (but only when necessary) according to a class white list.

Because of this, even with all my nodes, I rarely see a queue length in excess of 15, most of the time in the low 10's.

I can detect node introducion and removal automatically and request NIF and request interview information automatically.

I've tried to make the system as streamlined and simple as possible, so the user can get down the real deal of automation :)

I still use the z-way server as is and I have to say its excellent, very comprehensive. Well in line with more commercial software's I've worked with over the years.

As with all the other interfaces, my job is to extract as much, pertinent data from the z-way-server automatically and provide a means of a simple, unified means of controlling the devices included in the controllers network.

For example, I have a mixture of LWRF lamps and fibaro dimmers for lights but from the user interface perspective, they all look (and operated in the same manner).
Post Reply