Aqara wired wall 1-button switch (QBKG04LM, no neutral) decoupled mode
Moderator: leecollings
-
- Posts: 4
- Joined: Sunday 05 April 2020 14:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Aqara wired wall 1-button switch (QBKG04LM, no neutral) decoupled mode
I'm using RPi with cc2531 and cann't add this switch to Domoticz correctly. Found the way to enable decoupled mode through json commands and MQTT Explorer now shows "release" and "hold" states, but in Domoticz I only can turn on and off it as a relay, but so far didn't find the way to use it as wireless switch. Is there anyone who uses this switch in wireless mode with domoticz?
-
- Posts: 160
- Joined: Wednesday 02 October 2019 7:37
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands
- Contact:
Re: Aqara wired wall 1-button switch (QBKG04LM, no neutral) decoupled mode
I use the agara switch.
To switch lights or something, I used a devicebased script.
commandArray = {}
for deviceName,deviceValue in pairs(devicechanged) do
if (deviceName=='AgaraSwitch') then
if deviceValue == "On" then
commandArray[#commandArray + 1] = {['LivingRoomLights'] = "On"}
elseif deviceValue == "Off" then
commandArray[#commandArray + 1] = {['LivingRoomLights'] = "Off"}
end
end
end
return commandArray
To switch lights or something, I used a devicebased script.
commandArray = {}
for deviceName,deviceValue in pairs(devicechanged) do
if (deviceName=='AgaraSwitch') then
if deviceValue == "On" then
commandArray[#commandArray + 1] = {['LivingRoomLights'] = "On"}
elseif deviceValue == "Off" then
commandArray[#commandArray + 1] = {['LivingRoomLights'] = "Off"}
end
end
end
return commandArray
rpi4 - zigbee2mqtt - roborock - espeasy - rfxcom - homewizard p1 - otgw - homebridge - surveillance station - egardia - goodwe - open weather map - wol - BBQ detection - rsync backup
-
- Posts: 4
- Joined: Sunday 05 April 2020 14:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Aqara wired wall 1-button switch (QBKG04LM, no neutral) decoupled mode
This way it's working as is, but this is for hardware (wired) part, isn't it? I mean how to us it in wireless mode, when it returns "release" and "hold" states?azonneveld wrote: ↑Sunday 05 April 2020 16:59 commandArray = {}
for deviceName,deviceValue in pairs(devicechanged) do
if (deviceName=='AgaraSwitch') then
if deviceValue == "On" then
commandArray[#commandArray + 1] = {['LivingRoomLights'] = "On"}
elseif deviceValue == "Off" then
commandArray[#commandArray + 1] = {['LivingRoomLights'] = "Off"}
end
end
end
return commandArray
-
- Posts: 160
- Joined: Wednesday 02 October 2019 7:37
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands
- Contact:
Re: Aqara wired wall 1-button switch (QBKG04LM, no neutral) decoupled mode
Ah, I misunderstood, I have the wireless (battery operated) version of the switch.
rpi4 - zigbee2mqtt - roborock - espeasy - rfxcom - homewizard p1 - otgw - homebridge - surveillance station - egardia - goodwe - open weather map - wol - BBQ detection - rsync backup
-
- Posts: 4
- Joined: Sunday 05 April 2020 14:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Aqara wired wall 1-button switch (QBKG04LM, no neutral) decoupled mode
I found the reason of the problem - there is an error in zigbee2mqtt plugin. It has no separate QBKG04LM.py and using it just as a simple switch, without decoupled and wireless modes. I modified _init_.py, made my own QBKG04LM.py and got my wireless mode clicks in Domoticz! Now I think I have to move this question to zigbee2mqtt plugin discussion.
-
- Posts: 160
- Joined: Wednesday 02 October 2019 7:37
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: Netherlands
- Contact:
Re: Aqara wired wall 1-button switch (QBKG04LM, no neutral) decoupled mode
Please post your modifications to the github page, so this could be included in the releases: https://github.com/Koenkk/zigbee2mqtt
rpi4 - zigbee2mqtt - roborock - espeasy - rfxcom - homewizard p1 - otgw - homebridge - surveillance station - egardia - goodwe - open weather map - wol - BBQ detection - rsync backup
-
- Posts: 4
- Joined: Sunday 05 April 2020 14:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Aqara wired wall 1-button switch (QBKG04LM, no neutral) decoupled mode
Already done and new version of plugin supports all switch modesazonneveld wrote: ↑Friday 10 April 2020 8:24Please post your modifications to the github page, so this could be included in the releases: https://github.com/Koenkk/zigbee2mqtt

Who is online
Users browsing this forum: Google [Bot] and 1 guest