Instant Notifications All Switches Using Multicast on HA

After a few years of dipping my toe in the water I’m finally going full steam with migrating to Home Assistant. Multicast functionality with ZwaveJS is amazing, I can almost instantly turn on/off all my lights in the house and I’ve been struggling to implement the same for notifications. With @kreene1987 help, I can now update every notification on every red series dimmer almost instantly. I have constant notifications set, so all my switches are constantly displaying a state (alarm is armed, something is open, person detected on property, all clear, etc). This method is MUCH faster than anything else I’ve tried including bulk set partial param method. Hopefully this helps someone else, here are my setting under scripts. I prefer Mode as “Single” but command class and property should be the same for the red series dimmer and for the value use the calculator Inovelli Switch Toolbox

If you are getting an error when attempting to multicast to your switches confirm in the zwavejs2mqtt control panel that your switch has the additional config paramater on it as seen below


If that param is missing, it is because zwavejs2mqtt is missing this in the config, you can add it manually as documented in this thread or force create by sending a bulk partial param config command to all the switches like this

after all your switch LEDS change to reflect the change you will need to restart the zwavejs2mqtt server and you should now see the additional param added for your switches.

11 Likes

I’ve started changing some of my automations over to multicast, too. It’s very nice!

Personally, I hope that the zwavejs integration will some day be smart enough to recognize when you’re trying to send the exact same command to multiple devices and just do multicast transparently under the hood.

2 Likes

Can you share your service call for multicast on/off?

The command class, property, and value are the only differences. This is for “On”, and "Off is just changing the value to 0. I only have Red Dimmers installed so these setting may not work for their on/off switches. They would probably need a few different values than what is in the fields below.

3 Likes

Thanks! That works perfectly. This weekend, I’ll see if I can turn that into a template light entity. Will post here if it works.

1 Like

