Cooper RFWC5 - indicators and scene control in OH2 not working

hey there,

I had some questions in a previous thread getting the Cooper RFWC5 to work, Migrating to OH2 seems to have fixed the communication issue - I can now poll scene_number as shown in the snippet below and get a 1-5 value.

Number DR_Scene "DR_Scene"	{channel="zwave:device:32d6f75b:node16:scene_number"}

This is clumsy as it does not reflect how the device operates - you can press any button on the keypad, turning the corresponding indicator ON or OFF - using scene_number treats it as it were a ratio button where only one option can be chosen at a time.

I’m also looking for a method to access the indicator state for each button, this worked in OH1 with the binding as shown below but I’ve not found a syntax in OH2 that gives the same functionality.

Switch DR_Scene1i "Scene 1 LED" {zwave="16:command=INDICATOR,bit=0"}

Any ideas on this? it seems to be a popular device…

@chris had added the scenes a while back but I had the same issue as you that the device wouldn’t keep the button light on. I’m still using my Vera in the middle so would definitely be interested in helping troubleshoot as well. I started looking into using a 3rd party Zwave configuration software to do the associations outside of OH to see if that would work with the button on/off’s but never got a chance to play with it (and can’t find where I bookmarked the software)

What do you suggest. Currently, the binding is providing the data that the device provides - this includes the key state (pressed once, twice, held down, released etc). I don’t know what else you’re asking for - I’m also not sure why you are polling a scene controller as that would be very slow I expect - if you poll, how do you know if it is a single press etc? :confused:. Please can you offer a suggestion as to what you think should be implemented.

What I am looking for is a way to see individual on/off key state. Right now the only data I can get from the device is the value of the current scene selected.

I press the first button and scene_number changes to “1”, the indicator comes on
I press the second button and scene_number changes to “2”, the indicator comes on

now, looking at the device in the wall, I have two indicators lit, suggesting there are two scenes active when this is not the case - the value of scene_number is “2”.

etc…

If there are more options than scene_number I can pull from please point me in the right direction to find them. End of the day the ability to address individual buttons (and indicators!) to see their state is what I’m after.

What version of the binding are you using? I thought that in OH1 provided the key state (As above, 1 press, 2 press, release etc) in the low value, and the key in the higher value (ie multiplied by 10). Certainly I know this is the case in OH2 - the value is <scene>.<key state>. I’m not sure there’s much more that we can provide.

As per my question above - if you are using polling then it’s possible that this information is not provided by the device - I doubt that scene classes work properly with polling and you should use associations.

As per the PaperUI addons screen: “Z-Wave Binding - binding-zwave - 2.0.0”

From the <scene>.<key state> notation you mentioned - I should be able to read button state like this?

.items

Switch DR_Scene1 "Button 1" {channel="zwave:device:32d6f75b:node16"}

hastily written .rule

rule "scene1"
	when
		Item DR_Scene1 received update 
			if DR_Scene1.1.10   {    //scene 1, button ON
				turn on some stuff!
			}	
			if DR_Scene1.1.00   {	//scene 1, button OFF
				turn off some stuff!
			}
end

The reason for polling vs association is I need to use the button state in OH to drive rules that control things outside the Zwave network - in my case a combo of other zwave modules, DMX LED strips via OLA, and relays via GPIO. I know I can associate other zwave modules to the buttons and build simple zwave scenes that way, it does not work for my application.

That’s how I understand scene associations to work, if I’m off base please let me know!


Thank you for the assistance with this and for all the work you’ve put into this product. :slight_smile:

You should get scene.key, where key is -:
0 = single press
1 = key released
2 = key held down
3 = single press twice
4 = single press three time
5 = single press four times
6 = single press five times

So, if you have scene 15 activated by pressing the button twice, you should have a value of 15.3.

My point about polling is that if you are using polling, I don’t think any of this makes any sense - the key is an event - ie you pressed the button twice. It’s not a state - ie the button isn’t currently pressed twice. I’ve never tried polling a scene to find out what it does, but if you don’t see these key events, then I would guess it’s not reported as I’m pretty sue that this works (I was testing it with an Aeon device a few days ago). The log also prints which button is pressed so I’d double check the log to see what this shows.

OK, i’ll try that when I get home.

If there was a way to make a scene with all the devices I needed to control in it (scene 15: turn lamp on, LED strip 1 50%, relay 1 on) and then assign the button to trigger scene 15 when pressed that would work, is there any documentation available to make OH do such a thing?

