Automation Based on Zwave Switch - Sometimes yes, Sometimes no

I have a Dragon Tech Zwave plus Dimmer switch I am using in a shower to turn on/off the lights. I recently set up an automation that when this light is turned on it should trigger another zwave switch (GE model non-zwave plus) to turn on the bathroom exhaust fan. When the Dragon Tech Dimmer switch for the shower is turned off the GE Exhaust fan switch should then turn off after 2 minutes. This all works great if I trigger the switch through the HA front end however if I manually trigger the Dragon Tech Switch it will work some of the time and some of the time it doesn’t. I can see in the logs that manually triggering the switch it sometimes doesn’t get recognized. The switch and light will be on but HA never sees it and the switch isn’t flipped on the front end.

I tried also adding the switch to a separate group and in my trigger also check to see if the group is turned on but neither is recognized when it doesn’t work. Same thing will happen when trying to turn off the switch manually, sometimes works and sometimes not.

What is also interesting is that occasionally when it doesn’t immediately trigger it will sometimes have a few minute delay where it suddenly gets recognized it is on and will then trigger the fan. Because of this behavior I was thinking it has to do with my setup of zwave for this switch but I have tried various polling and delay values and I have the refresh_value set to true but nothing seems to help.

I have over 40 zwave switches, sensors etc and an additional 2 in that same bathroom so I don’t think it’s a zwave mesh problem as all work flawlessly when trigger through the HA front end and it’s only about 20 feet from my Aeotec Stick.

I’ve been struggling trying to come up with a reliable automation for turning on/off the fan. If anyone has any ideas on what else I could try or what the problem might be please let me know.

The below works for me. It didn’t work well until I set the polling mentioned here: Zwave: On vs Off vs Level

  • alias: Hallway Light on
    trigger:

    • platform: state
      entity_id: light.kitchen_lights_level
      to: ‘on’
      action:
      service: switch.turn_on
      entity_id: switch.hallway_light_switch
  • alias: Hallway Light Off
    trigger:

    • platform: state
      entity_id: light.kitchen_lights_level
      to: ‘off’
      action:
      service: switch.turn_off
      entity_id: switch.hallway_light_switch

Do you mean the polling in the zwave config? This is my setup:

zwave:
  usb_path: /dev/zwave
  network_key:  xxxxxx
  new_entity_ids: true
  polling_interval: 30000
  device_config:
    light.masterbath_shower_light_level:
    refresh_value: true      **<- I even tried using a number value here because there are various examples of both in the forums**
    polling_intensity: 1
    delay: 3

This is my automation, it is similar to yours. I don’t think it’s the automation part but something with the zwave setup but no matter what I’ve tried so far nothing gets it working consistently.

- alias: Turn on Masterbath Fan
    trigger:
      - platform: state
        entity_id: light.masterbath_shower_light_level
        from: 'off'    **<- Also tried removing the "from" and just use "to"**
        to: 'on'
      - platform: state
        entity_id: group.mbshowerlight
        from: 'off'
        to: 'on'
    action:
      - service: homeassistant.turn_on
        entity_id: switch.masterbath_fan_switch

This works for me:
zwave:
usb_path: /dev/ttyACM0
network_key: XXXXX
device_config:
light.bedroom_lights_level:
refresh_value: true
delay: 2
light.kitchen_lights_level:
refresh_value: true
delay: 2

1 Like

Did you make any changes to the “Dim Rate” of the switch as mentioned in this -> Zwave: On vs Off vs Level ?

Based on prior forum articles I changed the delay to 3 so that the dimmer switch could reach it’s fully on or off position.

I haven’t done that yet.

You may also be able/need to go into the configuration parameters on the zwave switch and set it up to communicate its state back to the zwave network when it changes.

on some of my switches the parameter is 80 and i change it to “hail”.

Unfortunately I do not have an option like that for this switch. There was an ability to change the Polling Intensity which I did change from 0 to 1 in the switch but my only other options are Orientation (flip switch upside down) or Levels & Duration which have to do with the rate and length of how quickly the dimmer works.