Zigbee2MQTT 2.0.0 breaking changes

Please use template to report bugs and problems. Post here your questions when not sure where else to post
Only for bugs in the Domoticz application! other problems go in different subforums!

Moderators: leecollings, remb0

Forum rules
Before posting here, make sure you are on the latest Beta or Stable version.
If you have problems related to the web gui, clear your browser cache + appcache first.

Use the following template when posting here:

Version: xxxx
Platform: xxxx
Plugin/Hardware: xxxx
Description:
.....

If you are having problems with scripts/blockly, always post the script (in a spoiler or code tag) or screenshots of your blockly

If you are replying, please do not quote images/code from the first post

Please mark your topic as Solved when the problem is solved.
Post Reply
Arjan2019
Posts: 8
Joined: Tuesday 16 July 2019 12:47
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Zigbee2MQTT 2.0.0 breaking changes

Post 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
Kedi
Posts: 536
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: Zigbee2MQTT 2.0.0 breaking changes

Post 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
}

Logic will get you from A to B. Imagination will take you everywhere.
User avatar
gizmocuz
Posts: 2350
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Zigbee2MQTT 2.0.0 breaking changes

Post 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)
Quality outlives Quantity!
Arjan2019
Posts: 8
Joined: Tuesday 16 July 2019 12:47
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Zigbee2MQTT 2.0.0 breaking changes

Post 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 172 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 172 times
There is no click but device_automation
Arjan2019
Posts: 8
Joined: Tuesday 16 July 2019 12:47
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Zigbee2MQTT 2.0.0 breaking changes

Post 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 164 times
User avatar
gizmocuz
Posts: 2350
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Zigbee2MQTT 2.0.0 breaking changes

Post 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
Quality outlives Quantity!
User avatar
gizmocuz
Posts: 2350
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Zigbee2MQTT 2.0.0 breaking changes

Post 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)
Quality outlives Quantity!
Arjan2019
Posts: 8
Joined: Tuesday 16 July 2019 12:47
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Zigbee2MQTT 2.0.0 breaking changes

Post by Arjan2019 »

Beta 16356 is working fine thanks
User avatar
gizmocuz
Posts: 2350
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Zigbee2MQTT 2.0.0 breaking changes

Post by gizmocuz »

Thanks for the feedback!
Quality outlives Quantity!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest