Z2M scene in HA

Hi all,

I can create scenes in zigbee2mqtt, but I can’t find them in HA. I recall them in Z2M and they work, but as said, I don’t know how to find them in HA. Those frome Philips Hue are directly found with the device (lamp) itself under the Hue integration, but nothing by mqtt.

I searched the internet, but all I found was how to create scenes in Z2M. But I know that already…

Who knows the answer?

All the best,
Jan

Edit: a question on the Dutch Tweakers board learned that it is not possible yet. You have to manually add them in the config. Use a translate for more info on: Zigbee2mqtt - open source zigbee bridge - Deel 2 - Smarthome - GoT

Edit 2: see also Home Assistant Scenes Discovery · Issue #4821 · Koenkk/zigbee2mqtt · GitHub

I don’t think that z2m scenes show up. You can call them, but they don’t show anywhere.
I’ve just started using them (with node-red).

FYI, I am working on a PR to add auto-discovery support for scenes to Zigbee2MQTT: Home Assistant discovery improvements (including scenes) by mundschenk-at · Pull Request #19838 · Koenkk/zigbee2mqtt · GitHub

3 Likes

That’s amazing news! I really look forward to seeing this :+1:t2:

It has now been merged into the dev branch.

Excuse my ignorance, but does that mean it will be in the next release?

Yes. Should be released by the end of the week from what I’ve heard.

1 Like

Just out of curiosity: why would you want to do this instead in HA?

Because ZigBee scenes are much more efficient than HA scenes (lower load on the ZigBee network, faster response).

1 Like

They really are MUCH faster if you have many lights in a scene. For instance, I have a total of 26 lights in my kitchen. when turning all on / off from a physical (Hue) switch, it can take several seconds using a HA scene, as opposed to virtually instant using z2m scenes. This slight lack of delay gives the switch a much more reliable feel.

Okay, I get it: it’s like creating z2m groups which are passed on to HA.

Thanks for clarifying! :+1:

I’m having a bit of a nightmare with the Z2M scenes at the moment!

They seem to randomly change their name (discovered scenes) in HA to either add or remove a suffix.

So for example I have a scene called scene.kitchen_0_kitchen_bright. This then becomes scene.kitchen_0_kitchen_bright_2. There are other scenes which have the ‘_2’ at the end, which then gets removed.

This obviously throws out all my automatons in NR and my many scene buttons on my Dashboard.

Anyone else seeing this?

It’s a race condition between deleting the old entities and creating the new ones. I’ve proposed a fix in Prevent scene entities from being duplicated by mundschenk-at · Pull Request #20097 · Koenkk/zigbee2mqtt · GitHub, I assume it will be in the next version.

1 Like

That’s fantastic news. I’ve had to drop back to regular HA scenes for now as it’s a live system and my wife was about to kill me as nothing was working reliably. :rofl:

Any idea when the next version will be released, or how I can try the new version?

No, sorry. (You will be able to try the new version by switching to the dev branch, but the changes are not merged yet.)

1 Like

Has this fix been released yet? Not sure if I’ve missed it. I’m not using the Dev branch btw.

Releases happen at the beginning of each month, so no. Should be out tomorrow though.

1 Like

Had a little play with it today, and it seems to be working well so far. only difference from before being that if I create a scene in Z2M, I have to restart the Z2M add-on for the new scenes to be picked up in HA. I’m guessing that this is standard behavior.

Is there any way to get transitions working with the scenes? Now that all my lights operate together (no delay due to using HA scenes) when they all change at once, it can be quite jolting!

Unfortunately, transitions currently can only be set when creating the scene. It’s actually something I wanted to make a feature request on Z2M (though I don’t know if this is Hue extension or a generic ZigBee capability).

Regarding the restart being necessary for newly created scenes: Actually no, that is not the intended behavior. I’ll look into it.

Hi. I would also have a question and no idea what is going on.

I created a scene in Z2M via the UI. If I now activate this with the command scene.turn_on in an automation for a switch and the light is off before, the light or scene is switched on slowly. More precisely, the set brightness is adjusted slowly. As if a transition of maybe 1-3 seconds was set. But I didn’t set a transition anywhere. I don’t know why this could be?

For example, if I create a scene with the same settings in HA and use it in the automation, then this effect does not occur. The light comes on immediately at the brightness set in the scene.

Can anyone give me a hint on what I can do?

Edit: The same behavior when I activate the scenes with the Home Assistant UI, for example as a button in the dashboard. So automation is not the culprit.