Rules for GE/Jasco Z-Wave Plus In-Wall Smart Motion Sensor Switch

Hardware

  • Raspberry Pi 3 Model B version 1.2 (ARMv8, with 1GB RAM, and 250 GB SSD)
  • ZMEUUZB - ZWave.Me USB Z-Wave dongle
  • 2 (Two) GE/Jasco Z-Wave Plus In-Wall Smart Motion Sensor Switch (26931/ZW4006)
  • OS: Raspbian 9 (Stretch)
  • Java Runtime Environment: java version “1.8.0_191”, Java™ SE Runtime Environment (build 1.8.0_191-b12), Java HotSpot™ Client VM (build 25.191-b12, mixed mode)
  • openHAB version: 2.4.0-1 with openhab2-addons 2.4.0-1

Hello Community,

I’m struggling with rules for my two GE/Jasco Z-Wave Plus in-wall smart motion sensor switches (26931/ZW4006). What I’m trying to accomplish with openHAB rules is replicate a 3-way switch setup wherein either switch can can control a light. I have one switch connected to and directly controlling the light. This first switch works fine. I can control the light via motion and the physical buttons. I want the second switch to be able to control the light both via the physical buttons and the motion sensor. This second switch isn’t working the way I want it to work. Does anyone have any suggestions on what may be going on and how to fix it?

Switch Items Defined in Habmin

zwave_laundry_room_a_switch_binary  // Second switch-- Not connected to a load
zwave_laundry_room_b_switch_binary  // First switch-- Directly connected to load

Rule Scenario 1

rule "Laundry Room Light A"
   when
        Item zwave_laundry_room_b_switch_binary received command
   then
        sendCommand(zwave_laundry_room_a_switch_binary, receivedCommand)
end


rule "Laundry Room Light B"
   when
        Item zwave_laundry_room_a_switch_binary received command
   then
        sendCommand(zwave_laundry_room_b_switch_binary, receivedCommand)
end

When I trip the motion sensor on zwave_laundry_room_b_switch_binary, event.log only reports zwave_laundry_room_b_switch_binary turning on. After 5 minutes, the switch turns off as expected. However, zwave_laundry_room_a_switch_binary never trips.

2018-12-18 17:34:31.253 [vent.ItemStateChangedEvent] - zwave_laundry_room_b_switch_binary changed from OFF to ON
2018-12-18 17:39:31.209 [vent.ItemStateChangedEvent] - zwave_laundry_room_b_switch_binary changed from ON to OFF

Rule Scenario 2 (Rule Scenario 1 rules commented out)

rule "Laundry Room Light B Test"
when
    Item zwave_laundry_room_b_switch_binary changed
then
    if (zwave_laundry_room_b_switch_binary.state == ON) {
        zwave_laundry_room_a_switch_binary.sendCommand(ON)
    }
    if (zwave_laundry_room_b_switch_binary.state == OFF) {
        zwave_laundry_room_a_switch_binary.sendCommand(OFF)
    }
end

rule "Laundry Room Light A Test"
when
    Item zwave_laundry_room_a_switch_binary changed
then
    if (zwave_laundry_room_a_switch_binary.state == ON) {
        zwave_laundry_room_b_switch_binary.sendCommand(ON)
    }
    if (zwave_laundry_room_a_switch_binary.state == OFF) {
        zwave_laundry_room_b_switch_binary.sendCommand(OFF)
    }
end

When I trip the motion sensor on zwave_laundry_room_b_switch_binary, event.log reports this. (I tripped the sensor a few times so the switch didn’t turn off in 5 minutes.) This is better, but not quite right because button presses on zwave_laundry_room_a_switch_binary aren’t able to manipulate zwave_laundry_room_b_switch_binary

2018-12-18 17:17:30.544 [vent.ItemStateChangedEvent] - zwave_laundry_room_b_switch_binary changed from OFF to ON
2018-12-18 17:17:30.592 [ome.event.ItemCommandEvent] - Item 'zwave_laundry_room_a_switch_binary' received command ON
2018-12-18 17:17:30.598 [nt.ItemStatePredictedEvent] - zwave_laundry_room_a_switch_binary predicted to become ON
2018-12-18 17:17:30.604 [vent.ItemStateChangedEvent] - zwave_laundry_room_a_switch_binary changed from OFF to ON
2018-12-18 17:17:30.642 [ome.event.ItemCommandEvent] - Item 'zwave_laundry_room_b_switch_binary' received command ON
2018-12-18 17:17:30.649 [nt.ItemStatePredictedEvent] - zwave_laundry_room_b_switch_binary predicted to become ON
2018-12-18 17:29:31.086 [vent.ItemStateChangedEvent] - zwave_laundry_room_a_switch_binary changed from ON to OFF
2018-12-18 17:29:31.215 [vent.ItemStateChangedEvent] - zwave_laundry_room_b_switch_binary changed from ON to OFF

