ZEN32 Scene Controller - Z-Wave JS

Have you tried turning off the direct relay control and then writing automations to use Scene 005 to control the relay through HA?

Note: I’m just learning about HA and the ZEN32.
This guy’s video shows turning off the relay control: https://youtu.be/87jquTZ4B_U

Just picked up a zen32 and very pleased to find this blueprint. Super helpful. Thank you!

1 Like

Any idea why this wouldn’t work for the input - seems syntactically correct?

    input:
      zooz_switch: '{{ device_id(switch.fireplace_lights) }}'

Just trying to avoid hard coding the device_id.

Thanks for this Blueprint; it’s going to be a time-saver when I finally get around to setting up the automations for my Zen32 Scene Controller. I have one set up as a multiple way switch (4-way to us Americans) and I want to be able to use a scene in it to control not only that light, but the porch light as well (that switch is a Zen71 in the same wall box).

1 Like

Try

 input:
      zooz_switch: {{ device_id('switch.fireplace_lights') }}

@MattMattMattMatt , Can you go into some details to how you changed the switch configuration and what parameter you used to disable the “toggle” function?

Neither of those worked, I tried a few other variations. What I figured out is that the blueprint inputs don’t support templates. I removed the filter in the blueprint and the template text came through for the value.

So instead what I did was just pass the switch entity_id in the automation

input:
      zooz_switch: switch.fireplace_lights

Then made a few tweaks in the blueprint

  1. Updated the input definition so it just accepts a Zwave switch:
  input:
    zooz_switch:
      name: Zooz Switch
      description: Filter for Zwave Switch
      selector:
        entity:
          filter:
            - integration: zwave_js
              domain: switch
          multiple: false
  1. Switched the variable name to zooz_switch (from device_id) for clarity:
variables:
  zooz_switch: !input 'zooz_switch'
  1. Updated the condition template:
condition: '{{ trigger.event.data.device_id == device_id(zooz_switch) }}'
1 Like

Templates work if you manually edit the yaml for the generated automation, but your solution is much cleaner. Thank you for sharing.

Been using this for a year+ with no problems whatsoever, so first, thank you for making this. I recently picked up a new zwave controller (800 based) and have been migrating my devices over to it (removing from the one, adding to the other with the same name, then updating the HA entity names to match so automations sync up). When i moved my ZEN32, this automation seem to have broken completely. If i disable the existing automation and make a new test one with only a simple action tied to the main button (scene5) it still does nothing. When i check the information panel for the automation, it does show that it is being triggered when i push buttons on the controller, it’s just that none of the actions are triggering. Any idea what might be the cause of this?

EDIT: If i view in YAML mode, i can confirm that the zooz_switch: line does have the correct ID associated with it.

The ZEN32 and ZEN32 800 have different product IDs. There is a updated blueprint available for the ZEN32 800. Some one 3
Else also had the same issue.

Sorry, to be clear, this is the exact same zen32 unit, i had just unpaired it from my old 500 controller and re-paired to my new 800 controller.

Some more info:
Events from the controller are firing:

*2/26/2024, 9:15:42 PM* - **VALUE NOTIFICATION** Arg 0: └─commandClassName: Central Scene
 └─commandClass: 91
 └─property: scene
 └─propertyKey: 005
 └─value: 0
 └─propertyName: scene
 └─propertyKeyName: 005
 └─newValue: 0
 └─stateless: true

So, ha is getting the event, the automation at a top level is triggering (the “last changed” value on the automation updates when i press a scene button). But the actual actions to run when certain scene buttons are being pressed don’t trigger. Maybe something to do with how the event information is being sent is different on an 800 controller vs a 500?

EDIT2: Here is the event info from the “traces” page on the automation:

device_id: xxxxxxxxxxxxxxxxxxxxxxxxxx
this:
  entity_id: automation.scene_controller
  state: 'on'
  attributes:
    id: 'xxxxxxxxxxxxxxxxxxxx'
    last_triggered: xxxxxxxxxxxxxxxxxxxx
    mode: single
    current: 0
    friendly_name: Scene Controller
  last_changed: xxxxxxxxxxxxxxxxxxxx
  last_updated: xxxxxxxxxxxxxxxxxxxx
  context:
    id: xxxxxxxxxxxxxxxxxxxx
    parent_id: xxxxxxxxxxxxxxxxxxxx
    user_id: null
