Page 1 of 1

Zigbee2MQTT 2.0.0 breaking changes

Posted: Tuesday 10 December 2024 1:02
by Arjan2019
Please read this
Zigbee2MQTT 2.0.0 breaking changes https://github.com/Koenkk/zigbee2mqtt/discussions/24198
It make the click sensors not working any more we are going to need to use action instead.
Koen will release this in the beginning of 2025

Re: Zigbee2MQTT 2.0.0 breaking changes

Posted: Tuesday 10 December 2024 9:07
by Kedi
You could use this kind of "template" to process those actions. I hide action devices, hence the "$"

Code: Select all

-- A somewhat generic script for zigbee action devices like


return {
--  active = true,
    active = false,
    on = {
        devices = {
            '$* action*'
        }
    },
    execute = function(dz, mySensor)
        local aTmp = dz.utils.stringSplit(mySensor.name, '_')
        local nTmp = #aTmp
        dz.log(nTmp, dz.LOG_INFO)
--  These lines are just to log what the is sent by the switch and what could be used for the triggers.
        if nTmp == 2 then
            dz.log('Sensor: '.. dz.utils.stringSplit(aTmp[1], ' ')[1] .. ' -> Action: ' .. aTmp[2], dz.LOG_INFO)
        elseif nTmp == 3 then
            dz.log('Sensor: '.. dz.utils.stringSplit(aTmp[1], ' ')[1] .. ' -> Switch: ' .. aTmp[2] ..
                ' -> Action: ' .. aTmp[3], dz.LOG_INFO)
        elseif nTmp == 4 then
            dz.log('Sensor: '.. dz.utils.stringSplit(aTmp[1], ' ')[1] .. ' -> Switch: ' .. aTmp[2] ..
                ' -> Action: ' .. aTmp[3] .. ' -> Direction: ' .. aTmp[4], dz.LOG_INFO)
        end
--  End of logging.
    end
}


Re: Zigbee2MQTT 2.0.0 breaking changes

Posted: Wednesday 11 December 2024 8:05
by gizmocuz
@Arjan2019, are you able to test this against the latest beta version of Domoticz?
I think it should still work with all the recent changes.

There should of course be no need for a script for each device, if it is not working anymore, we need to adopt for the changes.

I'm on the latest dev branch and have no issues (142)

Re: Zigbee2MQTT 2.0.0 breaking changes

Posted: Wednesday 11 December 2024 9:02
by Arjan2019
I'm running on the last beta and it doesn't work. 16355

This is one of my push switch
Screenshot 2024-12-11 085831.png
Screenshot 2024-12-11 085831.png (253.01 KiB) Viewed 575 times
See last seen.

This is from MQTT explorer:
Screenshot 2024-12-11 090027.png
Screenshot 2024-12-11 090027.png (168.05 KiB) Viewed 575 times
There is no click but device_automation

Re: Zigbee2MQTT 2.0.0 breaking changes

Posted: Wednesday 11 December 2024 9:36
by Arjan2019
This is from an Ikea switch:
I just pressed the button off see topic zigbee2mqtt
Screenshot 2024-12-11 093538.png
Screenshot 2024-12-11 093538.png (206.75 KiB) Viewed 567 times

Re: Zigbee2MQTT 2.0.0 breaking changes

Posted: Wednesday 11 December 2024 10:24
by gizmocuz
I just noticed I did not restart my Domoticz instance and therefor the old configuration was still being used

At the moment the component type 'device_automation' is disabled, you can see this at the top of the MQTTAutoDiscovery.cpp file

One thing I noticed, my 4 gang zigbee switch now only gets 3 actions instead of 4!
(Tuya Wireless switch with 4 buttons (TS0044))

Hope that this is not related to the latest zigbee2mqtt dev branch

Going to debug... probably it's just a matter of enabling this at the top of the file

Re: Zigbee2MQTT 2.0.0 breaking changes

Posted: Wednesday 11 December 2024 11:11
by gizmocuz
Could you try with beta 16356?

I enabled the device_automation and it seems to work. But you will probably get net devices.

On your old device, press Edit, and then select 'Replace' and select the new device.
With this, all id's stay the same including the original (old) name
(If you are using it in scripts/groups/etc)

Re: Zigbee2MQTT 2.0.0 breaking changes

Posted: Wednesday 11 December 2024 12:13
by Arjan2019
Beta 16356 is working fine thanks

Re: Zigbee2MQTT 2.0.0 breaking changes

Posted: Saturday 14 December 2024 8:13
by gizmocuz
Thanks for the feedback!