Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
11.31k stars 1.62k forks source link

Broken support of Aqara Smart Knob Switch H1 (ZNXNKG02LM) #19995

Open JulyIghor opened 6 months ago

JulyIghor commented 6 months ago

What happened?

While Aqara Smart Knob Switch H1 is officially supported by zigbee2mqtt, incorrect data sent to MQTT. There are null values often, looks like they are duplicated nulled values. Also the action field disappears while holding+rotating. Press, Double, Hold, Release button events are working as expected.

Also because of nulled values it isn't displaying actual values in HomeAssistant, but they are blinking while rotating the controller.

image

What did you expect to happen?

I expect the action value to be set to something like "rotation_holding", but not disappearing. Also I expect no null values with action="" to be received.

How to reproduce it (minimal and precise)

  1. Run zigbee2mqtt + mqtt in a Docker container.
  2. Pair Aqara Smart Knob Switch H1
  3. Read MQTT raw logs.

Zigbee2MQTT version

1.34.0

Adapter firmware version

7.3.1.0

Adapter

SONOFF Zigbee 3.0 USB Dongle Plus-E Gateway

Debug log

Here is MQTT log:

Hold + Rotation

{"action_rotation_angle":24,"action_rotation_angle_speed":24,"action_rotation_percent":6.666666507720947,"action_rotation_percent_speed":6.666666507720947,"action_rotation_time":200,"battery":100,"device_temperature":25,"linkquality":216,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3120}
{"action_rotation_angle":60,"action_rotation_angle_speed":36,"action_rotation_percent":16.66666603088379,"action_rotation_percent_speed":10,"action_rotation_time":700,"battery":100,"device_temperature":25,"linkquality":208,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3120}
{"action_rotation_angle":-24,"action_rotation_angle_speed":-84,"action_rotation_percent":-6.666666507720947,"action_rotation_percent_speed":-23.33333396911621,"action_rotation_time":1200,"battery":100,"device_temperature":25,"linkquality":236,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3120}
{"action_rotation_angle":60,"action_rotation_angle_speed":84,"action_rotation_percent":16.66666603088379,"action_rotation_percent_speed":23.33333396911621,"action_rotation_time":1700,"battery":100,"device_temperature":25,"linkquality":204,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3120}
{"action_rotation_angle":-12,"action_rotation_angle_speed":-72,"action_rotation_percent":-3.3333332538604736,"action_rotation_percent_speed":-20,"action_rotation_time":2130,"battery":100,"device_temperature":25,"linkquality":236,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3120}
{"action_rotation_angle":-12,"action_rotation_angle_speed":0,"action_rotation_percent":-3.3333332538604736,"action_rotation_percent_speed":0,"action_rotation_time":2130,"battery":100,"device_temperature":25,"linkquality":236,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3120}

Rotation

