home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.03k stars 28.28k forks source link

[ZHA] When using TuyaZBOnOffAttributeCluster in custom quirk for TS011F the child lock, backlight mode and power on state UI entities don't show #116825

Closed RhavoX closed 1 week ago

RhavoX commented 1 week ago

The problem

I have a Tuya TS011F plug that provides an invalid 0W usage periodically, I wanted to write a quirk that filters it out and noticed that the UI elements for child lock etc are gone but I am still using the TuyaZBOnOffAttributeCluster. To reproduce this you can even take the original zha quirk for Tuya TS011F and put it in as a custom quirk and the UI entities are gone (the zha-device-handlers/zhaquirks/tuya/ts011f_plug.py file).

Or am I not understanding how the core creates the entities? That it has to be an official ZHA quirk?

What version of Home Assistant Core has the issue?

2024.5.1

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

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

RhavoX commented 1 week ago

I found the root cause. The master's zha quirk does not have quirk_id = TUYA_PLUG_ONOFF line in it. This is how the core determines the entities now. Just needed to add that one line into my quirk and it is solid now.