OH doesn’t really have the concept of scenes as such - you’d need to use a rule to program up the different actions you require. You can do this in the way you tried above - when you receive the update of the scene item, do some stuff…

Your scene controller should send a scene command to OH (using associations!) - this should trigger a rule ‘instantly’ and this rule should do what you want the scene to control.

That’s fine, I’d prefer to make them up in rules as mentioned. Wasn’t sure if you were hinting at some functionality I overlooked!

Currently I have all the buttons associated with the OpenHAB controller in HABmin (below):

this is how I got the thing to work in the first place and start returning scene_number.

I’ll try your suggestion above but that still leaves the issue of addressing the LED’s on the controller. I need to do exactly what this post describes as far as syncing the LED’s across multiple controllers. If the functionality is still in the OH2 binding im not sure the syntax to access it.

I followed the notation shown and think we’re making progress!

.items

Number DR_Scene "DR_Scene"	{channel="zwave:device:32d6f75b:node16:scene_number"}

.rules

rule "scene1"
	when
		Item DR_Scene received update 
			then
				if (DR_Scene.state == 1.0) {
					logInfo("Demo", "Pressed")
				}
				if (DR_Scene.state == 1.1) {
					logInfo("Demo", "released")
				}
				if (DR_Scene.state == 1.2) {
					logInfo("Demo", "held")
				}
				if (DR_Scene.state == 1.3) {
					logInfo("Demo", "singlepress2x")
				}
				if (DR_Scene.state == 1.4) {
					logInfo("Demo", "singlepress3x")
				}
				if (DR_Scene.state == 1.5) {
					logInfo("Demo", "singlepress4x")
				}
				if (DR_Scene.state == 1.6) {
					logInfo("Demo", "singlepress5x")
				}
end

i’m seeing some activity in the logs now!

22:53:14.469 [INFO ] [.eclipse.smarthome.model.script.Demo] - Pressed
22:53:14.475 [INFO ] [.eclipse.smarthome.model.script.Demo] - Pressed
22:56:34.949 [WARN ] [ss.ZWaveMultiLevelSwitchCommandClass] - Unsupported Command 4 for command class SWITCH_MULTILEVEL (0x26).
22:56:34.963 [WARN ] [ss.ZWaveMultiLevelSwitchCommandClass] - Unsupported Command 4 for command class SWITCH_MULTILEVEL (0x26).
22:56:36.039 [WARN ] [ss.ZWaveMultiLevelSwitchCommandClass] - Unsupported Command 5 for command class SWITCH_MULTILEVEL (0x26).
22:56:36.053 [WARN ] [ss.ZWaveMultiLevelSwitchCommandClass] - Unsupported Command 5 for command class SWITCH_MULTILEVEL (0x26).

The button presses don’t match up with the numbers you posted but whatever - I can work with that, the odd thing is the ‘unsupported’ messages and that everything shows up double.

@phinnay it seems like you were successful in getting one of these scene controllers working. I have the same one and was not yet successful. I read this thread and was wondering whether you could describe the complete process in more detail.
I have the device included on the z-wave network. However button pushes do not update the scene number. You describe having the buttons associated with the controller. How did you create this association? Using habmin or some other software? I tried using habmin but am not sure whether the device accepted the configuration. If I delete and recreate the thing in openhab (not from the z-wave controller) the configuration is reset.
Thanks for your help.
Peter

hey, sorry did not see the reply we have been away on business.

I set the association in HABmin, also setting the flags as I’ve seen necessary for other scene controllers as mentioned here. not 100% that it helped as things just started working in OH2 but def give that a shot, it’s a little frustrating OH doesn’t have better documentation on working with scene controllers…

Def post back with updates, these are really nice devices and getting them to work properly in OH would be fantastic, especially since they seem to work great with other controllers.

@chris any idea why I’m getting doubles with every key press? not sure where to begin debugging such a thing.

I’m not sure what “doubles means” - if it means that the packets are received twice then the main reason for this happening systematically is if you add multiple association groups. Eg devices might have a “lifeline” or “controller” group that all messages are sent to. Then they might have a “button 1” and “button 2” group. If you add the controller into both groups, then you will get multiple messages.

doubles as in, if you look at the screenshot I provided, you see two of every message:

