ZHA -tuya - ts110e
See original GitHub issueThe problem
I have setup ZHA with a Sonoff Zigbee 3.0 USB Dongle Plus, and succesfully connected a CloudEven Zigbee dimmer(with Neutral). The device is recognized and a entity is created: light.tz3210_ngqk6jia_ts110e_light.
Everything seems to work OK (on, off and brightness), except when state updates from the device are received. When that happens, the reported brightness is always “3”, so in the dashboards the entity appears as on, but with a brightness of 3.
I can adjust the brightness with the GUI or through the mechanical switch and the state is updated on the GUI accordingly. But after a few minutes, the property “brightness” of the entity is updated to 3, so the GUI shows a powered on light with the brightness gauge at level 0. The actual brightness of the lamp does not change, only the state representation in HA.
After activating the logs for the ZHA component, I suspect that this is due to unsolicited periodic updates received from the dimmer that are either incorrectly generated in the actual device or incorrectly interpreted by the ZHA stack . The same happens when I force an attribute read from the Manage Zigbee Device panel.
What version of Home Assistant Core has the issue?
Home Assistant 2022.10.0
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
ZHA
Link to integration documentation on our website
https://rc.home-assistant.io/integrations/zha/
Diagnostics information
config_entry-zha-72088dea435840f8d292e50dba68898a.json.txt
Example YAML snippet
No response
Anything in the logs that might be useful for us?
2022-10-05 21:05:53.995 DEBUG (MainThread) [zigpy_znp.api] Received command: AF.IncomingMsg.Callback(GroupId=0x0000, ClusterId=8, SrcAddr=0x1F9D, SrcEndpoint=1, DstEndpoint=1, WasBroadcast=<Bool.false: 0>, LQI=81, SecurityUse=<Bool.false: 0>, TimeStamp=15142923, TSN=0, Data=b'\x18\x22\x01\x00\x00\x00\x20\x03', MacSrcAddr=0x1F9D, MsgResultRadius=29)
2022-10-05 21:05:53.998 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x1F9D), src_ep=1, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), dst_ep=1, source_route=None, extended_timeout=False, tsn=0, profile_id=260, cluster_id=8, data=Serialized[b'\x18"\x01\x00\x00\x00 \x03'], tx_options=<TransmitOptions.NONE: 0>, radius=29, non_member_radius=0, lqi=81, rssi=None)
2022-10-05 21:05:54.002 DEBUG (MainThread) [zigpy.zcl] [0x1F9D:1:0x0008] Received ZCL frame: b'\x18"\x01\x00\x00\x00 \x03'
2022-10-05 21:05:54.006 DEBUG (MainThread) [zigpy.zcl] [0x1F9D:1:0x0008] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, direction=<Direction.Client_to_Server: 1>, disable_default_response=1, reserved=0, *is_cluster=False, *is_general=True, *is_reply=True), tsn=34, command_id=1, *direction=<Direction.Client_to_Server: 1>, *is_reply=True)
2022-10-05 21:05:54.011 DEBUG (MainThread) [zigpy.zcl] [0x1F9D:1:0x0008] Decoded ZCL frame: F000LevelControlCluster:Read_Attributes_rsp(status_records=[ReadAttributeRecord(attrid=0x0000, status=<Status.SUCCESS: 0>, value=TypeValue(type=uint8_t, value=3))])
2022-10-05 21:05:54.016 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x1F9D:1:0x0008]: received attribute: 0 update with value: 3
Additional information
No response
Issue Analytics
- State:
- Created a year ago
- Comments:52 (30 by maintainers)
Top Related StackOverflow Question
@celsiusHF The “polling current state” happens in a random interval defined on startup for each light (45 to 75 minutes). The polling and parsing of that is then done in HA Core here: https://github.com/home-assistant/core/blob/e5a532629855fc5ba0072296e9e9bab79eccf35b/homeassistant/components/zha/light.py#L765 But that seems to read the wrong attribute again. So I guess the reading for the level attribute always needs to be overridden with the quirk somehow(?)
There is some error in my code. I will need to review the implementation and perform some tests locally. I will come back in a while.