Action entity missing for zigbee switches - Zigbee2MQTT

I use Zigbee2MQTT for my zigbee devices. Thermostats, thermometers and window sensors, work fine but the two remotes I have recently stopped working.
Zigbee2MQTT reports having sent the message containing the button press to Mosquitto but HA does not parse the message correctly.

The device once had an sensor.fernbedinung_kai_action entity which is no longer present.

Attempted solutions:

  • Repairing of the zigbee device: no change in behaviour
  • Listening to all Zigbee2MQTT messages: the two messages from the first image get received.
1 Like

Couple thoughtsā€¦

  1. I think there have been a number of changes in Home Assistantsā€™ interaction with MQTT devices and specifically with Zigbee2MQTT in last couple of revisions of HA. There were some sync issues between versions of HA and Zigbee2MQTT during these changes. Check change logs and carefully check versions of HA, MQTT and Zigbee2MQTT.

  2. I am kind of ā€˜old schoolā€™ so I do not let HA auto create my sensors, switches, lights and stuff, but rather manually create entities. If I read you post correctly, you are seeing the MQTT messages you want, just HAā€™s auto create if the device is not creating the entity. A bit if a hack, but you could continue to let HA create the other entities, but then manually create the missing entities by creating MQTT switches.

  3. I am not a big fan of having ā€˜spacesā€™ or other ā€˜specialā€™ characters in my MQTT topics, this has caused me some ā€˜head scratchingā€™ sessions in the past. Even, the difference between underscores _ and dashes - can cause some ā€˜burpsā€™ in some systems that interact with MQTT. I would stay away from spaces in topic names and make your ā€˜niceā€™ names within Home Assistants ability to do that there.

Good hunting!

1 Like

Iā€™ve been experiencing this same issue on and off for the past few months on a system which was working very well all summer. Doing some debug logging, I can see the messages as Iā€™d expect in the Zigbee2MQTT logs. Hereā€™s a trimmed set of logged messages that were the result of a down_triple action coming from one of my Inovelli Zigbee wall switches.

From Zigbee2MQTT:

Info 2023-11-08 10:41:53 MQTT publish: 
  topic 'zigbee2mqtt-ranch/office-hall-lights', 
  payload '{"action":"down_triple", . . . }'

Info 2023-11-08 10:41:53 MQTT publish: 
  topic 'zigbee2mqtt-ranch/office-hall-lights/action',
  payload 'down_triple'

That all looks like how I would expect it to look. Two MQTT messages published to two topics.

However, over on the Home Assistant side, I see three messages to two topics. The first has the action correctly included. It is immediately followed by a second message where the action text is suspiciously empty. This is from the HA MQTT integration settings under ā€œListen to a topicā€:

Listening to zigbee2mqtt-ranch/office-hall-lights shows me this for that message. Again, this is a single message as reported by the Zigbee2MQTT logs, but shows as two messages on the HA side. I edited out all the other payload JSON for clarity:

Message 1 received on zigbee2mqtt-ranch/office-hall-lights at 10:41:
{
    "action": "",
    . . .
}
QoS: 0 - Retain: false

Message 0 received on zigbee2mqtt-ranch/office-hall-lights at 10:41:
{
    "action": "down_triple",
    . . . 
}
QoS: 0 - Retain: false

Listening to zigbee2mqtt-ranch/office-hall-lights/action looks like I think it should:

Message 2 received on zigbee2mqtt-ranch/office-hall-lights/action at 10:41:

down_triple

QoS: 0 - Retain: false

What I see these days is that every time I upgrade Home Assistant, all of these automations break in Home Assistant because it seems to forget nearly all of the actions for the devices. This was working great as a ā€œdown_doubleā€ action automation until I upgraded Home Assistant and then my Automation looks like this:

The trigger drop-down when Iā€™m using the HA GUI to edit my automation only shows up_double and none of the other double or triple actions supported by the switch. If I restart Home Assistant, it even forgets the up_double. Surely this list of device actions is supposed to survive a Home Assistant restart, right?

Usually Iā€™ve had good luck by walking around and hitting all the combinations of values on each physical switch, then shift-reloading Home Assistant and restarting Home Assistant and then pressing the combinations again and repeating those steps over and over and then eventually HA seems to learn all the actions itā€™s supposed to know for that device then Iā€™m running great until the next time I upgrade Home Assistant.

Iā€™m not having any luck with that approach now, though, with HA 2023.11 and 2023.11.1.

Does anyone know if the doubled MQTT logs/messages on the HA side is expected or possibly indicates a problem? Is there any other debugging I can provide that might be helpful?

This seems to be a new problem thatā€™s arisen the past 2 months or so. Iā€™m not really familiar with the MQTT integration in HA, but I do plan to continue digging to see if I can figure it out.

Iā€™m running a standalone Zigbee2MQTT (not the HA Add-on) if thatā€™s relevant.

This may be related to a change in Z2M and HA from last month:

And potentially resolved in the pending-release Z2M 1.33.3.

Iā€™m no longer experiencing this problem since upgrading to Zigbee2MQTT 1.34.0

Iā€™m seeing exactly this issue - actions ā€œdisappearā€ (showing as Unknown trigger in automations). It has happened with one of my Xiaomi Aqara buttons for a while, but has now also affected an Xiaomi light switches (when used ā€˜detachedā€™ with an automation for more advanced actions), and an Ikea button. Itā€™s driving me crazy!

Unfortunately Iā€™m already running Zigbee2MQTT 1.36.0 - so if it is the same issue that was fixed in 1.34.0, itā€™s broken again.

Does anyone have any suggestions on how I can diagnose (and hopefully fix) this? Thanks in advance.

Same issue here: my 2 aqara switches (Mi wireless switch (WXKG01LM)) seem to not have any action. Of course, any associated automation does not work any more as they do not have a trigger any more.
zigbee2mqtt [1.36.0] commit: [86ed71c]

It may be a coincidence, however I feel this issue happens since core update 2024.7.2