Simple automation for changing LED bar color in HA/Z2M...?

Really simple question here. I’ve found some posts that look related, but I can’t quite decipher them.

I have all of the lights in a room bound to a Blue switch (Zigbee/Home Assistant/Zigbee2MQTT). Works great for both on/off and dimming, and I have the LED bar set to different colors for “on” and “off”.

I can also change the light state in Home Assistant or via Alexa (which sends the command to HA). If, say, I turn off the lights in HA, the LED still stays in the “on” color.

I’d like to write an automation, preferably using the UI as opposed to YAML, which checks for the state of a group entity (“living_room”) that I’ve set up in HA, and if that entity is on or off, set the switch color accordingly.

As I said, this is likely very simple, but I can’t seem to decipher how to just turn the bar a different color (as opposed to turning the bar on/off colors). Thanks in advance!

The on/off colors should change when you both locally and remotely control the device. I tested the new Red and it does it. Maybe there is a firmware bug in the Blue devices. I’d re-post asking about that.

Maybe post the question/possible bug here.

Blue Series 2-1 Firmware Changelog | VZM31-SN - Switches / Firmware Discussion - Inovelli Community

When you are turning off the lights in HA, are you turning off the bulbs or the switch?
If you are turning off the bulbs the switch may be staying on which is why the LED isn’t changing. Try adding the switch into your light group that you’ve bound it to and this should allow the switch to follow the state of the bulbs.

I’ve been wondering that too.

When you say “control the device” - I’m changing the “effect” (effect, color, level, duration) in Z2M, nothing happens… the documentation is incomplete and so I don’t know if something SHOULD happen.

Ok, that works…

But this is still an issue. When I set an effect, all that happens is that the bar goes off for the set time. What else do I need to do/set?

I believe that’s still a bug with Z2M. Try this: [Z2M] Inovelli VZM31-SN Blue Series 2-1 Switch LED Notification Script - Blueprints Exchange - Home Assistant Community

You can just turn on or off the switch from HA since the bulbs are all bound to the switch the switch will command the bulbs to the same brightness or off.

That’s how the effect duration setting is supposed to work. If you set an effect and have the duration of 60s, it will go off for 60s then turn off. For indefinite you want that setting to be 255 which is indefinite. This will make the effect go off until cleared. So if your automation is setting the effect on the state change of your group entity to ON, have that effect be indefinite and then set another automation to clear the effect when your group entity turns OFF.