{"action":"start_rotating","action_rotation_angle":48,"action_rotation_angle_speed":48,"action_rotation_percent":13.333333015441895,"action_rotation_percent_speed":13.333333015441895,"action_rotation_time":200,"battery":100,"device_temperature":25,"linkquality":216,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3120}
{"action":"","action_rotation_angle":null,"action_rotation_angle_speed":null,"action_rotation_percent":null,"action_rotation_percent_speed":null,"action_rotation_time":null,"battery":100,"device_temperature":25,"linkquality":216,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3120}
{"action":"rotation","action_rotation_angle":-24,"action_rotation_angle_speed":-72,"action_rotation_percent":-6.666666507720947,"action_rotation_percent_speed":-20,"action_rotation_time":700,"battery":100,"device_temperature":25,"linkquality":244,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3120}
{"action":"","action_rotation_angle":null,"action_rotation_angle_speed":null,"action_rotation_percent":null,"action_rotation_percent_speed":null,"action_rotation_time":null,"battery":100,"device_temperature":25,"linkquality":244,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3120}
{"action":"stop_rotating","action_rotation_angle":-24,"action_rotation_angle_speed":0,"action_rotation_percent":-6.666666507720947,"action_rotation_percent_speed":0,"action_rotation_time":700,"battery":100,"device_temperature":25,"linkquality":240,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3120}
{"action":"","action_rotation_angle":null,"action_rotation_angle_speed":null,"action_rotation_percent":null,"action_rotation_percent_speed":null,"action_rotation_time":null,"battery":100,"device_temperature":25,"linkquality":240,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3120}
{"action_rotation_angle":24,"action_rotation_angle_speed":24,"action_rotation_percent":6.666666507720947,"action_rotation_percent_speed":6.666666507720947,"action_rotation_time":200,"battery":100,"device_temperature":25,"linkquality":232,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3120}
{"action_rotation_angle":-12,"action_rotation_angle_speed":-36,"action_rotation_percent":-3.3333332538604736,"action_rotation_percent_speed":-10,"action_rotation_time":700,"battery":100,"device_temperature":25,"linkquality":240,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3120}
{"action_rotation_angle":24,"action_rotation_angle_speed":36,"action_rotation_percent":6.666666507720947,"action_rotation_percent_speed":10,"action_rotation_time":1200,"battery":100,"device_temperature":25,"linkquality":232,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3120}
{"action_rotation_angle":24,"action_rotation_angle_speed":0,"action_rotation_percent":6.666666507720947,"action_rotation_percent_speed":0,"action_rotation_time":1410,"battery":100,"device_temperature":25,"linkquality":232,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3120}
{"action":"single","action_rotation_angle":null,"action_rotation_angle_speed":null,"action_rotation_percent":null,"action_rotation_percent_speed":null,"action_rotation_time":null,"battery":100,"device_temperature":25,"linkquality":236,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3120}
{"action":"","action_rotation_angle":null,"action_rotation_angle_speed":null,"action_rotation_percent":null,"action_rotation_percent_speed":null,"action_rotation_time":null,"battery":100,"device_temperature":25,"linkquality":236,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3120}
{"action":"hold","action_rotation_angle":null,"action_rotation_angle_speed":null,"action_rotation_percent":null,"action_rotation_percent_speed":null,"action_rotation_time":null,"battery":100,"device_temperature":25,"linkquality":236,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3120}
{"action":"","action_rotation_angle":null,"action_rotation_angle_speed":null,"action_rotation_percent":null,"action_rotation_percent_speed":null,"action_rotation_time":null,"battery":100,"device_temperature":25,"linkquality":236,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3120}
{"action":"release","action_rotation_angle":null,"action_rotation_angle_speed":null,"action_rotation_percent":null,"action_rotation_percent_speed":null,"action_rotation_time":null,"battery":100,"device_temperature":25,"linkquality":240,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3120}
{"action":"","action_rotation_angle":null,"action_rotation_angle_speed":null,"action_rotation_percent":null,"action_rotation_percent_speed":null,"action_rotation_time":null,"battery":100,"device_temperature":25,"linkquality":240,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3120}
{"action":"double","action_rotation_angle":null,"action_rotation_angle_speed":null,"action_rotation_percent":null,"action_rotation_percent_speed":null,"action_rotation_time":null,"battery":100,"device_temperature":25,"linkquality":236,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3120}
{"action":"","action_rotation_angle":null,"action_rotation_angle_speed":null,"action_rotation_percent":null,"action_rotation_percent_speed":null,"action_rotation_time":null,"battery":100,"device_temperature":25,"linkquality":236,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3120}
{"action":"start_rotating","action_rotation_angle":-72,"action_rotation_angle_speed":-72,"action_rotation_percent":-20,"action_rotation_percent_speed":-20,"action_rotation_time":200,"battery":100,"device_temperature":25,"linkquality":248,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3120}
{"action":"","action_rotation_angle":null,"action_rotation_angle_speed":null,"action_rotation_percent":null,"action_rotation_percent_speed":null,"action_rotation_time":null,"battery":100,"device_temperature":25,"linkquality":248,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3120}
{"action":"rotation","action_rotation_angle":-84,"action_rotation_angle_speed":-12,"action_rotation_percent":-23.33333396911621,"action_rotation_percent_speed":-3.3333332538604736,"action_rotation_time":700,"battery":100,"device_temperature":25,"linkquality":248,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3120}
{"action":"","action_rotation_angle":null,"action_rotation_angle_speed":null,"action_rotation_percent":null,"action_rotation_percent_speed":null,"action_rotation_time":null,"battery":100,"device_temperature":25,"linkquality":248,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3120}
{"action":"stop_rotating","action_rotation_angle":-84,"action_rotation_angle_speed":0,"action_rotation_percent":-23.33333396911621,"action_rotation_percent_speed":0,"action_rotation_time":700,"battery":100,"device_temperature":25,"linkquality":248,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3120}
{"action":"","action_rotation_angle":null,"action_rotation_angle_speed":null,"action_rotation_percent":null,"action_rotation_percent_speed":null,"action_rotation_time":null,"battery":100,"device_temperature":25,"linkquality":248,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3120}

