Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] WXKG06LM - Aqara D1 single key wireless wall switch not reacting in HomeKit #164

Closed
kwolniak opened this issue May 8, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@kwolniak
Copy link

kwolniak commented May 8, 2021

Describe the bug
After pairing device with zigbee2mqtt it is visible in zigbee2mqtt frontend and is exposed to Homebridge and Apple Home app as two button accessory/sensor (it is one button version).

Pressing button is visibe in zigbee2mqtt logs (see logs below) but it is not visible in Home app. Also after pressing button I do not see any related logs in Homebridge. Also button icon in Home app is not shaking. Just nothing happens.

  • It looks like event is not passed from zigbe2mqtt to homebridge/homekit.
  • Ofcourse I assigned actions for single/double/hold events in Apple Home app.
  • I'm not sure, why it is available to homekit as two buttons accessory.

Related devices
Xiaomi WXKG06LM - Aqara D1 single key wireless wall switch
https://www.zigbee2mqtt.io/devices/WXKG06LM.html#xiaomi-wxkg06lm
https://z2m.dev/devices/xiaomi/wxkg06lm.html

To Reproduce

  1. Pair device with zigbee2mqtt
  2. It is automaticaly exposed to homebrige
  3. Change legacy option to false in zigbe2mqtt config (/opt/zigbee2mqtt/data/configuration.yaml) as recomended in docs.
  4. Assign accessory for single/double/hold action in Home App (for both buttons).
  5. Press the button on device

Expected behavior
After pressing button on device I expect assigned lights turn on, but it doesn't.

Light accessory is available and responsive because when I click in Home app "Test this action" lights switch ON, as expected.

MQTT messages

devices:
  '0x00158d00059414a7':
    friendly_name: '0x00158d00059414a7'
    legacy: false

Logs when pairing device:

Info MQTT publish: topic 'zigbee2mqtt/bridge/response/permit_join', payload '{"data":{"time":254,"value":true},"status":"ok","transaction":"4sdpx-6"}'
Info Device '0x00158d00059414a7' joined
Info MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0x00158d00059414a7","ieee_address":"0x00158d00059414a7"},"type":"device_joined"}'
Info Starting interview of '0x00158d00059414a7'
Info MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0x00158d00059414a7","ieee_address":"0x00158d00059414a7","status":"started"},"type":"device_interview"}'
Info MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":{"friendly_name":"0x00158d00059414a7"},"type":"device_connected"}'
Info MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"interview_started","meta":{"friendly_name":"0x00158d00059414a7"},"type":"pairing"}'
Info Successfully interviewed '0x00158d00059414a7', device has successfully been paired
Info Device '0x00158d00059414a7' is supported, identified as: Xiaomi Aqara D1 single key wireless wall switch (WXKG06LM)
Info MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"definition":{"description":"Aqara D1 single key wireless wall switch","exposes":[{"access":1,"description":"Remaining battery in %","name":"battery","property":"battery","type":"numeric","unit":"%","value_max":100,"value_min":0},{"access":1,"description":"Triggered action (e.g. a button click)","name":"action","property":"action","type":"enum","values":["single_left","single_right","double_left","double_right","hold_left","hold_right"]},{"access":1,"description":"Voltage of the battery in millivolts","name":"voltage","property":"voltage","type":"numeric","unit":"mV"},{"access":1,"description":"Link quality (signal strength)","name":"linkquality","property":"linkquality","type":"numeric","unit":"lqi","value_max":255,"value_min":0}],"model":"WXKG06LM","supports_ota":false,"vendor":"Xiaomi"},"friendly_name":"0x00158d00059414a7","ieee_address":"0x00158d00059414a7","status":"successful","supported":true},"type":"device_interview"}'
Info Configuring '0x00158d00059414a7'
Info MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"interview_successful","meta":{"description":"Aqara D1 single key wireless wall switch","friendly_name":"0x00158d00059414a7","model":"WXKG06LM","supported":true,"vendor":"Xiaomi"},"type":"pairing"}'
Info Successfully configured '0x00158d00059414a7'

Logs when pressing button:

Info MQTT publish: topic 'zigbee2mqtt/0x00158d00059414a7', payload '{"action":"single","linkquality":41}'
Info MQTT publish: topic 'zigbee2mqtt/0x00158d00059414a7', payload '{"action":"single","linkquality":41}'
Info MQTT publish: topic 'zigbee2mqtt/0x00158d00059414a7', payload '{"action":"hold","linkquality":41}'

Homebridge logs:

[zigbee2mqtt] New accessory: 0x00158d00059414a7
[zigbee2mqtt] Mapping of property 'action' of device '0x00158d00059414a7':
Button 1 (left):
        - SINGLE: single_left
        - DOUBLE: double_left
        - LONG  : hold_left
Button 2 (right):
        - SINGLE: single_right
        - DOUBLE: double_right
        - LONG  : hold_right

