Closed sophipl closed 1 month ago
Well, I think I got as far as I could
The cluster commands works fine, I can detach relay, invert LEDs, disable anti-flicker
But buttons doesn't work
I sit with wireshark and HA logs, didn't manage to make it work.
And it's maddening, everything is a string in quirk device_automation_triggers
, how can you know how to match things and from where they came from? There is something to be said about strongly typed languages.
The buttons work like this, left button is source_endpoint 41, right button is source_endpoint 42, both buttons is 51 It is sending value of uint16 of 1 or 2, for one press or 2 presses, attribute id 0x0055 (Preset value) When you press 3 times, it does something funny, it introduces itself, sends string value with model information. Holding a button sends data for cluster 0xfcc0 with value false of boolean, attribute id 0x00fc
It seems that ZHA cannot decode the values as event, I don't know, just a packet
2023-03-24 22:06:34.973 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0xD3A6), src_ep=41, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000),dst_ep=1, source_route=None, extended_timeout=False, tsn=116, profile_id=260, cluster_id=18, data=Serialized[b'\x18>\nU\x00!\x02\x00'], tx_options=<TransmitOptions.NONE: 0>, radius=0, non_member_radius=0, lqi=255, rssi=-34)
2023-03-24 22:05:06.802 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0xD3A6), src_ep=41, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000),dst_ep=1, source_route=None, extended_timeout=False, tsn=109, profile_id=260, cluster_id=18, data=Serialized[b'\x188\nU\x00!\x01\x00'], tx_options=<TransmitOptions.NONE: 0>, radius=0, non_member_radius=0, lqi=255, rssi=-33)
2023-03-24 22:05:08.801 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0xD3A6), src_ep=41, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000),dst_ep=1, source_route=None, extended_timeout=False, tsn=110, profile_id=260, cluster_id=18, data=Serialized[b'\x189\nU\x00!\x01\x00'], tx_options=<TransmitOptions.NONE: 0>, radius=0, non_member_radius=0, lqi=255, rssi=-33)
2023-03-24 22:39:43.094 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0xD3A6), src_ep=1, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=161, profile_id=260, cluster_id=64704, data=Serialized[b'\x1c_\x11L\n\xfc\x00\x10\x00'], tx_options=<TransmitOptions.NONE: 0>, radius=0, non_member_radius=0, lqi=255, rssi=-34)
2023-03-24 22:05:09.654 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0xD3A6), src_ep=42, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000),dst_ep=1, source_route=None, extended_timeout=False, tsn=112, profile_id=260, cluster_id=18, data=Serialized[b'\x18;\nU\x00!\x01\x00'], tx_options=<TransmitOptions.NONE: 0>, radius=0, non_member_radius=0, lqi=255, rssi=-33)
2023-03-24 22:25:20.180 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0xD3A6), src_ep=51, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=141, profile_id=260, cluster_id=18, data=Serialized[b'\x18E\nU\x00!\x01\x00'], tx_options=<TransmitOptions.NONE: 0>, radius=0, non_member_radius=0, lqi=255, rssi=-34)
Maybe you will be able to fix the problem, my head explodes now :)
I managed to do it, it took some effort
I don't know why device_automation_triggers
didn't wanted to match at some point of my development, so I limited it to COMMAND
If someone want's to use it, please go ahead
FYI @TheJulianJES If someone thinks it's worth integrating
We can leave this open for now (until zha-quirks maybe fixes this).
@sophipl thank you! Decoupling worked and both the single and double press automations work flawlessly!
@grzegor Thanks! :)
@sophipl hello! I just received my lumi.switch.l2aeu1
today. I've loaded your quirk into Home Assistant and can confirm it's being used by ZHA. The only thing I'm not sure about is how to put the device in decoupled mode, any advice you can give me?
EDIT: I can see two clusters: XiaomiAqaraMasterCluster
& XiaomiAqaraSecondaryCluster
, and within each there is an operation_mode (id: 0x0200)
, Reading the value of this on either returns XiaomiAqaraOperationMode.Coupled
. So I'm absolutely in the right place, I just can't figure out what to write back to move it to Decoupled.
EDIT2: Send a zero. I tried everything except writing a zero. Sorry! Thanks for the Quirk. You're awesome.
@cpressland Great that you figured out! I don't think there is a way to export the value into selection box in HA, so we have to stumble in the menus. :)
I needed to edit this quirk. I don't know why my switch has more ENDPOINTS
in the signature
. The INPUT_CLUSTERS
in the first endpoint differ.
Hi, unfortunately, neither of the quirks posted here work for my device. I don't receive any events when listening to "zha_event." My device is shown as two lights, and the right button doesn't change when I press the button physically. Can anyone help me?
@sophipl , thanks for the quirk, it works for me (l2aeu1) for anyone attempting to apply it as-is: it seems that it is a little bit outdated and there is no 'OPPLE_CLUSTER_ID':
from zhaquirks.xiaomi.aqara.opple_remote import (
OppleCluster,
OPPLE_CLUSTER_ID,
STATUS_TYPE_ATTR,
PRESS_TYPES
)
my fix was to remove OPPLE_CLUSTER_ID from the imports and replace all usages in this file with OppleCluster.cluster_id
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
I would like to have the ability to trigger on double button press, which I read that this device have in Zigbee2MQTT mode. The device has automation abilities in HA on state changes (light on, light off), but not of button presses, apparently you can have the ability to disconnect button from it's internal relay and automate it differently as well.
I didn't see any pre-existing quirks. Sadly I understand too zigbee protocol too little to write this quirk myself.
Device signature
```yaml { "node_descriptor": "NodeDescriptor(logical_type=Diagnostic information
```yaml { "home_assistant": { "installation_type": "Home Assistant Container", "version": "2023.1.6", "dev": false, "hassio": false, "virtualenv": false, "python_version": "3.10.7", "docker": true, "arch": "aarch64", "timezone": "Europe/Warsaw", "os_name": "Linux", "os_version": "5.15.84-v8+", "run_as_root": true }, "custom_components": {}, "integration_manifest": { "domain": "zha", "name": "Zigbee Home Automation", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/zha", "requirements": [ "bellows==0.34.6", "pyserial==3.5", "pyserial-asyncio==0.6", "zha-quirks==0.0.90", "zigpy-deconz==0.19.2", "zigpy==0.53.0", "zigpy-xbee==0.16.2", "zigpy-zigate==0.10.3", "zigpy-znp==0.9.2" ], "usb": [ { "vid": "10C4", "pid": "EA60", "description": "*2652*", "known_devices": [ "slae.sh cc2652rb stick" ] }, { "vid": "1A86", "pid": "55D4", "description": "*sonoff*plus*", "known_devices": [ "sonoff zigbee dongle plus v2" ] }, { "vid": "10C4", "pid": "EA60", "description": "*sonoff*plus*", "known_devices": [ "sonoff zigbee dongle plus" ] }, { "vid": "10C4", "pid": "EA60", "description": "*tubeszb*", "known_devices": [ "TubesZB Coordinator" ] }, { "vid": "1A86", "pid": "7523", "description": "*tubeszb*", "known_devices": [ "TubesZB Coordinator" ] }, { "vid": "1A86", "pid": "7523", "description": "*zigstar*", "known_devices": [ "ZigStar Coordinators" ] }, { "vid": "1CF1", "pid": "0030", "description": "*conbee*", "known_devices": [ "Conbee II" ] }, { "vid": "10C4", "pid": "8A2A", "description": "*zigbee*", "known_devices": [ "Nortek HUSBZB-1" ] }, { "vid": "0403", "pid": "6015", "description": "*zigate*", "known_devices": [ "ZiGate+" ] }, { "vid": "10C4", "pid": "EA60", "description": "*zigate*", "known_devices": [ "ZiGate" ] }, { "vid": "10C4", "pid": "8B34", "description": "*bv 2010/10*", "known_devices": [ "Bitron Video AV2010/10" ] } ], "codeowners": [ "@dmulcahey", "@adminiuga", "@puddly" ], "zeroconf": [ { "type": "_esphomelib._tcp.local.", "name": "tube*" }, { "type": "_zigate-zigbee-gateway._tcp.local.", "name": "*zigate*" }, { "type": "_zigstar_gw._tcp.local.", "name": "*zigstar*" }, { "type": "_slzb-06._tcp.local.", "name": "slzb-06*" } ], "dependencies": [ "file_upload" ], "after_dependencies": [ "onboarding", "usb", "zeroconf" ], "iot_class": "local_polling", "loggers": [ "aiosqlite", "bellows", "crccheck", "pure_pcapy3", "zhaquirks", "zigpy", "zigpy_deconz", "zigpy_xbee", "zigpy_zigate", "zigpy_znp" ], "is_built_in": true }, "data": { "ieee": "**REDACTED**", "nwk": 41887, "manufacturer": "LUMI", "model": "lumi.switch.l2aeu1", "name": "LUMI lumi.switch.l2aeu1", "quirk_applied": false, "quirk_class": "zigpy.device.Device", "manufacturer_code": 4447, "power_source": "Battery or Unknown", "lqi": 156, "rssi": -61, "last_seen": "2023-03-12T17:09:49", "available": true, "device_type": "EndDevice", "signature": { "node_descriptor": "NodeDescriptor(logical_type=