Suspicious log of zigbee2mqtt:

Debug 2023-12-02 18:50:39 Received Zigbee message from 'Dimmer', type 'attributeReport', cluster 'aqaraOpple', data '{"556":200,"558":-36,"560":-36,"561":200,"562":-10,"563":-10,"568":12,"570":1}' from endpoint 71 with groupID 0
Debug 2023-12-02 18:50:39 ZNXNKG02LM: unknown key 556 with value 200
Debug 2023-12-02 18:50:39 ZNXNKG02LM: unknown key 558 with value -36
Debug 2023-12-02 18:50:39 ZNXNKG02LM: unknown key 560 with value -36
Debug 2023-12-02 18:50:39 ZNXNKG02LM: unknown key 561 with value 200
Debug 2023-12-02 18:50:39 ZNXNKG02LM: unknown key 562 with value -10
Debug 2023-12-02 18:50:39 ZNXNKG02LM: unknown key 563 with value -10
Debug 2023-12-02 18:50:39 ZNXNKG02LM: unknown key 568 with value 12
Debug 2023-12-02 18:50:39 ZNXNKG02LM: unknown key 570 with value 1
Debug 2023-12-02 18:50:39 ZNXNKG02LM: Processed data into payload {}
Koenkk commented 6 months ago

See https://www.zigbee2mqtt.io/guide/faq/#why-is-the-action-property-always-empty

JulyIghor commented 6 months ago

See https://www.zigbee2mqtt.io/guide/faq/#why-is-the-action-property-always-empty

Thanks, but what if the action field does not exist while getting events of hold+rotate? Is it safe to detect hold+rotate by testing the field existence?

Koenkk commented 6 months ago

Could you provide the debug log on hold+rotate?

See https://www.zigbee2mqtt.io/guide/usage/debug.html on how to enable debug logging.

JulyIghor commented 6 months ago

Could you provide the debug log on hold+rotate?