Versions used

  • Node.js v14.16.0
  • NPM v7.11.2
  • Zigbee2MQTT version 1.18.2 commit: abd8a092
  • Coordinator type: ConBee2
  • Coordinator revision: 0x266b0700
  • Homebridge v1.3.4
  • Homebridge Config UI X v4.41.1
  • homebridge-z2m v1.1.3

Screenshots
image
image
image
image
image
image

@kwolniak kwolniak added the bug Something isn't working label May 8, 2021
@itavero
Copy link
Owner

itavero commented May 8, 2021

Can you also share the MQTT message that Zigbee2MQTT puts on the zigbee2mqtt/bridge/devices topic?
It seems as if Zigbee2MQTT sends the wrong exposes data.

@kwolniak
Copy link
Author

kwolniak commented May 8, 2021

@itavero entry from zigbee2mqtt/bridge/devices

{
    "date_code": "20190329",
    "definition": {
      "description": "Aqara D1 single key wireless wall switch",
      "exposes": [
        {
          "access": 1,
          "description": "Remaining battery in %",
          "name": "battery",
          "property": "battery",
          "type": "numeric",
          "unit": "%",
          "value_max": 100,
          "value_min": 0
        },
        {
          "access": 1,
          "description": "Triggered action (e.g. a button click)",
          "name": "action",
          "property": "action",
          "type": "enum",
          "values": [
            "single_left",
            "single_right",
            "double_left",
            "double_right",
            "hold_left",
            "hold_right"
          ]
        },
        {
          "access": 1,
          "description": "Voltage of the battery in millivolts",
          "name": "voltage",
          "property": "voltage",
          "type": "numeric",
          "unit": "mV"
        },
        {
          "access": 1,
          "description": "Link quality (signal strength)",
          "name": "linkquality",
          "property": "linkquality",
          "type": "numeric",
          "unit": "lqi",
          "value_max": 255,
          "value_min": 0
        }
      ],
      "model": "WXKG06LM",
      "supports_ota": false,
      "vendor": "Xiaomi"
    },
    "endpoints": {
      "1": {
        "bindings": [],
        "clusters": {
          "input": [
            "genBasic",
            "genIdentify",
            "genOta",
            "genMultistateInput"
          ],
          "output": [
            "genBasic",
            "genGroups",
            "genIdentify",
            "genScenes",
            "genOta",
            "genMultistateInput"
          ]
        },
        "configured_reportings": []
      },
      "2": {
        "bindings": [
          {
            "cluster": "genOnOff",
            "target": {
              "endpoint": 1,
              "ieee_address": "0x00212effff073696",
              "type": "endpoint"
            }
          },
          {
            "cluster": "genPowerCfg",
            "target": {
              "endpoint": 1,
              "ieee_address": "0x00212effff073696",
              "type": "endpoint"
            }
          }
        ],
        "clusters": {
          "input": [
            "genIdentify",
            "genMultistateInput"
          ],
          "output": [
            "genGroups",
            "genIdentify",
            "genScenes",
            "genMultistateInput"
          ]
        },
        "configured_reportings": []
      },
      "3": {
        "bindings": [],
        "clusters": {
          "input": [
            "genIdentify",
            "genAnalogInput"
          ],
          "output": [
            "genGroups",
            "genIdentify",
            "genScenes",
            "genAnalogInput"
          ]
        },
        "configured_reportings": []
      }
    },
    "friendly_name": "0x00158d00059414a7",
    "ieee_address": "0x00158d00059414a7",
    "interview_completed": true,
    "interviewing": false,
    "model_id": "lumi.remote.b186acn02",
    "network_address": 48490,
    "power_source": "Battery",
    "software_build_id": "3000-0001",
    "supported": true,
    "type": "EndDevice"
  }

@itavero
Copy link
Owner

itavero commented May 8, 2021

It seems that the information provided from Zigbee2MQTT is incorrect:

        {
          "access": 1,
          "description": "Triggered action (e.g. a button click)",
          "name": "action",
          "property": "action",
          "type": "enum",
          "values": [
            "single_left",
            "single_right",
            "double_left",
            "double_right",
            "hold_left",
            "hold_right"
          ]
        }

This should probably be fixed in Koenkk/zigbee-herdsman-converters (the component used by Zigbee2MQTT).

@itavero
Copy link
Owner

itavero commented May 8, 2021

Just noticed your on Zigbee2MQTT 1.18.2, but version 1.18.3 is also out now.

Looking at the release notes of 1.18.3, your problem seems to be fixed in Koenkk/zigbee-herdsman-converters#2472

Closing this issue. Feel free to reopen it, if the problem persists after the update.

@itavero itavero closed this as completed May 8, 2021
@kwolniak
Copy link
Author

kwolniak commented May 8, 2021

After update works like a charm! Thank you so much :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants