@michaelblight sorry about that. I didn’t get into the details of why on purpose but I could…
I’ve had two issues with the Tuya Integration for awhile and have not been able to get too much help solving them. The first issue is posted but its been open since May 2022. I also opened tickets with Tuya for both of the issues. Their answer to the first isse was that it was something that they would not be addressing at the current time (which I have no idea why) and the second issue will be addressed in a future update (which there hasn’t been in awhile)
The first issue is that when I add a specific device to the Tuya App it breaks something in the code of the Tuya integration and causes any entity in the integration that uses the light
domain to become “unsupported” and no longer work. I could still use the devices via the Tuya Local integration and the Tuya App which means the problem is isolated to the HA Core Tuya Integration. (This is the issue that Tuya’s said they would not be addressing at the current time.)
There are two specific devices that cause this to happen and I consider both of them switches but the Tuya integration automatically adds them as lights. One switch is a socket and the other is a wall switch. I checked the Tuya product type for both of them, which is cz
and qjdcz
, and found them listed in both the light.py and the switch.py files. Here they are in the light file.
# Socket (duplicate of `kg`)
# https://developer.tuya.com/en/docs/iot/s?id=K9gf7o5prgf7s
LIGHTS["cz"] = LIGHTS["kg"]
# Unknown product with light capabilities
# Fond in some diffusers, plugs and PIR flood lights
# Not documented
"qjdcz": (
TuyaLightEntityDescription(
key=DPCode.SWITCH_LED,
color_mode=DPCode.WORK_MODE,
brightness=DPCode.BRIGHT_VALUE,
color_data=DPCode.COLOUR_DATA,
),
),
…and here they are in the switch file.
# Socket (duplicate of `pc`)
# https://developer.tuya.com/en/docs/iot/s?id=K9gf7o5prgf7s
SWITCHES["cz"] = SWITCHES["pc"]
# Unknown product with switch capabilities
# Fond in some diffusers, plugs and PIR flood lights
# Not documented
"qjdcz": (
SwitchEntityDescription(
key=DPCode.SWITCH_1,
name="Switch",
),
),
By using the method described here I want to try and remove those lines of code from the light file to see if it fixes the issue. That method requires me to add the source of the file and so far I have been unable to locate it the light.py
file.
The other issue is that one of my cover devices added by the Tuya intergraion operates incorrectly. The open and close functions are reversed. If I try to open the cover it closes and if I try to close the cover it opens. I checked the state of the device on the Tuya IoT and it seems to be sending the correct state to HA. If I use the Tuya App or the Tuya Local integration the cover operates correctly.
The checked the app and I have the ability to change the direction of the motor but that only affects the physical cover. The Tuya Local integration has the option for me to Invert 0-100 position (for *position* mode only)
which I use and why I think it works correctly from Tuya Local. When Tuya said that the issue would be addressed in a future update I figured that they would be adding the ability to “invert the position” like the Tuya Local integration.
I’m not that worried about this issue but if I have the time I want to see if I could somehow add code to the cover.py
file that is similar to what the Local Tuya integration uses to “invert the position”. I also thought about adding a template sensor to HA that inverts the position but I don’t think that will work.
I apologize for the lengthy explanatin but you asked and I wanted to try and be as clear as possible so you or someone else understands. Thanks.