Info 2023-12-03 13:03:24MQTT publish: topic 'zigbee2mqtt/Dimmer', payload '{"action":"hold","action_rotation_angle":null,"action_rotation_angle_speed":null,"action_rotation_percent":null,"action_rotation_percent_speed":null,"action_rotation_time":null,"battery":100,"device_temperature":25,"linkquality":244,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3141}'
Info 2023-12-03 13:03:24MQTT publish: topic 'zigbee2mqtt/Dimmer', payload '{"action":"","action_rotation_angle":null,"action_rotation_angle_speed":null,"action_rotation_percent":null,"action_rotation_percent_speed":null,"action_rotation_time":null,"battery":100,"device_temperature":25,"linkquality":244,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3141}'
Info 2023-12-03 13:03:24MQTT publish: topic 'zigbee2mqtt/Dimmer/action', payload 'hold'
Debug 2023-12-03 13:03:24Received Zigbee message from 'Dimmer', type 'attributeReport', cluster 'genMultistateInput', data '{"presentValue":255}' from endpoint 1 with groupID 0
Info 2023-12-03 13:03:24MQTT publish: topic 'zigbee2mqtt/Dimmer', payload '{"action":"release","action_rotation_angle":null,"action_rotation_angle_speed":null,"action_rotation_percent":null,"action_rotation_percent_speed":null,"action_rotation_time":null,"battery":100,"device_temperature":25,"linkquality":244,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3141}'
Info 2023-12-03 13:03:24MQTT publish: topic 'zigbee2mqtt/Dimmer', payload '{"action":"","action_rotation_angle":null,"action_rotation_angle_speed":null,"action_rotation_percent":null,"action_rotation_percent_speed":null,"action_rotation_time":null,"battery":100,"device_temperature":25,"linkquality":244,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3141}'
Info 2023-12-03 13:03:24MQTT publish: topic 'zigbee2mqtt/Dimmer/action', payload 'release'
Debug 2023-12-03 13:03:25Received Zigbee message from 'Dimmer', type 'attributeReport', cluster 'aqaraOpple', data '{"556":200,"558":-60,"560":-60,"561":200,"562":-16.66666603088379,"563":-16.66666603088379,"568":12,"570":129}' from endpoint 72 with groupID 0
Debug 2023-12-03 13:03:25ZNXNKG02LM: unknown key 556 with value 200
Debug 2023-12-03 13:03:25ZNXNKG02LM: unknown key 558 with value -60
Debug 2023-12-03 13:03:25ZNXNKG02LM: unknown key 560 with value -60
Debug 2023-12-03 13:03:25ZNXNKG02LM: unknown key 561 with value 200
Debug 2023-12-03 13:03:25ZNXNKG02LM: unknown key 562 with value -16.66666603088379
Debug 2023-12-03 13:03:25ZNXNKG02LM: unknown key 563 with value -16.66666603088379
Debug 2023-12-03 13:03:25ZNXNKG02LM: unknown key 568 with value 12
Debug 2023-12-03 13:03:25ZNXNKG02LM: unknown key 570 with value 129
Debug 2023-12-03 13:03:25ZNXNKG02LM: Processed data into payload {}
Info 2023-12-03 13:03:25MQTT publish: topic 'zigbee2mqtt/Dimmer', payload '{"action_rotation_angle":-60,"action_rotation_angle_speed":-60,"action_rotation_percent":-16.66666603088379,"action_rotation_percent_speed":-16.66666603088379,"action_rotation_time":200,"battery":100,"device_temperature":25,"linkquality":244,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3141}'
Debug 2023-12-03 13:03:25Received Zigbee message from 'Dimmer', type 'attributeReport', cluster 'aqaraOpple', data '{"556":500,"558":-156,"560":-96,"561":700,"562":-26.66666603088379,"563":-43.33333206176758,"568":12,"570":130}' from endpoint 72 with groupID 0
Debug 2023-12-03 13:03:25ZNXNKG02LM: unknown key 556 with value 500
Debug 2023-12-03 13:03:25ZNXNKG02LM: unknown key 558 with value -156
Debug 2023-12-03 13:03:25ZNXNKG02LM: unknown key 560 with value -96
Debug 2023-12-03 13:03:25ZNXNKG02LM: unknown key 561 with value 700
Debug 2023-12-03 13:03:25ZNXNKG02LM: unknown key 562 with value -26.66666603088379
Debug 2023-12-03 13:03:25ZNXNKG02LM: unknown key 563 with value -43.33333206176758
Debug 2023-12-03 13:03:25ZNXNKG02LM: unknown key 568 with value 12
Debug 2023-12-03 13:03:25ZNXNKG02LM: unknown key 570 with value 130
Debug 2023-12-03 13:03:25ZNXNKG02LM: Processed data into payload {}
Info 2023-12-03 13:03:25MQTT publish: topic 'zigbee2mqtt/Dimmer', payload '{"action_rotation_angle":-156,"action_rotation_angle_speed":-96,"action_rotation_percent":-43.33333206176758,"action_rotation_percent_speed":-26.66666603088379,"action_rotation_time":700,"battery":100,"device_temperature":25,"linkquality":248,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3141}'
Debug 2023-12-03 13:03:26Received Zigbee message from 'Dimmer', type 'attributeReport', cluster 'aqaraOpple', data '{"556":500,"558":-156,"560":0,"561":700,"562":0,"563":-43.33333206176758,"568":12,"570":131}' from endpoint 72 with groupID 0
Debug 2023-12-03 13:03:26ZNXNKG02LM: unknown key 556 with value 500
Debug 2023-12-03 13:03:26ZNXNKG02LM: unknown key 558 with value -156
Debug 2023-12-03 13:03:26ZNXNKG02LM: unknown key 560 with value 0
Debug 2023-12-03 13:03:26ZNXNKG02LM: unknown key 561 with value 700
Debug 2023-12-03 13:03:26ZNXNKG02LM: unknown key 562 with value 0
Debug 2023-12-03 13:03:26ZNXNKG02LM: unknown key 563 with value -43.33333206176758
Debug 2023-12-03 13:03:26ZNXNKG02LM: unknown key 568 with value 12
Debug 2023-12-03 13:03:26ZNXNKG02LM: unknown key 570 with value 131
Debug 2023-12-03 13:03:26ZNXNKG02LM: Processed data into payload {}
Info 2023-12-03 13:03:26MQTT publish: topic 'zigbee2mqtt/Dimmer', payload '{"action_rotation_angle":-156,"action_rotation_angle_speed":0,"action_rotation_percent":-43.33333206176758,"action_rotation_percent_speed":0,"action_rotation_time":700,"battery":100,"device_temperature":25,"linkquality":232,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3141}'
Debug 2023-12-03 13:03:29Received Zigbee message from 'Dimmer', type 'attributeReport', cluster 'aqaraOpple', data '{"556":200,"558":72,"560":72,"561":200,"562":20,"563":20,"568":12,"570":129}' from endpoint 72 with groupID 0
Debug 2023-12-03 13:03:29ZNXNKG02LM: unknown key 556 with value 200
Debug 2023-12-03 13:03:29ZNXNKG02LM: unknown key 558 with value 72
Debug 2023-12-03 13:03:29ZNXNKG02LM: unknown key 560 with value 72
Debug 2023-12-03 13:03:29ZNXNKG02LM: unknown key 561 with value 200
Debug 2023-12-03 13:03:29ZNXNKG02LM: unknown key 562 with value 20
Debug 2023-12-03 13:03:29ZNXNKG02LM: unknown key 563 with value 20
Debug 2023-12-03 13:03:29ZNXNKG02LM: unknown key 568 with value 12
Debug 2023-12-03 13:03:29ZNXNKG02LM: unknown key 570 with value 129
Debug 2023-12-03 13:03:29ZNXNKG02LM: Processed data into payload {}
Info 2023-12-03 13:03:29MQTT publish: topic 'zigbee2mqtt/Dimmer', payload '{"action_rotation_angle":72,"action_rotation_angle_speed":72,"action_rotation_percent":20,"action_rotation_percent_speed":20,"action_rotation_time":200,"battery":100,"device_temperature":25,"linkquality":204,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3141}'
Debug 2023-12-03 13:03:30Received Zigbee message from 'Dimmer', type 'attributeReport', cluster 'aqaraOpple', data '{"556":500,"558":72,"560":0,"561":200,"562":0,"563":20,"568":12,"570":131}' from endpoint 72 with groupID 0
Debug 2023-12-03 13:03:30ZNXNKG02LM: unknown key 556 with value 500
Debug 2023-12-03 13:03:30ZNXNKG02LM: unknown key 558 with value 72
Debug 2023-12-03 13:03:30ZNXNKG02LM: unknown key 560 with value 0
Debug 2023-12-03 13:03:30ZNXNKG02LM: unknown key 561 with value 200
Debug 2023-12-03 13:03:30ZNXNKG02LM: unknown key 562 with value 0
Debug 2023-12-03 13:03:30ZNXNKG02LM: unknown key 563 with value 20
Debug 2023-12-03 13:03:30ZNXNKG02LM: unknown key 568 with value 12
Debug 2023-12-03 13:03:30ZNXNKG02LM: unknown key 570 with value 131
Debug 2023-12-03 13:03:30ZNXNKG02LM: Processed data into payload {}
Info 2023-12-03 13:03:30MQTT publish: topic 'zigbee2mqtt/Dimmer', payload '{"action_rotation_angle":72,"action_rotation_angle_speed":0,"action_rotation_percent":20,"action_rotation_percent_speed":0,"action_rotation_time":200,"battery":100,"device_temperature":25,"linkquality":188,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3141}'
Debug 2023-12-03 13:03:30Received Zigbee message from 'Dimmer', type 'attributeReport', cluster 'aqaraOpple', data '{"556":200,"558":36,"560":36,"561":200,"562":0,"563":10,"568":12,"570":1}' from endpoint 71 with groupID 0
Debug 2023-12-03 13:03:30ZNXNKG02LM: unknown key 556 with value 200
Debug 2023-12-03 13:03:30ZNXNKG02LM: unknown key 558 with value 36
Debug 2023-12-03 13:03:30ZNXNKG02LM: unknown key 560 with value 36
Debug 2023-12-03 13:03:30ZNXNKG02LM: unknown key 561 with value 200
Debug 2023-12-03 13:03:30ZNXNKG02LM: unknown key 562 with value 0
Debug 2023-12-03 13:03:30ZNXNKG02LM: unknown key 563 with value 10
Debug 2023-12-03 13:03:30ZNXNKG02LM: unknown key 568 with value 12
Debug 2023-12-03 13:03:30ZNXNKG02LM: unknown key 570 with value 1
Debug 2023-12-03 13:03:30ZNXNKG02LM: Processed data into payload {}
Info 2023-12-03 13:03:30MQTT publish: topic 'zigbee2mqtt/Dimmer', payload '{"action":"start_rotating","action_rotation_angle":36,"action_rotation_angle_speed":36,"action_rotation_percent":10,"action_rotation_percent_speed":0,"action_rotation_time":200,"battery":100,"device_temperature":25,"linkquality":188,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3141}'
Info 2023-12-03 13:03:30MQTT publish: topic 'zigbee2mqtt/Dimmer', payload '{"action":"","action_rotation_angle":null,"action_rotation_angle_speed":null,"action_rotation_percent":null,"action_rotation_percent_speed":null,"action_rotation_time":null,"battery":100,"device_temperature":25,"linkquality":188,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3141}'
Info 2023-12-03 13:03:30MQTT publish: topic 'zigbee2mqtt/Dimmer/action', payload 'start_rotating'
Debug 2023-12-03 13:03:30Received Zigbee message from 'Dimmer', type 'attributeReport', cluster 'aqaraOpple', data '{"556":500,"558":36,"560":36,"561":500,"562":10,"563":10,"568":12,"570":2}' from endpoint 71 with groupID 0
Debug 2023-12-03 13:03:30ZNXNKG02LM: unknown key 556 with value 500
Debug 2023-12-03 13:03:30ZNXNKG02LM: unknown key 558 with value 36
Debug 2023-12-03 13:03:30ZNXNKG02LM: unknown key 560 with value 36
Debug 2023-12-03 13:03:30ZNXNKG02LM: unknown key 561 with value 500
Debug 2023-12-03 13:03:30ZNXNKG02LM: unknown key 562 with value 10
Debug 2023-12-03 13:03:30ZNXNKG02LM: unknown key 563 with value 10
Debug 2023-12-03 13:03:30ZNXNKG02LM: unknown key 568 with value 12
Debug 2023-12-03 13:03:30ZNXNKG02LM: unknown key 570 with value 2
Debug 2023-12-03 13:03:30ZNXNKG02LM: Processed data into payload {}
Info 2023-12-03 13:03:30MQTT publish: topic 'zigbee2mqtt/Dimmer', payload '{"action":"rotation","action_rotation_angle":36,"action_rotation_angle_speed":36,"action_rotation_percent":10,"action_rotation_percent_speed":10,"action_rotation_time":500,"battery":100,"device_temperature":25,"linkquality":204,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3141}'
Info 2023-12-03 13:03:30MQTT publish: topic 'zigbee2mqtt/Dimmer', payload '{"action":"","action_rotation_angle":null,"action_rotation_angle_speed":null,"action_rotation_percent":null,"action_rotation_percent_speed":null,"action_rotation_time":null,"battery":100,"device_temperature":25,"linkquality":204,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3141}'
Info 2023-12-03 13:03:30MQTT publish: topic 'zigbee2mqtt/Dimmer/action', payload 'rotation'
Debug 2023-12-03 13:03:30Received Zigbee message from 'Dimmer', type 'attributeReport', cluster 'aqaraOpple', data '{"556":500,"558":36,"560":0,"561":500,"562":0,"563":10,"568":12,"570":3}' from endpoint 71 with groupID 0
Debug 2023-12-03 13:03:30ZNXNKG02LM: unknown key 556 with value 500
Debug 2023-12-03 13:03:30ZNXNKG02LM: unknown key 558 with value 36
Debug 2023-12-03 13:03:30ZNXNKG02LM: unknown key 560 with value 0
Debug 2023-12-03 13:03:30ZNXNKG02LM: unknown key 561 with value 500
Debug 2023-12-03 13:03:30ZNXNKG02LM: unknown key 562 with value 0
Debug 2023-12-03 13:03:30ZNXNKG02LM: unknown key 563 with value 10
Debug 2023-12-03 13:03:30ZNXNKG02LM: unknown key 568 with value 12
Debug 2023-12-03 13:03:30ZNXNKG02LM: unknown key 570 with value 3
Debug 2023-12-03 13:03:30ZNXNKG02LM: Processed data into payload {}
Info 2023-12-03 13:03:30MQTT publish: topic 'zigbee2mqtt/Dimmer', payload '{"action":"stop_rotating","action_rotation_angle":36,"action_rotation_angle_speed":0,"action_rotation_percent":10,"action_rotation_percent_speed":0,"action_rotation_time":500,"battery":100,"device_temperature":25,"linkquality":184,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3141}'
Info 2023-12-03 13:03:30MQTT publish: topic 'zigbee2mqtt/Dimmer', payload '{"action":"","action_rotation_angle":null,"action_rotation_angle_speed":null,"action_rotation_percent":null,"action_rotation_percent_speed":null,"action_rotation_time":null,"battery":100,"device_temperature":25,"linkquality":184,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3141}'
Info 2023-12-03 13:03:30MQTT publish: topic 'zigbee2mqtt/Dimmer/action', payload 'stop_rotating'
Koenkk commented 6 months ago

