Zigbee2MQTT - Missing triggers in automation on switches/buttons

Hi all,

I’ve been using HA for a few months, and got a few Aqara switches/buttons and a few lightbulbs.
Everything has been working fine with ZHA so far.

However, I have purchased some Aqara Wireless Remote Switch H1 Double Rocker which for some reason is not supported in ZHA. So I’ve set up Zigbee2MQTT which went somewhat fine and its setup.

HOWEVER - My issue now is that when I re-pair my devices, they get paired and configured just fine.
But when I try to setup/resetup my automation I do not have the triggers/sensors (Not sure what you call these?) in my automation when selecting the device.

Photo of devices and missing functions in automation:

I only get battery level and temperature… I tried looking around in here and googling but didn’t find a solution. I found a workaround which is if I press the paired button and go through its functions (single press, double press, etc) it will should up in HA and can be set up.

My issue with this is that it’s just an annoying thing to do. And I’m afraid I will in the future miss out on possible functions of future devices since I would have to “use/active” the function before it’s even shown. I didn’t have to do this when using ZHA.

Does anyone have a solution to this or anything?
If any additional info is needed let me know.

1 Like

Device triggers are extremely limited. You’ll probably have to branch out and use non-device triggers, like event, state, etc… triggers.

I just find it strange that when I used ZHA instead of Z2MQTT I would see all the functions of the button/switch when setting up automations.

Before re-pairing the devices I removed the devices from ZHA, deleted ZHA integration, and then reset the devices to re-pair them with Z2MQTT.

Again, I am not sure what you normally call these so the word triggers/sensors might be wrongly explained by me.

Yes, that’s a device trigger. And it may not exist for the device you’re trying to integrate. Device triggers are limited, this is one of the many reasons why they are limited. You’ll need to use an event trigger.

I am not 100% sure I understand what you mean.

All the device triggers was existing on the previous setup in ZHA on the Aqara mini switch but not when using Z2MQTT. So they should exist I’d think? (Also they do come “automatically” if i press through the switches functions under device triggers)

I do not seem to be able to choose any other triggers that can do that on other triggers than “Device”.
Or is event triggers something that must be set up manually somewhere else?

Event triggers need to be sniffed out by the user. They do not exist if the integration does not create a device that contains events. ZHA and MQTT are completely different integrations, what one has, the other may not.

You can use dev tools → events to listen for events and then use that information to generate your event trigger.

Okay, thanks for the clarification.

Just seems odd to me that a big addon like Zigbee2MQTT doesn’t have “auto sniff” to detect functions of the etc Aqara mini switch or Aqara double rocker switch when ZHA detects it during pairing.

It is a “small” issue as the functions do pop up in triggers after pressing the different functions on the button/switch after pairing.

1 Like

Just take a look at blueprints, there’s plenty that use Z2M. As a sidebar, most of home assistant is this way. Device triggers, conditions, and actions are rather new and limited. You should try to learn what HA was built on otherwise you’ll have issues with other automations.

Thank you - this resolved it for me too!

Petro, I think there’s a misunderstanding. I have the same issue as snyyyz. Maybe we are using the wrong terminology.

Normally, when you are adding a device like a button, you can create an automation, and when you are selecting the device, the Trigger drop-down will show things like “single_left” . When I add the H1 button (after having removed it before), the drop-down only shows things like “Switch Operation Mode changed”, or “Battery level changed”. This is not the case the first time you add the device.

I am wondering how I can restore the missing device actions?

Just found this from documentation while wondering the same topic:

MQTT device trigger is the recommended way to respond to button clicks. The MQTT device triggers are discovered by Zigbee2MQTT once the event is triggered on the device at least once.

How do you do this? My device doesn’t detect the triggers at all

I have a different model of aqara wireless switch butsame problem as yours. No triggers on automation. Have you resolved this? If Yes can you please teach me. I’ve been looking for a tutorial on YouTube but no luck on how to make this wireless switch work on z2m.

Which device? Link to the z2m page for it please.

I have done this only with Ikea Trådfri on-off switches. At first there is no other than on and off (and those extra ones too).


Then just first wake up the device by pressing once, then e.g. in my case a long press for both buttons (missing triggers). The actions can be seen in logibook:

And after that, reload the automation (go out and back in):

Missing actions are now triggers.

I have been having issues with this lately. I have 4 Aqara mini switches (Aqara WXKG11LM control via MQTT | Zigbee2MQTT) the Actions (Z2M) are not being reported as Triggers (Home Assistant). 2 of them are working fine and have for a while 2 of them are sporadic and triggers go missing at random times. Not sure if this is a Home Assistant or Z2M issue but it is pretty frustrating that I have automatons setup and working and one day they just stop working because the triggers have disappeared.

Hi there @lundy. Have you had any luck in finding a solution? I’m having the same issues. I’ve got several aqara buttons. They’ve worked fine for ages. But lately, I keep having automations stop working, only to find that the the trigger options in the automation setup now only give these options:

Battery Level Changes
Temperature Level Changes

For a while, I was solving this by force removing the button from Zigbee2Mqtt and then re-pairing it. This worked, but inevitably, the button presses stop registering and triggering the automations.

Today I’ve had multiple buttons fail. I’m looking for a permanent solution.

Hello everyone,

I am reaching out because I am experiencing the same issue as the original poster with my Zigbee setup in Home Assistant. Specifically, I am using the SONOFF Zigbee dongle with Zigbee2MQTT, and I have both Aqara buttons and Moes knobs integrated into my system.

The problem I’m facing is that the ‘single press’ trigger, as well as other action triggers, intermittently disappear from the automation UI in Home Assistant, leaving only the battery state visible. This issue seems to occur quite frequently and without a discernible pattern. After I restart Zigbee2MQTT and Home Assistant, the triggers typically reappear, which is a relief but also quite frustrating to deal with regularly.

I wanted to point out that my entire setup, including Zigbee2MQTT and Home Assistant, is running in Docker containers. I make sure to keep all components up-to-date, hoping that a new update might resolve this erratic behavior, but so far, no luck.

It’s proving to be quite a challenge to find a reliable fix for this, and the inconsistency of the problem makes it even more difficult to pinpoint the cause. If anyone else is using a SONOFF Zigbee dongle or has a similar Docker-based setup and has encountered this issue or has any suggestions for a more permanent solution, your input would be invaluable.

Thank you all for your time and help.

Go to devices & services, mqtt, to the device.

Click the plus next to automations. You’ll get something like this

1 Like

Thx for your reply, and i cant see the single press :

Actualy i’ve managed to implement a temporary workaround that seems to address the trigger issue I was experiencing with my Zigbee devices. In my Home Assistant automations, I’ve added an MQTT trigger directly to the automation’s configuration to listen for the ‘single press’ action.

Here’s the added snippet to my automation script:

trigger:  
  - platform: mqtt  
    topic: "zigbee2mqtt/bouton_knob_desk/action"  
    payload: 'single'  

And this is the complete automation that now successfully triggers the desired action:

- id: smart_knob_single_press  
  alias: smart_knob_single_press  
  trigger:  
    - platform: device  
      domain: mqtt  
      device_id: MyID
      type: action  
      subtype: single  
    - platform: mqtt  
      topic: "zigbee2mqtt/bouton_knob_desk/action"  
      payload: 'single'  
  action:  
    - service: light.toggle  
      entity_id: light.ledstrip_lidl_desk
  mode: single  
2 Likes