arachnetech / homebridge-mqttthing

A plugin for Homebridge allowing the integration of many different accessory types using MQTT.
Apache License 2.0
466 stars 104 forks source link

Aqara double wall switch configuration Help #291

Open Rjayone opened 4 years ago

Rjayone commented 4 years ago

Hi everyone, I spend much time trying to configure Aqara Double wall switch. Now i have left button as switch for my light that works well, but i can't configure the right button as statelessProgrammableSwitch. When i click the right button then nothing happens. Log:

[6/28/2020, 12:59:53] [Aqara Double Wall Switch] Received MQTT: zigbee2mqtt/0x00158d000424493a = {"state_left":"ON","linkquality":10,"state_right":"OFF","operation_mode_right":"control_right_relay"}
[6/28/2020, 12:59:53] [Aqara Double Wall Switch] Received MQTT: zigbee2mqtt/0x00158d000424493a = {"state_left":"ON","linkquality":31,"state_right":"OFF","operation_mode_right":"control_right_relay","click":"right","button_right":"release"}

And the configuration:

{ "type": "switch", "name": "Aqara Switch", "accessory": "mqttthing", "topics": { "getOn": { "topic": "zigbee2mqtt/0x00158d000424493a", "apply": "return JSON.parse(message).state_left === 'ON' ? true : false;" }, "setOn": { "topic": "zigbee2mqtt/0x00158d000424493a/left/set", "apply": "return JSON.stringify({state_left: (message ? \"ON\" : \"OFF\")});" }, "getOnline": { "topic": "zigbee2mqtt/0x00158d000424493a", "apply": "return JSON.parse(message).state_left === 'ON' ? true : false;" } } }, { "accessory": "mqttthing", "logMqtt": true, "type": "statelessProgrammableSwitch", "name": "Aqara Double Wall Switch", "topics": { "getSwitch": { "topic": "zigbee2mqtt/0x00158d000424493a", "apply": "return JSON.parse(message).click === 'right' ? 1 : 2;" } }, "switchValues": [ "single", "double", "long" ] },

korgoth commented 3 years ago

I would also like to have this figured out. Does anyone have any idea on how to configure the double wall switches?