ZHA -tuya - ts110e

See original GitHub issue

The 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

zha-72088dea435840f8d292e50dba68898a-_TZ3210_ngqk6jia TS110E-f6db2481db90fa498e4570591c3eee72.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:open
  • Created a year ago
  • Comments:52 (30 by maintainers)

github_iconTop GitHub Comments

2reactions
TheJulianJEScommented, Oct 8, 2022

@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(?)

1reaction
javicallecommented, Oct 12, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sonoff Zigbee/Tuya Dimmer Module - Unable to dim light
I noticed that our device is Zigbee ID: "TS110E"; ... because I'd like to use ZHA: https://github.com/zigpy/zha-device-handlers/issues/1415.
Read more >
Lonsonho Tuya Smart Zigbee Dimmer Switch Module Relay ...
Get smart zigbee dimmer switch module with free return and fast delivery. The smart zigbee dimmer switch module is suitable for alexa and...
Read more >
Zigbee Home Automation (ZHA)
Database of Zigbee devices compatible with ZHA, Tasmota, Zigbee2MQTT, deCONZ, ZiGate and ioBroker. ... Lonsonho Tuya Zigbee 3.0 E27/B22/GU10 Bulb, ZB-RGBCW.
Read more >
zha-quirks - Wheelodex
Summary: Library implementing Zigpy quirks for ZHA in Home ... Keywords: zha quirks homeassistant hass ... zhaquirks/tuya/ts110e.py ...
Read more >
Device support - homebridge-z2m
TRV06, AVATTO Thermostat radiator valve (white-label of TuYa TV02-Zigbee) ... QS-Zigbee-D02-TRIAC-LN, RTX 1 channel dimmer (white-label of TuYa TS110E).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found