How to use z-wave command send to association group by rule

I’m new in OH2.

As I know, some zwave devices can send commands to associated devices. Is there a way to catch these commands by the zwave controller and use them in a rule?

something like:

rule "OnAccociatedCommandreceived"
when
Item ZwaveController received AccociatedCommand
then
something

How to link zwave controller to an accociated group to receive these commands or is the controller automatically part of one of these groups?

can someone provide me item and rule example?

thanks a lot.

There aren’t any ‘special’ commands sent for associations - associations are just a way to tell the device to send an update.

Therefore, these commands are simply status updates of an existing item. So if the device is a switch, then it will send an ON/OFF status to the item, and this will be received by OH, the item state will be updated, and you can use this in a rule.

Ah,ok,

I ask this, because my z-rain sensor does not work as expected.

Available channels:
sensor_rainrate (how much rain at the moment)
sensor_general (sum of rain overall)
meter_water_cubic_meters (sum of rain in cubic)
battery-level

Documentation:
This device measures the rain level on a certain position. The internal mechanics and electronics counts the rain level and will report it every about 4 minutes if and only if there is rain. The device also monitors a heavy rain condition (10 l/sqm within 5 minutes) and will send out alarm messages when detected.

But this will not happen. Only once a day the channels are updated.

In the documentation is written:
Parameter 2: Rain Start Command
This BASIC Set Command value is sent out into Association Group 2 when the device detects start of rain
Parameter 3: Rain Stop Command
This BASIC Set Command value is sent out into Association Group 2 when the device detects stop of rain
Parameter 6: Heavy Rain Start Command
This BASIC Set Command value is sent out into Association Group 3 when the device detects start of heavy rain
Parameter 7: Heavy Rain Stop Command
This BASIC Set Command value is sent out into Association Group 3 when the device detects stop of heavy rain

But how to catch these informations? No channel is available which can handle this informations.

Then we would need to add a channel. It sounds like there should be a channel associated with the BASIC class to be added.

Are you sure that this is really needed though? What is group 1? Is this the lifeline? If so, is it not reporting something through the lifeline? Normally, BASIC command class is only used for controlling other devices…

From the documentation. Group 1 is lifeline, Group 2 is something else

This means for me, that I need to catch this information from somewhere?
Or can I accociate group 2 of z-rain device to openhab controller too, which indirectly added this to lifeline and I can catch the information?

I can try this, can you add a channel for this? Or do you need a debug log?

Normally, in this case, I would expect that the device sends something useful to the lifeline group, and the other groups are really just there in case you wanted to (for example) close the shutters or turn off a switch or something - ie direct control of another device.

Looking at the manual, it looks like the device sends either meter, or sensor_multilevel to report rain rate - you should be able to use this in an item and rule to detect rain in the same way as the device is with the BASIC command class. BASIC is really for interdevice commanding.

So, I think that you should be able to use the existing messages that the device sends?

normally yes,

but the device sends this messages only once a day (even if there is heavy rain or not). But this does not make sence because if I know one day later that there was rain it is not what I expect from a rain meter :wink:

This is why I search how to use it in a proper way. I think this can only reached by catching “Rain Start Command/stop” or “Heavy Rain Start Command/stop”

Ok - that’s a bit rubbish ;). I would suggest that you ask the manufacturer to add a feature to set the reporting period - I note that the firmware can be updated…

We can however add the channel in the database to report this - I’ll take a look as I’ll need to work out what channel type to use.

hi chris,

rain sensor is working with the newest snapshot. Looks like I have to send some config datas to the sensor to get this to work. This was missing in the old version of the binding

But I thought about the original topic a little bit.

I got a multi sensor now: Philio PST02-1A. This one will only work if set to “sensor binary report”. It will not work in “report notification” mode. This will bring me back to the initial question. As I understood z-wave devices can send messages to other devices without the need of a controller.

Example:
if a “Rain Start Command” occurs, a message can send to associated group 2. (This BASIC Set Command value is sent out into Association Group 2 when the device detects start of rain). This will cause something on all devices in this group. But the controller does not get this informations because no item can be bound to this notification.

Does is make sence to implement channels at the controller which can be used to catch this messages by just adding the controller to the associated group config of the device.

Device config:

Controller channel config:
String AssociatedGroup1_Message “[%s]” {channel=“zwave:device:15a7a49f3a6:node1:associated_group1”}
String AssociatedGroup2_Message “[%s]” {channel=“zwave:device:15a7a49f3a6:node1:associated_group2”}

and in a rule:
rule “OnAccociatedCommandreceived”
when
Item AssociatedGroup1_Message received update
then
something
end

Hopefully you understand what I mean :wink:

Sorry - not really.

Yes - to implement this, you need to set the destination device into the association group of the source device. There is no channel required on the controller.

As we discussed previously, this should be the case normally. There are no special messages that get sent - the messages are standard messages sent to standard channels.

I still need to create the BASIC channel for this device as it strangely only uses the BASIC class - but that is special to this device.

I really don’t understand this - the association_group1 makes no sense - it’s not a channel and can not be configured as a channel. It’s a device configuration setting only…

Ah, I understand. This all can be handled by an new BASIC channel. great.

If you need a tester after implemented this one, please post to me.