trigger:
  id: '0'
  idx: '0'
  alias: null
  platform: event
  event:
    event_type: zwave_js_value_notification
    data:
      domain: zwave_js
      node_id: 18
      home_id: 4013712635
      endpoint: 0
      device_id: xxxxxxxxxxxxxxxxxxxx
      command_class: 91
      command_class_name: Central Scene
      label: Scene 005
      property: scene
      property_name: scene
      property_key: '005'
      property_key_name: '005'
      value: 0
      value_raw: 0
    origin: LOCAL
    time_fired: xxxxxxxxxxxxxxxxxxxx
    context:
      id: xxxxxxxxxxxxxxxxxxxx
      parent_id: null
      user_id: null
  description: event 'zwave_js_value_notification'

EDIT3: I updated my local copy of the blueprint to output the property_key_name to the log during the bit where it logs the “received event” line, and the main button is reporting “005” like it should be. So the overall flow up to that point seems correct. Something is happening between the “choose” block and the list of actions. Also, i tested the actions by manually clicking the “run” button on each one in the automation editor UI and they do trigger correctly when I do that.

EDIT4: Ok, i think i found the issue. It seems like the “value” variable in the “choose” block is expected to be a string like “KeyPressed” but instead i’m just getting int values 0,1,2,etc.

EDIT5: I updated the script to use those int values instead of the strings and it started working again. Is this a change in how the event is reported by zwavejs or is this happening on the device?

EDIT6: here’s the full updated script that now works for me:

blueprint:
  name: ZEN32 (Z-Wave JS)
  description: Create automations for the Zooz ZEN32 switch using the Z-Wave JS integration.
  domain: automation
  input:
    zooz_switch:
      name: Zooz Switch
      description: List of available Zooz ZEN32 switches.
      selector:
        device:
          filter:
            - integration: zwave_js
              manufacturer: Zooz
              model: ZEN32
            - integration: zwave_js
              manufacturer: Zooz
              model: ZEN32 800LR
          multiple: false
    scene_5:
      name: Scene 5 - Pressed Once
      description: Action to run when button is pressed once.
      default: []
      selector:
        action: {}
    scene_1:
      name: Scene 1 - Pressed Once
      description: Action to run when button is pressed once.
      default: []
      selector:
        action: {}
    scene_2:
      name: Scene 2 - Pressed Once
      description: Action to run when button is pressed once.
      default: []
      selector:
        action: {}
    scene_3:
      name: Scene 3 - Pressed Once
      description: Action to run when button is pressed once.
      default: []
      selector:
        action: {}
    scene_4:
      name: Scene 4 - Pressed Once
      description: Action to run when button is pressed once.
      default: []
      selector:
        action: {}
    scene_5h:
      name: Scene 5 - Held
      description: Action to run when button is held.
      default: []
      selector:
        action: {}
    scene_1h:
      name: Scene 1 - Held
      description: Action to run when button is held.
      default: []
      selector:
        action: {}
    scene_2h:
      name: Scene 2 - Held
      description: Action to run when button is held.
      default: []
      selector:
        action: {}
    scene_3h:
      name: Scene 3 - Held
      description: Action to run when button is held.
      default: []
      selector:
        action: {}
    scene_4h:
      name: Scene 4 - Held
      description: Action to run when button is held.
      default: []
      selector:
        action: {}
    scene_5r:
      name: Scene 5 - Released
      description: Action to run when button is released.
      default: []
      selector:
        action: {}
    scene_1r:
      name: Scene 1 - Released
      description: Action to run when button is released.
      default: []
      selector:
        action: {}
    scene_2r:
      name: Scene 2 - Released
      description: Action to run when button is released.
      default: []
      selector:
        action: {}
    scene_3r:
      name: Scene 3 - Released
      description: Action to run when button is released.
      default: []
      selector:
        action: {}
    scene_4r:
      name: Scene 4 - Released
      description: Action to run when button is released.
      default: []
      selector:
        action: {}
    scene_52:
      name: Scene 5 - Pressed 2x
      description: Action to run when button is pressed twice.
      default: []
      selector:
        action: {}
    scene_12:
      name: Scene 1 - Pressed 2x
      description: Action to run when button is pressed twice.
      default: []
      selector:
        action: {}
    scene_22:
      name: Scene 2 - Pressed 2x
      description: Action to run when button is pressed twice.
      default: []
      selector:
        action: {}
    scene_32:
      name: Scene 3 - Pressed 2x
      description: Action to run when button is pressed twice.
      default: []
      selector:
        action: {}
    scene_42:
      name: Scene 4 - Pressed 2x
      description: Action to run when button is pressed twice.
      default: []
      selector:
        action: {}
    scene_53:
      name: Scene 5 - Pressed 3x
      description: Action to run when button is pressed three times.
      default: []
      selector:
        action: {}
    scene_13:
      name: Scene 1 - Pressed 3x
      description: Action to run when button is pressed three times.
      default: []
      selector:
        action: {}
    scene_23:
      name: Scene 2 - Pressed 3x
      description: Action to run when button is pressed three times.
      default: []
      selector:
        action: {}
    scene_33:
      name: Scene 3 - Pressed 3x
      description: Action to run when button is pressed three times.
      default: []
      selector:
        action: {}
    scene_43:
      name: Scene 4 - Pressed 3x
      description: Action to run when button is pressed three times.
      default: []
      selector:
        action: {}
    scene_54:
      name: Scene 5 - Pressed 4x
      description: Action to run when button is pressed four times.
      default: []
      selector:
        action: {}
    scene_14:
      name: Scene 1 - Pressed 4x
      description: Action to run when button is pressed four times.
      default: []
      selector:
        action: {}
    scene_24:
      name: Scene 2 - Pressed 4x
      description: Action to run when button is pressed four times.
      default: []
      selector:
        action: {}
    scene_34:
      name: Scene 3 - Pressed 4x
      description: Action to run when button is pressed four times.
      default: []
      selector:
        action: {}
    scene_44:
      name: Scene 4 - Pressed 4x
      description: Action to run when button is pressed four times.
      default: []
      selector:
        action: {}
    scene_55:
      name: Scene 5 - Pressed 5x
      description: Action to run when button is pressed five times.
      default: []
      selector:
        action: {}
    scene_15:
      name: Scene 1 - Pressed 5x
      description: Action to run when button is pressed five times.
      default: []
      selector:
        action: {}
    scene_25:
      name: Scene 2 - Pressed 5x
      description: Action to run when button is pressed five times.
      default: []
      selector:
        action: {}
    scene_35:
      name: Scene 3 - Pressed 5x
      description: Action to run when button is pressed five times.
      default: []
      selector:
        action: {}
    scene_45:
      name: Scene 4 - Pressed 5x
      description: Action to run when button is pressed five times.
      default: []
      selector:
        action: {}
  source_url: https://community.home-assistant.io/t/zen32-scene-controller-z-wave-js/292610