I see that both a hold and release action is published. Do I understand correctly that you want to see an action on:

Info 2023-12-03 13:03:25MQTT publish: topic 'zigbee2mqtt/Dimmer', payload '{"action_rotation_angle":-60,"action_rotation_angle_speed":-60,"action_rotation_percent":-16.66666603088379,"action_rotation_percent_speed":-16.66666603088379,"action_rotation_time":200,"battery":100,"device_temperature":25,"linkquality":244,"operation_mode":"event","power_outage_count":29,"state":"OFF","voltage":3141}'

If yes, since this is after the release, it doesn't make sense to me there should be an action here?

JulyIghor commented 6 months ago

I see that both a hold and release action is published. Do I understand correctly that you want to see an action on:

Those are appearing for the button events, not for rotation.

If yes, since this is after the release, it doesn't make sense to me there should be an action here?

Yes, I mean that the action should be there. As for me it would be failover to not wait for hold and release (because those events could be lost in QoS 0), but just analyze something like "action": "rotate_holding". At the moment it is working as expected for me, while I'm testing existence of the "action" field, I just wish to be sure it won't break in a future if you decide add that.

Koenkk commented 6 months ago

@kirovilya since you integrated this in #3078, does it make sense to add an action in this case?

maxgluzman commented 5 months ago

