I have been using zigbee2mqtt integration with home assistant. After creating some automations with tradfri 5 button remote to control music (simple play/pause/next track), I noticed that upon restart (docker-compose restart/host os restart), in frontend ui, the trigger becomes unknown:
This also causes problem, and a bigger problem, when I use tradfri on/off buttons and expose them to homekit with the guide here
Device Triggers
Devices that support triggers can be added to the bridge by accessing options for the bridge in Settings >> Devices & Services. To use this feature, Advanced Mode must be enabled in your user profile.
Bridged device triggers are represented as a single press button on stateless programmable switches. This allows a HomeKit automation to run when a device trigger fires. Because the Apple Home app currently only shows the number of the button and not the name, users may find it easier to identify the name of the button in the Eve for HomeKit app.
In this case, only triggers that are ‘pressed’ after restart of home assistant, will appear in homekit (in this case, eve, as recommended by the guide above)
upon a further restart, the triggers will be reset again, only leaving Update, No_Update and Battery_Level in both frontend and homekit/eve
This causes all settings done at homekit side to be lost/corrupted.
Eg
Original behaviour: press on > turn on light scene
After restart, on is no longer a button in homekit. the same scene (turn on light) is rebound to Update, causing it to trigger whenever home assistant is restarted (settings > restart)
Expected behaviour
Across restarts (docker-compose restart/host os restart), the triggers for button presses (on/off) will persist, and not show as Unknown trigger. Also, the triggers/buttons in homekit should also persist.
managed to create intermediary triggers that is controlled by mqtt devices and exposed as binary sensors for home assistant. since the sensors are configured in configuration.yml template, they are persistent even if the actual mqtt devices are unavailable on restart:
Well i’m having the same problems as you on ikea buttons connected to HA via z2m for a few months now, i’m gonna give your solution a go, but this is surely annoying.
I have the same issue with a totally different button.
I’m using the Onvis HS2 Thread button via the HomeKit integration, and it works fine for a bit and then the same thing happens, the triggers disappear even though the log still shows the button presses coming through
I’ve already re-added it a couple of times now, and tried using a blueprint I found for it on these forums and it ended up doing the same thing after a little while…
Thank you so much for this. I started getting unknown trigger issues after about a year of stable z2m use and this solved it for me. Simple and easy to convert existing automations.
I solved this issue by disabling the “Home Assistent legacy triggers” option in the Home Assistant integration settings (in Zigbee2MQTT).
This repopulated the Triggers in Home Assistent, after I manually performed the various actions on the physical switch (click each button, hold each button, double click each button). You can see the registered triggers for a device in Home Assistent under the “MQTT INFO” button.