mode: single
max_exceeded: silent
variables:
  device_id: !input zooz_switch
trigger:
  - platform: event
    event_type: zwave_js_value_notification
condition: "{{ trigger.event.data.device_id == device_id }}"
action:
  - variables:
      property_key_name: "{{ trigger.event.data.property_key_name }}"
      label: "{{ trigger.event.data.label }}"
      command_class_name: "{{ trigger.event.data.command_class_name }}"
      value: "{{ trigger.event.data.value }}"
  - service: logbook.log
    data:
      name: Z-Wave JS
      message: "received event: {{ command_class_name }} - {{ value }} - {{ label }} - {{ property_key_name }}"
  - choose:
      - conditions: "{{ property_key_name == '001' and value == 0 }}"
        sequence: !input scene_1
      - conditions: "{{ property_key_name == '001' and value == 2 }}"
        sequence: !input scene_1h
      - conditions: "{{ property_key_name == '001' and value == 1 }}"
        sequence: !input scene_1r
      - conditions: "{{ property_key_name == '001' and value == 3 }}"
        sequence: !input scene_12
      - conditions: "{{ property_key_name == '001' and value == 4 }}"
        sequence: !input scene_13
      - conditions: "{{ property_key_name == '001' and value == 5 }}"
        sequence: !input scene_14
      - conditions: "{{ property_key_name == '001' and value == 6 }}"
        sequence: !input scene_15
      - conditions: "{{ property_key_name == '002' and value == 0 }}"
        sequence: !input scene_2
      - conditions: "{{ property_key_name == '002' and value == 2 }}"
        sequence: !input scene_2h
      - conditions: "{{ property_key_name == '002' and value == 1 }}"
        sequence: !input scene_2r
      - conditions: "{{ property_key_name == '002' and value == 3 }}"
        sequence: !input scene_22
      - conditions: "{{ property_key_name == '002' and value == 4 }}"
        sequence: !input scene_23
      - conditions: "{{ property_key_name == '002' and value == 5 }}"
        sequence: !input scene_24
      - conditions: "{{ property_key_name == '002' and value == 6 }}"
        sequence: !input scene_25
      - conditions: "{{ property_key_name == '003' and value == 0 }}"
        sequence: !input scene_3
      - conditions: "{{ property_key_name == '003' and value == 2 }}"
        sequence: !input scene_3h
      - conditions: "{{ property_key_name == '003' and value == 1 }}"
        sequence: !input scene_3r
      - conditions: "{{ property_key_name == '003' and value == 3 }}"
        sequence: !input scene_32
      - conditions: "{{ property_key_name == '003' and value == 4 }}"
        sequence: !input scene_33
      - conditions: "{{ property_key_name == '003' and value == 5 }}"
        sequence: !input scene_34
      - conditions: "{{ property_key_name == '003' and value == 6 }}"
        sequence: !input scene_35
      - conditions: "{{ property_key_name == '004' and value == 0 }}"
        sequence: !input scene_4
      - conditions: "{{ property_key_name == '004' and value == 2 }}"
        sequence: !input scene_4h
      - conditions: "{{ property_key_name == '004' and value == 1 }}"
        sequence: !input scene_4r
      - conditions: "{{ property_key_name == '004' and value == 3 }}"
        sequence: !input scene_42
      - conditions: "{{ property_key_name == '004' and value == 4 }}"
        sequence: !input scene_43
      - conditions: "{{ property_key_name == '004' and value == 5 }}"
        sequence: !input scene_44
      - conditions: "{{ property_key_name == '004' and value == 6 }}"
        sequence: !input scene_45
      - conditions: "{{ property_key_name == '005' and value == 0 }}"
        sequence: !input scene_5
      - conditions: "{{ property_key_name == '005' and value == 2 }}"
        sequence: !input scene_5h
      - conditions: "{{ property_key_name == '005' and value == 1 }}"
        sequence: !input scene_5r
      - conditions: "{{ property_key_name == '005' and value == 3 }}"
        sequence: !input scene_52
      - conditions: "{{ property_key_name == '005' and value == 4 }}"
        sequence: !input scene_53
      - conditions: "{{ property_key_name == '005' and value == 5 }}"
        sequence: !input scene_54
      - conditions: "{{ property_key_name == '005' and value == 6 }}"
        sequence: !input scene_55