Okay here’s what I ended up with. For context, I have two light switches that control my Hallway lighting and I like them to be in sync with each other (treated as a single light). The light group is what I used to control them before. It’s reasonably fast, but as far as I can tell it doesn’t take advantage of ZWave Multicasting (since there is a slight delay before the second light responds. I did end up using it as the device to get the current state and brightness for the multicast template.

The on/off was super fast (as expected), brightness adjusting was kind of slower than I expected, actually it was a little slower than using the light group directly, so there may be some further optimizations that could be done here. Using the light group as a device to get the current brightness from may be a contributor for why it’s behaving a little slower.

light:
  - platform: group
    name: Hallway Lights
    unique_id: 00592bd8-5689-4280-945a-de12766bd25d
    entities:
      - light.hallway_lights_switch
      - light.entryway_lights

  - platform: switch
    name: Stairway Lights
    entity_id: switch.stairway_lights

  - platform: template
    lights:
      hallway_lights_multicast:
        friendly_name: Hallway Lights
        unique_id: d40ba2d4-6cb6-4e73-b46b-a14817f98e8f
        level_template: >
            {% if is_state('light.hallway_lights', 'on') %}
                {{ state_attr('light.hallway_lights', 'brightness') }}
            {% else %}
                0
            {% endif %}
        value_template: "{{ is_state('light.hallway_lights', 'on') }}"
        availability_template: "{{ not is_state('light.hallway_lights', 'unavailable') }}"
        turn_on:
          - service: zwave_js.multicast_set_value
            target:
              device_id:
                - 88136be71050b07599ec3caf5928e7a5
                - 72cc86bafa000fa493467b98dfc6543d
            data:
              command_class: '38'
              property: targetValue
              value: 99
        turn_off:
          - service: zwave_js.multicast_set_value
            target:
              device_id:
                - 88136be71050b07599ec3caf5928e7a5
                - 72cc86bafa000fa493467b98dfc6543d
            data:
              command_class: '38'
              property: targetValue
              value: 0
        set_level:
          - service: zwave_js.multicast_set_value
            target:
              device_id:
                - 88136be71050b07599ec3caf5928e7a5
                - 72cc86bafa000fa493467b98dfc6543d
            data:
              command_class: '38'
              property: targetValue
              value: "{{ (brightness / 255 * 100)|int / 99 }}"

Can you post your .yaml for this call? I still can’t get mine to work right with the following:

service: zwave_js.multicast_set_value
target:
  device_id:
    - 64c0b27934ced15638bb77148adf557b
    - a483433e6638af5380042234a70ffe5a
data:
  command_class: '112'
  property: '16'
  value: 50268672

Maybe this for data?

data:
broadcast: true
command_class: ‘112’
value: 50268672
property: ‘16’

Did you click on the “Go to YAML” at the bottom of the page to see the YAML?

No, just checked and that broadcast line makes it fail.

Your YAML looks OK to me.

Sorry for the delay, agreed the yaml looks fine to me, here is mine

service: zwave_js.multicast_set_value
data:
command_class: ‘112’
value: 50268672
property: ‘16’
target:
device_id:
- 62e0da6280288b664446165dd9d7fac0
- db1b54c7054da44ebe558e1ca40960a2
- 5936b837004d215a7a4f943196m22f12
- 66c12k14s9c1ca09841f0c7afc059875

Indentation? I’m thinking the target and data should be indented 2 spaces in from the service call.

I haven’t tried this in an automation, but maybe someone who has it working in an automation could post their code snippet from the automation and use the preformatted code tag (looks like </>) from the top of the response box.

@PJF have you tried to set an LZW30-SN on/off? I tried this as a payload in node-red but I get an error.

{
“command_class”: ‘37’,
“property”: “targetValue”,
“value”: ‘1’
}


"Call-service error. Unable to set value, refer to https://zwave-js.github.io/node-zwave-js/#/api/node?id=setvalue for possible reasons"

EDIT:
GOT IT! Needed to use true instead of ‘1’

{
    "command_class": '37',
    "property": "targetValue",
    "value": true
}

I can’t seem to get the dimmer notifications to work via multicast either (on/off works great!), the error is:

Node Node(node_id=27) doesn’t have value 27-112-0-16

I’m using the same YAML as above:

alias: zwave test
sequence:
  - service: zwave_js.multicast_set_value
    data:
      command_class: '112'
      value: 50268672
      property: '16'
    target:
      device_id:
        - 338657a7094766d577c3ad597baaf472
        - 3d77c0619cc357dbb81f21d4799afb61
mode: single
icon: mdi:sleep

EDIT: I have firmware 1.48, perhaps I need to upgrade?

I’ve tried seemingly every possible combination and I can’t get mine to work either. Same error, and similar error in Node Red.

This is strange. I updated all my dimmers to the latest firmware, 1.57 I believe, and the latest bin (not sure what that is). Here is a screenshot from the zwavejs2mqtt control panel showing those parameters on one of my red series dimmers. My zwavejs2mqtt version is currently on 0.24.1


I am also using a Nortek zwave/zigbee usb stick… Is it possible only certain sticks support this functionality? And also, broadcast = true does not work for me either. It throws an error but I assumed it was because I have multiple zwave sticks and multiple HA instances.

I’m using the zwave.me stick. Dimmer has 1.55 fw. I Have another with 1.52 and it has those params too.

If I configure the automation to only send to one device, Z-WaveJS routes it via zwave_js.set_value and that works - so the params are there. Not sure why it fails with zwave_js.multicast_set_value

This is the warning that shows up in HA:

Passing the zwave_js.multicast_set_value service call to the zwave_js.set_value service since only one node was targeted

Hmm @flipontheradio your zwavejs2mqtt has an extra param that I don’t have. The last one 12-112-0-16, and I have upgraded to the latest firmware on my dimmer (1.57, 1.44)

1 Like

Yeah this gets into partial parameters. Essentially they have hidden 4 parameters within one by using the length of the parameter to their advantage. We are trying to set just the one parameter, but I think ZJS sees this as 4 with different property keys. The Zwave.bulk_set_partial_parameters works to set this programatically, but I can’t get around it with multicast for partials.

Not sure how fotr got it working!

Here’s a thought, may be WAY off base… All my switches were factory reset and then paired to the stick. I’ve never set those params NOT using the multicast, so I’m wondering if you have set them manually in the past if multicast is unable to then overwrite? I’m grasping at straws…

1 Like