There are some notifications that I’d like to display on the LEDs of multiple Blue switches in different parts of the house. I’m hoping that there’s some way to do this with group scenes, but when I look at this in Z2M’s Groups page, it looks like if I was to create a scene there, it would also include the on/off state and brightness of each switch’s load, and not just the LED effect.
So is there some way to create a scene that only affects specific values and doesn’t touch others?
I don’t believe Z2M supports any of the led effects in scenes:
I’d be extremely interested to learn that I’m wrong, though! Unsure is this is a Z2M thing vs ZigBee spec.
You CAN create scenes that only update certain [supported] attributes of a device, though (documented in that link) e.g. I “pre-stage” my hue bulbs by setting a network-wide group scene that only tells them to change their color temp, but not to turn on or off. This way, bulbs that are currently on stay on and those that are off stay off (but will immediately be the correct color temp when they are turned on via a bound switch).
So if that’s the case, is it at least possible to somehow send the same LED effect commands to a group, thereby making automations slightly less of a nightmare?
And just saw your edit… I’ll try to decipher the info at that link. Thanks. I was hoping for a GUI method of doing this.
I haven’t tried it, but I see no reason it wouldn’t work: Z2M supports updating groups with anything you could update a single device with. I’m hitting the limits of my knowledge here quickly, though so don’t want to steer you in the wrong direction.
Yes, looks like you can call the mqtt.publish service to send messages. I use NodeRed for all of my automations so I’m not too familiar with HA’s capabilities there.
@euggersh were you able to figure out a solution? I have single switches set up to display effects while certain automations are running, but it’d be awesome if I could easily apply the effect to a group instead.
I use zha instead of z2m so I don’t know how much of this will work for you but this is my approach for sending notifications to all of my switches. I have two different scripts to make this work:
This script takes the ieee_id of the switch and the args for the event. Those are supplied by the script below.
alias: Trigger Switch Notification
sequence:
- alias: Iterate through switch notifications
repeat:
count: "{{ ieee_ids | count }}"
sequence:
- variables:
ieee_id: "{{ ieee_ids[repeat.index - 1] }}"
- service: script.turn_on
data_template:
variables:
command_args:
led_effect: 1
led_color: 1
led_level: 99
led_duration: 255
ieee_id: "{{ieee_id}}"
target:
entity_id: script.send_inovelli_notification
variables:
ieee_ids: |-
{% set result = namespace(ids=[]) %}
{% for state in states.light %}
{% if device_attr(state.entity_id, 'model') == 'VZM31-SN' %}
{% set result.ids = result.ids + [(device_attr(state.entity_id, 'identifiers')|list).0.1] %}
{% endif %}
{% endfor %}{{ result.ids }}
mode: single
icon: mdi:bell
The script works by finding the ieee_ids of all lights that match the blues model number. It then iterates through all of the ieee_ids and sends cluster commands to each individual switch.
You can calculate the values for command args as follows:
You can also technically combine this into one script, but zha sometime fails to send a command to a single switch. If it’s one script that causes the whole thing to fail. By breaking it out into another script only that single switch notification fails instead.
I haven’t had time to group switches together in Z2M so I haven’t tested this on Z2M groups. But it works great when calling single or multiple switches at a time.