Yet another edit: After updating the firmware on this scene controller, this updated script no longer works, but the original one at the top of the post now does. No idea why this keeps switching but as of firmware 10.40.2 it seems like the OP post one is the way to go.

1 Like

Just dropping by to say thanks for taking the time to map out this blueprint, great time saver. Thank you.

Hmmm. I got an OTA notice for 10.40.2 in HA a week or so ago, and updated, for the two ZEN32 (700) switches I have. Now, the blueprint doesn’t work. There are traces, but they all end in an X.

Executed: April 7, 2024 at 6:06:10 PM
Result:

result: false
entities: []

with StepConfig

'{{ trigger.event.data.device_id == device_id }}'

I updated to the latest blueprint (by using the “override” update feature in HA itself) and… now I don’t even get those traces.

FWIW, the main “relay” switch works fine and shows up in home assistant as normal

Any ideas?

Did you do a full re-interview of the device after the update? Mine wasn’t functioning properly at all until i did that and re-set some config values.

no issues here

Ah, yeah, a re-interview fixed it. Thanks!

the UI had a note on it saying that I needed to do a re-interview, but it was kinda small and it took me a while to notice. If that’s required after an updated like this, i wonder why it isn’t just part of the update workflow and has to be triggered manually.

1 Like

I just upgraded two ZEN32’s (700) to 10.40.2, and one works and the other doesn’t. Both are using the blueprint from the OP. Both are in the same room, one of the ZEN32’s relay is controlling a light in that room. The second ZEN32 controls scenes correctly, including the relay on the other ZEN32. The ZEN32 with the active relay seems to have zero scene control.

I re-interviewed both of them.
Logs from the ZEN32 with active relay when a scene is triggered:

2024-04-12T20:51:38.351Z CNTRLR « [Node 076] received CentralScene notification {
                                      "nodeId": 76,
                                      "ccId": "Central Scene",
                                      "ccCommand": "0x03",
                                      "payload": "0x1a8305"
                                  }
2024-04-12T20:51:44.235Z CNTRLR « [Node 076] received CentralScene notification {
                                      "nodeId": 76,
                                      "ccId": "Central Scene",
                                      "ccCommand": "0x03",
                                      "payload": "0x1b8005"
                                  }
2024-04-12T20:51:50.446Z CNTRLR   [Node 015] treating BasicCC::Set as a report

I don’t see anything else in the system logs pertaining to this device. The way it’s acting is that the blueprint automation is not even applying to this ZEN32.

Any suggestions would be appreciated.

UPDATE: Apparently the previous re-interviews I was doing were failing. I rebuilt the routes and re-interviewed the ZEN32 again, and it seems to be functioning properly now. Still odd that no errors were cropping up.

1 Like

@fxlt , could you add an option to the Blueprint to set the Automation Mode as described here

My thoughts are that I would like to run an automation in parallel if more that one button is pressed on the same ZEN32. Currently, when I go to control two devices controlled by the same ZEN32, I need two wait for the first trigger of the automation to complete before I can kick off the second device control.

@Papester That is one of the improvements I made when I made this blueprint: