This is a blueprint for a Home Assistant automation that triggers a sync of the state of a Zigbee device connected to Zigbee2MQTT. This is useful when you control a zigbee device directly via touchlink and want to keep the state in sync with Home Assistant.
You're using Home Assistant with Zigbee2MQTT and you have a Zigbee device that you control directly via touchlink (e.g. a remote control). E.g. you have an TRETAKT smart plug and a TRADFRI on/off switch. You don't need to create an automation to control the device via Home Assistant, because you can connect the smart plug and the switch via touchlink. This can be extremely useful for devices which supports dimming, because you can dim the device directly via the remote control. The only downside is that the state of the device in Home Assistant is not in sync with the real state of the device. This blueprint solves this problem by triggering a sync of the state of the device in Home Assistant.
Tip
You may not even need this blueprint if you use the Zigbee2MQTT binding feature. You can just bind OnOff
and LevelCtrl
to the coordicator. In the image below you can see a Livarno Lux Ceiling Panel. I control the LED panel with an unsupported rotary switch (S57018 from The Light Group AS) which is directly connected to the LED panel via touchlink. To get the state synced back I only needed to add this binding via Zigbee2MQTT. No automation needed!

This blueprint requires that you're using Zigbee2MQTT. It's not possible to use this blueprint with other Zigbee integrations like ZHA.
Choose trigger actions which should trigger the state sync. Use e.g. a switch with on/off/brightness change actions. The state sync will be triggered when the action is executed.