Blue 2-1: Applying the same configuration to several switches?

I’m in the lucky position to get to install 40 switches in a large house, but now that I’ve put in the first two switches I’m noticing that setting up every one of them (consistently!) in the exact way that I’d like the switch to work involves a lot of clicking, either in home-assistant, or in zigbee2mqtt. I’d love to reduce the number of clicks involved, and ensure that I can apply a consistent base template to all switches in bulk, so I’m asking if anyone has found a good way to do that yet.

My best idea so far is to put them all into a Group in zigbee2mqtt, then send a JSON-formatted message with the settings into the group’s topic. I tested that by sending a message like {"physicalOnOffDelay": "300ms"} to my group’s topic (zigbee2mqtt/type: Dimmer/set), but zigbee2mqtt doesn’t seem to fully understand that message: The physicalOnOffDelay setting remains unset. These are the logs I receive from sending that message:

Debug 2022-10-30 14:53:28Received MQTT message on 'zigbee2mqtt/type: Dimmer/set' with data '{ "physicalOnOffDelay": "300ms" }'
Debug 2022-10-30 14:53:28Publishing 'set' 'physicalOnOffDelay' to 'type: Dimmer'
Debug 2022-10-30 14:53:28Received Zigbee message from 'Coordinator', type 'write', cluster 'manuSpecificInovelliVZM31SN', data '{"buttonDelay":3}' from endpoint 1 with groupID 2, ignoring since it is from coordinator
Info 2022-10-30 14:53:28MQTT publish: topic 'zigbee2mqtt/type: Dimmer', payload '{"brightness":100,"physicalOnOffDelay":"300ms","state":"ON"}'

And in the end, physicalOnOffDelay remains set to “0ms” on the State.

… so besides sending spurious values (note the “brightness” and “state” values), this doesn’t have the effect I want.

I might write a script or program to do what I need, but if you use ready-made solution to apply settings changes in bulk to a lot of devices, I’d love to hear what works for you!

I’m not aware of a nice pre-built solution to this, so I’m going to write a thing. I’ll post it a bit later if I don’t get distracted.


I just quickly posted on how I do it: Michael Kehoe - SRE

Essential you create a loop using all of the device names. And then you can apply the settings using a JSON message.

Since the Z2M converters are still being improved, I would advise testing in small groups of settings to ensure they all get set correctly.


Thanks! This post is helpful!

BTW, the first automation in the last script appears to have the wrong indentation for action:.