I’m not clear how ZWave scenes work in OpenHAB 2. Are they supported? It seems that in version 1 it was done via rules. Is that still the case?
With the latest build I’m unclear what I should do with ZWave devices which have channels to either respond to a scene or can send a scene command. The scene channels are defined as numbers, but how does one get either device to respond to or generate a specific scene command?
Specifically I have a Leviton appliance switch which will respond to a scene command, and the Homeseer HS-WD100+ which can send a ZWave scene with a double tap (which appears to be supported).
Happy to add this information to the documentation efforts.
Currently you can trigger a rule from a scene controller in the same way as was done in OH1. There is a scene_number channel that will be updated whenever the scene is triggered from the scene controller, and you can use this to run a scene.
Programming ZWave scenes on devices isn’t supported on OH1 or OH2, and likewise, triggering a scene on a device wasn’t supported on OH1 either (or OH2 at the moment but we can always change that).
central_scene is supported in the same way as scene_activation. I note that the WD100+ doesn’t have a channel defined in the database for scene_activation at the moment - only central_scene, so I guess it can send either?
So with central_scene, I should be able to write a rule triggered on that channel?
I created the following rule, but it never gets run even when I see in the logs that the biding is receiving a a central_scene command.
I wonder if the device database is incorrect and the scene number channel isn’t wired to the central_scene command? I wasn’t sure how to tell this from the database.
rule "Check Lights"
Item zwave_device_7beacf31_node13_scene_number2 changed or
Item zwave_device_7beacf31_node13_scene_number2 received update or
Item zwave_device_7beacf31_node13_scene_number2 received command or
logInfo("garagelights","##### zwave_device_7beacf31_node13_scene_number2 changed")
When I said earlier “I note that the WD100+ doesn’t have a channel defined in the database for scene_activation at the moment - only central_scene” - I got that around the wrong way. It only has scene_activation - not central_scene.
@chris, thanks for updating the database – it now works. A rule can now pick up the scene command.
I have two related follow-up questions related to some trickery of this new switch.
Can a rule (or other method) tell the ZWave binding to requery the state of a device? To get around the instant status patent (I presume), this switch sends a central_scene command when the switch is changed locally. To get OpenHAB to see this I created a rule to do a posUpdate, but it’s not perfect (and I don’t believe will handle dimming).
Is it possible to get the time value of the central_scene command (as displayed in the scene_set case statement in handleApplicationCommandRequest)? This switch allows for a double tap which sends only a central_scene command and doesn’t turn the local load on. Unfortunately it sends the same scene number as a single tap, but with a different time value (why couldn’t they just send a different scene number?!?).
Yes - you need to send a command with RefreshType.REFRESH as the value.
See the discussion here -:
No - I’m not sure how to pass this data to an item since an item can only contain a single value. I’m open to any ideas, but maybe we need to define a new data type at some stage that can better handle scenes (ie not just the time field).
Thanks for pointing me to that threat, the refresh command did the trick.
Since there seems to be a few devices that need a refresh as a result of an update – would it make sense to add this to the binding? Either through a device database flag per channel or a config setting in the UI (maybe using a tag)?
Regarding the central_scene, what about adding another channel that provides the scene number and time concatenated e.g (01003) – something like central_scene_raw? I think alarm type channels could benefit from this as well. I’m assuming this is simpler than trying to add new properties to items in the system?
For what its worth, I did implement the CENTRAL_SCENE command in openhab V1 to accommodate the HomeSeer switches. I’m using both the HS-WD100+ dimmers and HS-WS100+ switches in my home. It does have the means to create items that include both the “scene” number and “key” identifier. Both of these are needed to interpret the HomeSeer double-tap and triple-tap events.
Take a look at my pull request comments you can see an example of the item definitions for all the HomeSeer switch events.
The latest OH2 snapshot now sends the timing information with the scene channel. So for example, when pressing On at the switch the scene command will receive “1.0”. A couple tap on will receive “1.3” if memory serves me correctly.
You can then use a rule on the scene channel to sort out how you’d like to handle the various scene commands from the switch.
For example, the following rule turns on my secondary lights if the light switch it turned on, or the on switch is double tapped. It turns them off then the main light switch is turned off, or the of switch is double tapped.