Regards,
Burzin

This looks like the perfect job for the new profile feature introduced in OH 2.4. It will require you to disable simple mode linking (based on the names of your Items I’m assuming you have simple mode enabled). And it might require you to define your Items in .items files. But once you do, you just need to link both Channels to the same Item and use the “follow” profile and any change to the Item caused by one of the Switches will get forwarded to the next.

Your second set of Rules look OK. Add logging statements to see whether the Rules are firing and add logging statements to the if statements to see when and whether they execute.

Of course they can be simplified to

if(zwave_laundry_room_b_switch_binary.state != zwave_laundry_room_a_switch_binary.state)
    zwave_laundry_room_a_switch_binary.sendCommand(zwave_laundry_room_b_binary.state)

Hello,

I think I figured part of the problem out. However, my rules are a bit more complicated now. I activated another channel for the physical buttons on the switchs.

Items

zwave_laundry_room_a_switch_binary  // Second switch-- Not connected to a load
zwave_laundry_room_a_switch_binary_physical // Second switch - item for physical buttons
zwave_laundry_room_b_switch_binary  // First switch-- Directly connected to load
zwave_laundry_room_a_switch_binary_physical // First switch - item for physical buttons

However, my rules are more complicated. Is there a way to simplify this. It seems to work, I’d like to reduce the rules if possible though.

Rule Scenario

rule "Laundry Room Light B Test"
when
    Item zwave_laundry_room_b_switch_binary changed
then
    if (zwave_laundry_room_b_switch_binary.state == ON) {
        zwave_laundry_room_a_switch_binary.sendCommand(ON)
    }
    if (zwave_laundry_room_b_switch_binary.state == OFF) {
       zwave_laundry_room_a_switch_binary.sendCommand(OFF)
   }
end


rule "Laundry Room Light A Test"
when
    Item zwave_laundry_room_a_switch_binary changed
then
    if (zwave_laundry_room_a_switch_binary.state == ON) {
        zwave_laundry_room_b_switch_binary.sendCommand(ON)
    }
    if (zwave_laundry_room_a_switch_binary.state == OFF) {
        zwave_laundry_room_b_switch_binary.sendCommand(OFF)
    }
end


rule "Laundry Room Light B Physical"
when
    Item zwave_laundry_room_b_switch_binary_physical changed
then
    if (zwave_laundry_room_b_switch_binary_physical.state == ON) {
        zwave_laundry_room_a_switch_binary_physical.sendCommand(ON)
    }
    if (zwave_laundry_room_b_switch_binary_physical.state == OFF) {
        zwave_laundry_room_a_switch_binary_physical.sendCommand(OFF)
    }
end


rule "Laundry Room Light A Physical"
when
    Item zwave_laundry_room_a_switch_binary_physical changed
then
    if (zwave_laundry_room_a_switch_binary_physical.state == ON) {
        zwave_laundry_room_b_switch_binary_physical.sendCommand(ON)
    }
    if (zwave_laundry_room_a_switch_binary_physical.state == OFF) {
        zwave_laundry_room_b_switch_binary_physical.sendCommand(OFF)
    }
end

Regards,
Burzin

Add your two Items to a Group.

rule "Laundry Room Light"
when
    Item Member of LaundryRoomSwitches changed or 
then
    val other = if(triggeringItem.name.contains("_a_") zwave_laundry_room_b_switch_binary
    if(triggeringItem.state != other.state) other.sendCommand(triggeringItem.state)
end

Many Thanks Rich.

I’ll certainly take a look at the profile feature, and I’ll look at your suggestion on the rules. With regard to the first rule scenario, they definitely weren’t firing. I didn’t mention it in my post, but I added logging as a test. I’m more than a bit perplexed that they didn’t work, but thus far I have not been able to figure it out.

Regards,
Burzin

You actually don’t need rules for this. Your devices have the association command class, so you can add each of them to the other’s association group. Looks like b would need a added to group 3, and a would need b added to group 2. You may be able to use group 3 for both. The one will then turn the other on/off. No controller or OH needed… and much faster.

How well do they work for motion? I’ve been thinking of picking up some of these. About time they got the motion sensor inside a zwave switch!

Hi Scott,

Thanks for the tip. I was wondering this too. I will have to read up on association command classes as well.

With regard to how well the GE/Jasco Z-Wave Plus In-Wall Smart Motion Sensor Switch (26931/ZW4006) work, I’d say they work well. I have them set to high motion sensitivity, and there’s only a slight delay (less than a second) before it turns the light fixture on. The switch has other features too such as a photocell (I disabled this) and a choice of manual/occupancy/vacancy modes. (I have it set to occupancy).

GE/Jasco makes a couple of varieties of the switch. You can see them here - https://byjasco.com/products/category/home-automation/z-wave-home-automation. I probably should have gotten a paddle style dimmer. Alas, I didn’t research the my project well.

Regards,
Burzin

1 Like