Aqara wired wall 1-button switch (QBKG04LM, no neutral) decoupled mode

Moderator: leecollings

Post Reply
tarantino
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

Post by tarantino »

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?
azonneveld
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

Post by azonneveld »

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
rpi4 - zigbee2mqtt - roborock - espeasy - rfxcom - homewizard p1 - otgw - homebridge - surveillance station - egardia - goodwe - open weather map - wol - BBQ detection - rsync backup
tarantino
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

Post by tarantino »

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

Post by azonneveld »

tarantino wrote: Sunday 05 April 2020 17:48 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?
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
tarantino
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

Post by tarantino »

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.
azonneveld
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

Post by azonneveld »

tarantino wrote: Monday 06 April 2020 9:38 I modified _init_.py, made my own QBKG04LM.py
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
tarantino
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

Post by tarantino »

azonneveld wrote: Friday 10 April 2020 8:24
tarantino wrote: Monday 06 April 2020 9:38 I modified _init_.py, made my own QBKG04LM.py
Please post your modifications to the github page, so this could be included in the releases: https://github.com/Koenkk/zigbee2mqtt
Already done and new version of plugin supports all switch modes :!:
Post Reply

Who is online

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