I am seeing the same actions as JulyIghor. My confusion is that there are discussions here of using trigger.to_state.attributes.action_rotation_percent in an automation. Having these as attributes instead of actions makes more sense as you can reference both as they do in logic to dim and brighten lights.

{%- if ((trigger.to_state.attributes.action_rotation_angle_speed | int / 24) | abs) < 1 -%} {{ trigger.to_state.attributes.action_rotation_angle | int / 12 }} {%- else -%} {{ (trigger.to_state.attributes.action_rotation_angle | int / 12) * ((trigger.to_state.attributes.action_rotation_angle_speed | int / 24) | abs) }} {%- endif -%}

Has this changed recently? are they using a different switch?

I am using Aqara knob H1 (wireless) (ZNXNKG02LM) by Xiaomi Firmware: 2019www.

xelemorf commented 2 months ago

Could this topic related to having duplicate actions when rotating the dial just one bit? The same action is executed twice, when initiating the action and when stopped rotating. I've tested this with volume control, it always steps twice up or down, same with light switches when using toggle it would toggle on and off right away.

akc360 commented 4 weeks ago

Hi, Thank you for the time and effort you put into this software I have the same issue as JulyIghor and maxgluzman. Is there any hope for this device or shall I just bin it?

Thanks in advance

Alex

