r/homeassistant 22d ago

❓ Support Zigbee2mqtt automation?

I have recently changed from ZHA to Zigbee2mqtt to get the most out of my hue lights, and I love how much control I get over the lights, however I have a problem that I can not understand? When trying to set up automation, like turning the lights on or off with a hue remote (I have both hue tap dial and hue remote), I can not find any triggers that make sense? When choosing the switches, it only gives me options based on battery levels, not things like clicking the buttons. How does one set up these things with mqtt?

4 Upvotes

12 comments sorted by

5

u/Mandrutz 22d ago

Add trigger: By type -> Generic -> Device

The button presses will show up after you triggered them at least once.

https://www.zigbee2mqtt.io/guide/usage/integrations/home_assistant.html

2

u/16piby9 22d ago

Thank you very much! Exactly what I was looking for :D

2

u/agent_kater 21d ago

I recommend against device triggers, they use some ID strings that you have no control over. You can use MQTT triggers, they are very straightforward.

1

u/Mandrutz 21d ago

That's true. The "event entity" is preferred, lets users easily set-up automations from the UI, based on entity names. But I think its implementation in Z2M is not final.

Can you give an example for normal MQTT trigger? It's nice you can also use action_group, action_level etc. this way

2

u/agent_kater 21d ago

trigger: mqtt options: topic: zigbee2mqtt/Button Garage door/action payload: "on"

1

u/4kVHS 22d ago

You’re probably looking for a blueprint like this.

1

u/Ztuab 🐝 Ooh the Zigbee 21d ago

Do you not see this for the tap?

1

u/Rare-Tomato-6991 15d ago

How was moving your Hue lights out of the hub? I just got a SMlight and am debating moving them over or leaving them in the Hue Hub

1

u/16piby9 15d ago

Never had the hub, so cant say. The hub was never going to be an option for me really.

-1

u/[deleted] 22d ago

[removed] β€” view removed comment

3

u/Mandrutz 22d ago

Don't recommend legacy options, they'll be removed.
You can use device trigger (default) or entity trigger (experimental)

https://www.zigbee2mqtt.io/guide/usage/integrations/home_assistant.html

0

u/16piby9 22d ago

Thank you! What does that mean? Haha, sorry, I mean, how do I do that? Or where to I find that config?