Syncing Multiple Z-Wave Light Switches

I have two Z-Wave switches that I want to link together. If you turn either on, the other turn on as well, and the same for turning them off. The problem I am having is they are getting into a feedback loop where one turns on, then the other turns off, then the first turns off, etc.

Here are my current automations:

- id: a_031
  alias: 'Connect hall lights - on'
  trigger:
    - platform: state
      entity_id: switch.hall_lights
      to: 'on'
    - platform: state
      entity_id: switch.laundry_hall_light
      to: 'on'
  action:
    - service: switch.turn_on
      entity_id: switch.laundry_hall_light
    - service: switch.turn_on
      entity_id: switch.hall_lights

- id: a_032
  alias: 'Connect hall lights - off'
  trigger:
    - platform: state
      entity_id: switch.hall_lights
      to: 'off'
    - platform: state
      entity_id: switch.laundry_hall_light
      to: 'off'
  action:
    - service: switch.turn_off
      entity_id: switch.laundry_hall_light
    - service: switch.turn_off
      entity_id: switch.hall_lights

I have also tried separating them out into four automations, in other words:

  1. if hall on then laundry on
  2. if hall off then laundry off
  3. if laundry on then hall on
  4. if laundry off then hall off

That has the same result. It isn’t every time, so I think it has to do with the delay between triggering the light and the automation firing. I suspect there is some way of making it work with delays and conditionals, but I’m hoping there is a more elegant way. Any tips?

Honestly I think this should just work because turning on a light that is already on should NOT turn it off. So something is weird.

That said, given that you tried a config with the 4 possible states why not just add conditions to each of the four.

  1. if hall on [ when laundry off] then laundry on… etc

I found the problem while testing your suggestion. One of my switches isn’t reporting when it’s status changes. I’ll replace that switch and hopefully the issue will go away.

Thanks!

What kind of switches? Many switches support association groups, where turning on/off one switch will activate the others (e.g. some GE/Jasco use groups 2 and 3 for single and double taps). When configured this way, you no longer even need the hub. I think the downside is that you don’t have independent control of the lights anymore.

1 Like

I gave the GE switches. Do you have a link or guide to setting that up?

This is the best description I’ve found: https://www.vesternet.com/resources/technology-indepth/groups-scenes-associations

I’ve never used it though, and unfortunately after reading more I don’t think it works the way I originally thought. Instead of all devices in a group controlling each other it sounds like you assign one device to control others in a group, but the other devices don’t control it. In your case you could setup the hall switch to control the laundry one, but not the other way around… so not so useful.

is your switch capable of dimming? What model is it? There’s a set of GE dimming switches that don’t work well with HA. (Or more likely, don’t work well with Open Z-Wavve, which HA uses.) One of the symptoms is if you try to toggle the switch in the HA interface, it changes state, then goes back to its previous state, and then after a few seconds goes to the state you wanted in the first place. I had a couple of these. I never got to the point of trying them with automation because I returned them fairly quickly. However, if the interface changes I witnessed correlate to an actual state change inside HA, then it would cause havoc for automations like yours.

@lddubeau- I do have some of the dimmable switches, but these two are just the 14291 In-Wall Smart Switches.

@freshcoast- Yeah, that doesn’t sound like quite what I’m after, but it did put me on the path to getting double tap to work for scenes, so thanks!

Yeah, I don’t think the 14291 is among those models that exhibit the state flip-flop.

I have my kitchen-lights setup like that: one button (with fibaro switch, connected to light1) turns on/off light1 and via an association-group also turns on/off light2 connected to another fibaro switch.

Using that button turns on/off both lights, but if I send on/off commands to one of the lights from home-assistant the association-group is not used and only the targeted light turns on/off.

My assumption is that the association-groups configured in the switch are only used when the hardwired button is pressed, not when the switch is triggered over the z-wave network (probably explicitly to avoid problems/loops like mentioned here)

I just recently installed an Aeotec Nano switch, and was seeing this exact problem. What I finally learned (thanks tom_l) was that the Nano was generating a lot of Z-Wave messages, and Home Assistant had not received the status from the device in time, so it reverts the switch position. Only to get the update from the switch a second or two later and update the switch position. My fix was to change a parameter in the Nano. I do not know enough about Z-Wave to know if your GE switches have the same parameter.

Setting parameter 80 to basic reports is probably best. Hail CC floods the z-wave network with reports on every little change and can cause communication issues.
Hail = device notifies hub that something happened, hub polls, device gives status
Basic = device sends status

This post may help as the GE dimmer switch is mentioned.

BTW, FWIW, I have one GE switch and six Inovelli switches in my home. My issue with GE/Jasco switches is that most of the lighting I want to control are on 3-way or 4-way circuits, and GE/Jasco require that you use their satellite switches at $20 each. The Inovelli works with standard* 3-way and 4-way switches. (like the ones already in the walls).

*I did notice a problem that wall switches that are lighted (usually with a neon lamp) are incompatible with Inovelli switches. So lighted switches have to be replaced with unlighted ones, but $3 or $4 certainly beats the $20 for the GE/Jasco auxiliary switch.

Hope this helps.

I had issues with GE switches also. You need to add the following to your configuration to get them to correctly update their status. This adds polling of their status, the GE’s are not reporting their status correctly for some reason. Strange because these switches worked fine when they were on my SmartThings hub and ST’s polling is totally busted, so I know they were reporting correctly on that platform.

zwave:
    ...
    device_config: !include zwave_device_config.yaml

One entry for each light…sample …
zwave_device_config.yaml

light.halogen_level:
  polling_intensity: 1
  refresh_value: true
light.flat_light:
  polling_intensity: 1
  refresh_value: true
light.island:
  polling_intensity: 1
  refresh_value: true
light.downstairs_bath_light:
  polling_intensity: 1
  refresh_value: true

I found the fix here but found I only needed the two entries not the others listed in the post.

I’m pretty sure it’s just a bad switch, because all my others (20+) work fine, and this one did until recently.

Good point. Perhaps I have 4 bad switches because they were all not updating for me. I have several more still on SmartThings that I will be moving over so we’ll see if they don’t post also. They all worked on ST. It could still fix your issue to poll the switch but you may not want the mesh traffic of polling all the time. They should just update when they change state.

The older, non z-wave plus switches do need to be polled. Do you have those, maybe?

Nope, They are all model 12724 - Zwave plus. Dimmers actually, I only have one switch configured and it is working fine with need for polling, I realized this when I looked up the model number of the units I was having issues with. I forgot they were dimmers but still think they should update better. Adding the polling resolved my issue, they still do the flip on/off thing which is weird but they work now.

EDIT: These are just zwave. I thought they were zwave plus be cause when I search the amazon page comes up first with the new models. But looking at the manual for these they are just zwave not zwave-plus.
That actually makes be feel better. Not HA’s fault.
https://products.z-wavealliance.org/products/1197

I realize why they work in SmartThings now. I have written SmartThings device handlers and one really nice feature is they almost always issues a zwave get command after a zwave set command. This causes the device to return it’s state. So they don’t poll the switch all the time they only poll immediately after issuing a set. I wish there was a way to issue a 1 time get command for HA because I have a few devices that don’t work unless you do that.