Yep moved from Mosquito to EMQX and haven’t had a single instance of this issue.
@lundy are you using the addon version of emqx? (And before that mosquito)
@nickrout exactly. Been rock solid since I moved over and it only took something like 30 minutes to do.
Update: This has now started happening with EMQX after a few months with no issues. Not sure what the deal is here.
I can confirm this is happening to me in version 2024.10.3 running in Docker, with Aqara buttons.
The triggers seem to just… vanish, and it seems like a reboot of the raspberry pi is required - a docker container restart and/or restart of HA from the UI both were not enough.
Interestingly, I notice that the event actually fires, it really is just the trigger which disappears in HA (and presumably is what breaks my automations) and the trigger also disappears in NodeRed. I see battery state changed and “identify” as the only 2 available triggers.
I’m using 3 buttons connected to my Aqara hub, connected through HomeKit.
Here’s the event firing:
event_type: state_changed
data:
entity_id: event.moon_lamp_moon_lamp_button
old_state:
entity_id: event.moon_lamp_moon_lamp_button
state: "2024-10-22T04:36:37.929+00:00"
attributes:
event_types:
- single_press
- double_press
- long_press
event_type: single_press
device_class: button
friendly_name: Moon Lamp Moon Lamp Button
last_changed: "2024-10-22T04:36:37.929659+00:00"
last_reported: "2024-10-22T04:36:37.929659+00:00"
last_updated: "2024-10-22T04:36:37.929659+00:00"
context:
id: 01JAS86EX983YXFN5G3KKZWGD0
parent_id: null
user_id: null
new_state:
entity_id: event.moon_lamp_moon_lamp_button
state: "2024-10-22T04:36:42.480+00:00"
attributes:
event_types:
- single_press
- double_press
- long_press
event_type: single_press
device_class: button
friendly_name: Moon Lamp Moon Lamp Button
last_changed: "2024-10-22T04:36:42.480227+00:00"
last_reported: "2024-10-22T04:36:42.480227+00:00"
last_updated: "2024-10-22T04:36:42.480227+00:00"
context:
id: 01JAS86KBGDYK1B5YRXJHGZ1S7
parent_id: null
user_id: null
origin: LOCAL
time_fired: "2024-10-22T04:36:42.480227+00:00"
context:
id: 01JAS86KBGDYK1B5YRXJHGZ1S7
parent_id: null
user_id: null
And I was able to convert this very simple trigger into a much more complex “manual event” but at least it should survive these triggers disappearing ![]()
To do so:
trigger = manual event
event type = state_changed
event data = entity_id: event.moon_lamp_moon_lamp_button
then add a condition:
{{ trigger.event.data.new_state.attributes.event_type == ‘single_press’ }}
Edit:
Okay but I didn’t like the triggers and needing conditions, so I added a new event type in node red instead.
Now my trigger is:
event type = custom_aqara_notification_from_node_red
event data = entity_id: moon_lamp_button_single_pressed
And in node red I use these nodes for each button
events: state → switch → fire event (one event per button state)
I just started using HA this year and I’m still having this issue. Did anyone ever find a solution?
I can manually input the triggers in yaml as action ‘single’ for various buttons from zigbee2mqtt but they never show in the GUI as options.
You’ll need to elaborate. Are you talking about button entities, or devices that are buttons?
When looking for triggers in the automation GUI, the only options it expose are battery triggers. Zigbee2mqtt is fully aware of the ‘action’ exposure and it works if I manually enter it into the automation yaml first, I can then choose from the list of ‘actions’ and they work as expected. But if I don’t put it in the yaml ‘Action’ is impossible to select as a trigger.
Those are legacy device triggers that work off events. The new triggers work off event entities, you likely need to enable those on the Z2M side as they are not the default option.
Wait - how do I do the enable thing on the z2m side? or what does it called? I was poking around in z2m but don’t know where to do this.
Or is there an explainer I can read up?
Yep, and restart Z2M