maxgluzman commented 4 weeks ago

I got it working with the z2m.

Using this blueprint https://community.home-assistant.io/t/aqara-h1-smart-knob-dimmer-rotary-switch-for-controlling-a-cct-light-z2m/677981

On Thu, May 16, 2024 at 5:58 PM akc360 @.***> wrote:

Hi, Thank you for the time and effort you put into this software I have the same issue as JulyIghor and maxgluzman. Is there any hope for this device or shall I just bin it?

Thanks in advance

Alex

— Reply to this email directly, view it on GitHub https://github.com/Koenkk/zigbee2mqtt/issues/19995#issuecomment-2116272587, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXKJRWUFAGXQDS6MUNMHBIDZCUTXBAVCNFSM6AAAAABAEOPOXCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJWGI3TENJYG4 . You are receiving this because you commented.Message ID: @.***>

akc360 commented 4 weeks ago

I got it working with the z2m. Using this blueprint https://community.home-assistant.io/t/aqara-h1-smart-knob-dimmer-rotary-switch-for-controlling-a-cct-light-z2m/677981 On Thu, May 16, 2024 at 5:58 PM akc360 @.> wrote: Hi, Thank you for the time and effort you put into this software I have the same issue as JulyIghor and maxgluzman. Is there any hope for this device or shall I just bin it? Thanks in advance Alex — Reply to this email directly, view it on GitHub <#19995 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXKJRWUFAGXQDS6MUNMHBIDZCUTXBAVCNFSM6AAAAABAEOPOXCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJWGI3TENJYG4 . You are receiving this because you commented.Message ID: @.>

Interesting and thank you unfortunately the states of this device in z2mqtt do not work apart from the push button and I also can't view if the device is in event or command mode. I see you were also on the 2019 firmware same as me, have you updated it and if so how please?

Thank you

Alex

thestraycat commented 3 days ago

I'd love to know the same.

Additionally, Has anyone managed to successfully bind this wireless dimmer to a light at all using bind or touchlink?