Greetings fellow Domoticz lovers.
I have just moved to MQTT A.D. from the Zigbee2mqtt plugin and have discovered something that seems to be stopping me fully switch over.
I have 2 Aqara H1 wireless switches (https://www.zigbee2mqtt.io/devices/WRS- ... mi-wrs-r02) that worked with the old plugin but not with the new MQTT autodiscovery.
They expose in Zigbee2mqtt a single "action" field (I am using the "events" operation mode rather than the "command".
With the plugin, this was "discovered" as a single selector switch with the following "levels" ;
0 Off
10 button_1_hold
20 button_1_release
30 button_1_single
40 button_1_double
50 button_1_triple
60 button_2_hold
70 button_2_release
80 button_2_single
90 button_2_double
100 button_2_triple
110 button_3_hold
120 button_3_release
130 button_3_single
140 button_3_double
150 button_3_triple
160 toggle_1
I was able to use this in my scripts as I wanted.
However, with Auto Discovery, the device is "discovered" as a multiple push button devices for each action and also for each switch.
1568 MQTT 0x54ef4410001aec87_action_zigbee2mqtt 239 light switch action_button_1_single Light/Switch Switch Off 1 2022-02-03 18:08:16
1577 MQTT 0x54ef4410001aec87_action_zigbee2mqtt 52 light switch action_button_2_single Light/Switch Switch Off 1 2022-02-03 08:15:39
This in itself isn't a problem as I could modify all my scripts, however, the device only ever is "off" and never changes, even momentarily, to "on" when the switch is pressed.
2022-02-03 17:58:13 Off
2022-02-03 17:58:11 Off
2022-02-03 17:57:28 Off
2022-02-03 17:57:26 Off
2022-02-03 17:57:22 Off
2022-02-03 17:57:20 Off
2022-02-03 17:56:26 Off
2022-02-03 17:56:11 Off
2022-02-03 17:55:35 Off
2022-02-03 17:55:32 Off
2022-02-03 17:55:27 Off
With the old plugin, the momentary status was visible in the logs, for example;
2022-02-03 17:58:13 Off
2022-02-03 17:58:13 button_1_single
2022-02-03 17:58:11 Off
2022-02-03 17:58:11 button_1_single
2022-02-03 17:57:29 Off
2022-02-03 17:57:28 button_1_single
2022-02-03 17:57:26 Off
2022-02-03 17:57:26 button_1_single
I am at a bit of a loss how to proceed to be able to enable the switch state to be available to Domoticz with MQTT auto discovery.
Aqara MQTT auto discovery problem with new stable.
Moderator: leecollings
-
- Posts: 345
- Joined: Thursday 01 November 2018 19:47
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.6
- Location: Portugal
- Contact:
Aqara MQTT auto discovery problem with new stable.
Intel NUC with Ubuntu Server VM (Proxmox),mosquitto(docker),RFXtrx433E,zwavejsUI (docker),Zigbee2mqtt(docker),SMA Hub (docker),Harmony Hub plugin, Kodi plugin,Homebridge(docker)+Google Home,APC UPS,SMA Modbus,Mitsubishi MQTT, Broadlink,Dombus
-
- Posts: 345
- Joined: Thursday 01 November 2018 19:47
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.6
- Location: Portugal
- Contact:
Re: Aqara MQTT auto discovery problem with new stable.
In case anyone else is looking for a solution to this, I managed a work-around by creating a script triggered by the "off" action (which only occurs after an "on" action) that triggers a virtual switch to "on" and then to "off" after a 1 second delay.
Not the most beautiful solution but it works.
Not the most beautiful solution but it works.
Intel NUC with Ubuntu Server VM (Proxmox),mosquitto(docker),RFXtrx433E,zwavejsUI (docker),Zigbee2mqtt(docker),SMA Hub (docker),Harmony Hub plugin, Kodi plugin,Homebridge(docker)+Google Home,APC UPS,SMA Modbus,Mitsubishi MQTT, Broadlink,Dombus
Re: Aqara MQTT auto discovery problem with new stable.
I have the same 'problem' with all my switches who expose actions.
I also have to make selector switches to be activated by all the action devices (and I have a lot of those devices).
Like https://www.zigbee2mqtt.io/devices/E174 ... ikea-e1743
https://www.zigbee2mqtt.io/devices/TS00 ... uya-ts0044
https://www.zigbee2mqtt.io/devices/WXKG ... i-wxkg01lm
https://www.zigbee2mqtt.io/devices/WXKG ... g02lm_rev1
So for production I still did not make the switch, hoping for a selector solution in the (near) future.
I also have to make selector switches to be activated by all the action devices (and I have a lot of those devices).
Like https://www.zigbee2mqtt.io/devices/E174 ... ikea-e1743
https://www.zigbee2mqtt.io/devices/TS00 ... uya-ts0044
https://www.zigbee2mqtt.io/devices/WXKG ... i-wxkg01lm
https://www.zigbee2mqtt.io/devices/WXKG ... g02lm_rev1
So for production I still did not make the switch, hoping for a selector solution in the (near) future.
-
- Posts: 345
- Joined: Thursday 01 November 2018 19:47
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.6
- Location: Portugal
- Contact:
Re: Aqara MQTT auto discovery problem with new stable.
Yeah, that's a lot of work, my 2 way Aqara switches have 32 separate actions. Other than that the upgrade went well and I am happier than I was with the previous implementation which also had issues originally. If I used my Aqara switches in the default "command" mode, on activation they would toggle every single Zigbee device in my house ! The first time it happened I thought I had a truly serious problem !!
The graphing in the new Domoticz is next level and there are lots of little improvements everywhere, backing up the database is much faster, altering floorplans has lost some glitchiness it used to have. MQTT AD is fabulous.
The graphing in the new Domoticz is next level and there are lots of little improvements everywhere, backing up the database is much faster, altering floorplans has lost some glitchiness it used to have. MQTT AD is fabulous.
Intel NUC with Ubuntu Server VM (Proxmox),mosquitto(docker),RFXtrx433E,zwavejsUI (docker),Zigbee2mqtt(docker),SMA Hub (docker),Harmony Hub plugin, Kodi plugin,Homebridge(docker)+Google Home,APC UPS,SMA Modbus,Mitsubishi MQTT, Broadlink,Dombus
-
- Posts: 1
- Joined: Thursday 31 May 2018 9:28
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Aqara MQTT auto discovery problem with new stable.
Hi all,
i've just also migrated from the plugin and having the same issues with the switches, but, i don't know how, managed to solve the problem in some of them. Note that i'm using DzVents for scripting.
1. In the device section i have all the actions of the switch like separated devices:
1 - Device name click
2 - Device name double_click
3 - Device name triple_click
But also have a strange device like this:
4 - Device name - Type: General Subtype: Text ---> And in the data this holds the button last status!.
So, in the Dz Events, the script 'on' clause will be like this:
on = {
devices = {'Device name*'} --note the * in the name, this will trigger with any of the 'devices'
},
And after that, if I check device.status, it has the correct status and not only 'off', that was all I was getting.
Sorry if is confusing, but explainig this without pictures is difficult
More news, I've managed to solve the problem with my aqara switch!
In the script, get the name of the device instead of the status.
So after this:
on = {
devices = {'Device name*'} --note the * in the name, this will trigger with any of the 'devices'
},
in the script, if I check device.name i get the name of the device, this is:
'Device name click' or 'Device name double_click' or 'Device name triple_click' ......
Hope this helps!
Xavi
i've just also migrated from the plugin and having the same issues with the switches, but, i don't know how, managed to solve the problem in some of them. Note that i'm using DzVents for scripting.
1. In the device section i have all the actions of the switch like separated devices:
1 - Device name click
2 - Device name double_click
3 - Device name triple_click
But also have a strange device like this:
4 - Device name - Type: General Subtype: Text ---> And in the data this holds the button last status!.
So, in the Dz Events, the script 'on' clause will be like this:
on = {
devices = {'Device name*'} --note the * in the name, this will trigger with any of the 'devices'
},
And after that, if I check device.status, it has the correct status and not only 'off', that was all I was getting.
Sorry if is confusing, but explainig this without pictures is difficult

More news, I've managed to solve the problem with my aqara switch!
In the script, get the name of the device instead of the status.
So after this:
on = {
devices = {'Device name*'} --note the * in the name, this will trigger with any of the 'devices'
},
in the script, if I check device.name i get the name of the device, this is:
'Device name click' or 'Device name double_click' or 'Device name triple_click' ......
Hope this helps!
Xavi
-
- Posts: 46
- Joined: Tuesday 23 June 2015 23:06
- Target OS: Linux
- Domoticz version: 2023.2
- Location: NL + SE
- Contact:
Re: Aqara MQTT auto discovery problem with new stable.
Found a working solution
I created a dzVents event
I think I can just add similar code-blocks for every momentary switch I want to get processed
I created a dzVents event
Code: Select all
return
{
on = { devices = { 445 } }, -- Idx of correct momentary switch
execute = function(dz)
dz.devices(210).toggleSwitch() -- Idx of switch to todggle
end
}
Domoticz on BPI-M2-Pro (compiled on Ubuntu 22.04) and RPI (binary on Raspian 10)
RFXCom, Sonoff Zigbee stick, eBusd Adapter 5, P1, S0, Husdata H60 integration
Zigbee2MQTT AD, MQTT local, AirconWithMe, Ebusd, VolvoRecharge, PSA Car Controller
RFXCom, Sonoff Zigbee stick, eBusd Adapter 5, P1, S0, Husdata H60 integration
Zigbee2MQTT AD, MQTT local, AirconWithMe, Ebusd, VolvoRecharge, PSA Car Controller
Who is online
Users browsing this forum: No registered users and 1 guest