22:53:14.469 [INFO ] [.eclipse.smarthome.model.script.Demo] - Pressed
22:53:14.475 [INFO ] [.eclipse.smarthome.model.script.Demo] - Pressed
22:56:34.949 [WARN ] [ss.ZWaveMultiLevelSwitchCommandClass] - Unsupported Command 4 for command class SWITCH_MULTILEVEL (0x26).
22:56:34.963 [WARN ] [ss.ZWaveMultiLevelSwitchCommandClass] - Unsupported Command 4 for command class SWITCH_MULTILEVEL (0x26).
22:56:36.039 [WARN ] [ss.ZWaveMultiLevelSwitchCommandClass] - Unsupported Command 5 for command class SWITCH_MULTILEVEL (0x26).
22:56:36.053 [WARN ] [ss.ZWaveMultiLevelSwitchCommandClass] - Unsupported Command 5 for command class SWITCH_MULTILEVEL (0x26).

In reality I am taking my finger and pressing the button for 1sec and then releasing it. OpenHAB shows two of everything when I do this.

Where would I go to see if the device has “lifeline” or “controller” groups? I do not see those terms anywhere in HABmin and a search of the documentation I have for OH2 does not return anything.

Typically have a read of the manual. See if it says something like “this group is reserved for use with the controller” - or anything along those lines.

It’s not an OH2 issue - it’s related to the device itself and how it sends messages to other devices (including to the controller).

Building on the link that @phinnay provided, I got the RFWC5 working. However, updates are only received when a scene is switched ON, not when it is switched OFF. From the zensys tool, it needed COMMAND_CLASS_ASSOCIATION_V1 executed even though it seems to support COMMAND_CLASS_ASSOCIATION_V2.

@chris Thats so much for your work on OpenHAB and the z-wave binding. OpenHAB is awesome and, in contrast to a supposedly smart commercial system, it actually works. Below is more information on how the RFWC5 scene controller behaves and, at the bottom, a suggestion to support three channels for this device. I would be happy to help implement better support of the device, but would highly appreciate pointers and comments.

@phinnay Thanks for your reply and thanks for pointing out that thread on google groups. That indeed worked.

  1. I have an Enerwave ZWN-SC7 that did not work before, but after applying precisely the commands given in that thread. A Scene Number changed is triggered in openhab2 (once) whenever a button is pressed.
    Zensys tool sees the following when the 1st through 7th button is pressed once:
08:54:44.223: Received: COMMAND_CLASS_SCENE_ACTIVATION.SCENE_ACTIVATION_SET, hex data: 2B 01 01 FF 
08:54:44.236: Received: COMMAND_CLASS_SCENE_ACTIVATION.SCENE_ACTIVATION_SET, hex data: 2B 01 01 FF 
08:54:49.074: Received: COMMAND_CLASS_SCENE_ACTIVATION.SCENE_ACTIVATION_SET, hex data: 2B 01 02 FF 
08:54:49.088: Received: COMMAND_CLASS_SCENE_ACTIVATION.SCENE_ACTIVATION_SET, hex data: 2B 01 02 FF 
08:54:51.054: Received: COMMAND_CLASS_SCENE_ACTIVATION.SCENE_ACTIVATION_SET, hex data: 2B 01 03 FF 
08:54:51.067: Received: COMMAND_CLASS_SCENE_ACTIVATION.SCENE_ACTIVATION_SET, hex data: 2B 01 03 FF 
08:54:53.514: Received: COMMAND_CLASS_SCENE_ACTIVATION.SCENE_ACTIVATION_SET, hex data: 2B 01 04 FF 
08:54:53.527: Received: COMMAND_CLASS_SCENE_ACTIVATION.SCENE_ACTIVATION_SET, hex data: 2B 01 04 FF 
08:54:54.254: Received: COMMAND_CLASS_SCENE_ACTIVATION.SCENE_ACTIVATION_SET, hex data: 2B 01 05 FF 
08:54:54.267: Received: COMMAND_CLASS_SCENE_ACTIVATION.SCENE_ACTIVATION_SET, hex data: 2B 01 05 FF 
08:54:55.124: Received: COMMAND_CLASS_SCENE_ACTIVATION.SCENE_ACTIVATION_SET, hex data: 2B 01 06 FF 
08:54:55.137: Received: COMMAND_CLASS_SCENE_ACTIVATION.SCENE_ACTIVATION_SET, hex data: 2B 01 06 FF 
08:54:56.006: Received: COMMAND_CLASS_SCENE_ACTIVATION.SCENE_ACTIVATION_SET, hex data: 2B 01 07 FF 
08:54:56.018: Received: COMMAND_CLASS_SCENE_ACTIVATION.SCENE_ACTIVATION_SET, hex data: 2B 01 07 FF 
  1. The RFWC5 needed a slightly different command than described in that thread.

manually configure the association groups for the controller using the zensys-tools. Manually sending the following z-wave commands from the “command class” tab:

COMMAND_CLASS_ASSOCIATION_V1/ASSOCIATION_SET, Group ID = 1, Node ID = [your controller ID]
COMMAND_CLASS_ASSOCIATION_V1/ASSOCIATION_SET, Group ID = 2, Node ID = [your controller ID]
COMMAND_CLASS_ASSOCIATION_V1/ASSOCIATION_SET, Group ID = 3, Node ID = [your controller ID]
COMMAND_CLASS_ASSOCIATION_V1/ASSOCIATION_SET, Group ID = 4, Node ID = [your controller ID]
COMMAND_CLASS_ASSOCIATION_V1/ASSOCIATION_SET, Group ID = 5, Node ID = [your controller ID]

Now, manually set the scene controller configuration so it sends the scene activation commands to your controller. Again, from the “command class” tab:

COMMAND_CLASS_SCENE_CONTROLLER_CONF_V1/SCENE_CONTROLLER_CONF_SET, Group ID = 1, Scene ID = 1, Dimming duration = 0
COMMAND_CLASS_SCENE_CONTROLLER_CONF_V1/SCENE_CONTROLLER_CONF_SET, Group ID = 2, Scene ID = 2, Dimming duration = 0
COMMAND_CLASS_SCENE_CONTROLLER_CONF_V1/SCENE_CONTROLLER_CONF_SET, Group ID = 3, Scene ID = 3, Dimming duration = 0
COMMAND_CLASS_SCENE_CONTROLLER_CONF_V1/SCENE_CONTROLLER_CONF_SET, Group ID = 4, Scene ID = 4, Dimming duration = 0
COMMAND_CLASS_SCENE_CONTROLLER_CONF_V1/SCENE_CONTROLLER_CONF_SET, Group ID = 5, Scene ID = 5, Dimming duration = 0

Now pressing the first button to switch the scene on and again to switch it off, then them same for buttons 2-5 results in the following data being received by the zensys-tool:

08:44:43.770: Received: COMMAND_CLASS_SCENE_ACTIVATION.SCENE_ACTIVATION_SET, hex data: 2B 01 01 00 
08:44:43.786: Received: COMMAND_CLASS_SCENE_ACTIVATION.SCENE_ACTIVATION_SET, hex data: 2B 01 01 00 
08:44:46.483: Received: COMMAND_CLASS_BASIC.BASIC_SET, hex data: 20 01 00 
08:44:46.498: Received: COMMAND_CLASS_BASIC.BASIC_SET, hex data: 20 01 00 00 
08:44:47.086: Received: COMMAND_CLASS_SCENE_ACTIVATION.SCENE_ACTIVATION_SET, hex data: 2B 01 02 00 
08:44:47.101: Received: COMMAND_CLASS_SCENE_ACTIVATION.SCENE_ACTIVATION_SET, hex data: 2B 01 02 00 
08:44:47.739: Received: COMMAND_CLASS_BASIC.BASIC_SET, hex data: 20 01 00 
08:44:47.754: Received: COMMAND_CLASS_BASIC.BASIC_SET, hex data: 20 01 00 00 
08:44:48.342: Received: COMMAND_CLASS_SCENE_ACTIVATION.SCENE_ACTIVATION_SET, hex data: 2B 01 03 00 
08:44:48.357: Received: COMMAND_CLASS_SCENE_ACTIVATION.SCENE_ACTIVATION_SET, hex data: 2B 01 03 00 
08:44:48.996: Received: COMMAND_CLASS_BASIC.BASIC_SET, hex data: 20 01 00 
08:44:49.011: Received: COMMAND_CLASS_BASIC.BASIC_SET, hex data: 20 01 00 00 
08:44:49.548: Received: COMMAND_CLASS_SCENE_ACTIVATION.SCENE_ACTIVATION_SET, hex data: 2B 01 04 00 
08:44:49.563: Received: COMMAND_CLASS_SCENE_ACTIVATION.SCENE_ACTIVATION_SET, hex data: 2B 01 04 00 
08:44:50.452: Received: COMMAND_CLASS_BASIC.BASIC_SET, hex data: 20 01 00 
08:44:50.467: Received: COMMAND_CLASS_BASIC.BASIC_SET, hex data: 20 01 00 00 
08:44:52.311: Received: COMMAND_CLASS_SCENE_ACTIVATION.SCENE_ACTIVATION_SET, hex data: 2B 01 05 00 
08:44:52.325: Received: COMMAND_CLASS_SCENE_ACTIVATION.SCENE_ACTIVATION_SET, hex data: 2B 01 05 00 
08:44:53.266: Received: COMMAND_CLASS_BASIC.BASIC_SET, hex data: 20 01 00 
08:44:53.280: Received: COMMAND_CLASS_BASIC.BASIC_SET, hex data: 20 01 00 00 

That is, while switching on clearly transmits the scene number, the code from switching off a scene seems always to be the same. Openhab2 will forward the switching on of a scene to rules twice, as reported by @phinnay, the switching off is not forwarded.
The right button will send the same “off” code when pressed for a few seconds.

In addition this device supports an indicator and from the zensys tool one can execute

COMMAND_CLASS_INDICATOR_V1/INDICATOR_GET

will result in

08:50:14.036: Received: COMMAND_CLASS_INDICATOR.INDICATOR_REPORT, hex data: 87 03 15 

If scenes 1, 3, and 5 are enabled. The last number is just the bitmask of leds hat are lit, when executed for other states.
Similar, one can send (again tested from zensys tools)

COMMAND_CLASS_INDICATOR_V1/INDICATOR_SET with Value v

where v is the binary bitmask of the scenes to for which the led should be lit.
From this I would assume the device could have three channels: A SceneNumber channel that is updated whenever the device updates the scene number, a SceneIndicatorNumber channel that is polled whenever the controller received the switch off code, and a SceneIndicatorNumber output channel that can be written to and sets the leds (and with them the state of the scenes as maintained by the device).

I would be happy to help improve the support for this device. While I have quite a bit of programming experience, I would highly appreciate pointers on where to look and what to do.

Thanks for digging in to this. This is one of the last devices I need to migrate over from my Vera but I don’t have strong enough programming background to dig in… If you go here - http://www.cd-jackson.com/index.php @chris has instructions on how you can help edit the ZWave database (you have to request access from him), so you can help update the binding configuration settings.

@chris, after I have dug around a bit and thought some more about it, I don’t like my previous suggestion any more. For the user, the scene controller behavior might be clearest, if it would simply update the Scene Number whenever a button is pressed. The Scene Number would be the bitmask of the buttons that are enabled (0-31). The problem is that the device does not send the necessary information. It does, however, send a command when a button is pressed. This is the SCENE_ACTIVATION_SET if the button is being enabled and the BASIC_SET when the button is disabled. This means, after being triggered by receiving a BASIC_SET command or a SCENE_ACTIVATION_SET command one would have to issue a INDICATOR_GET and use the returned value as the scene number. In addition one should also be able to set the Scene Number. To set it, the INDICATOR_SET command has to be issued. This is not as bad as a poll because there is a trigger event. Only after having received one of these would the state have to be requested.
Would you be able to advise of ways to achieve this? Is there a way to hook in a custom zwave command class for this device? Are there better ways of achieving these command executions? These questions just go too deep into the architecture and structure of the binding to be answered by a novice. Thus, any help from the experts would be greatly appreciated.

Awesome work with the investigation, it’s great to have someone as knowledgeable as you helping out with this! I’m gonna double check my settings and confirm they match yours - hoping I just have something backwards and that’s causing the doubles.

I’m not clear in your proposed solution if you have the ability to set the indicator lamp state separate from the scene buttons - this was possible to do in the OH1 binding and I’d love to have this ability to be able to sync the display on multiple RFWC5’s. Not had much time to work on this but I’ve not found a way to address them in OH2. There is a benefit to having the ability to read individual button on / off state for use with sync and also to make controlling non-scene things via .rules a lot easier.

Hopefully @chris will get back to us, I’d like to write up a step by step guide once we’ve got things worked out to help others up against configuring these things.