-
Notifications
You must be signed in to change notification settings - Fork 726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tuya TS0601 _TZE200_hkdl5fmv RCBO #1991
Conversation
Pull Request Test Coverage Report for Build 3658331273
💛 - Coveralls |
Are apparent power, instantaneous demand and power factor actually supported? |
Codecov ReportBase: 83.09% // Head: 83.51% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## dev #1991 +/- ##
==========================================
+ Coverage 83.09% 83.51% +0.41%
==========================================
Files 248 249 +1
Lines 7860 8005 +145
==========================================
+ Hits 6531 6685 +154
+ Misses 1329 1320 -9
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
They are not provided by the device, but we can calculate the apparent power in the quirk by multiplying the voltage by the current, and then we can calculate the power factor by dividing the active power by the apparent power. Should I do it? |
ID is the current power draw from what is connected. (How much power is being used in near real time). I am more interested in why they show up if they don’t have values. It means we have something screwy somewhere either in quirks or in ZHA itself. |
I fail to see the difference:
|
I think that's something in ZHA, like if certain cluster is present, the sensors are added regardless if the respective attributes are set. |
I've just discovered the tuya.PowerOnState class, give me a moment to rewrite the quirk to use it instead of a new class,,, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the same cluster reference in all the mappings.
Don't merge yet, I want to get the GUI "power on state" selector working (I just found out that it exists!) |
Ah, there is a hard coded white list in ZHA code for that @CONFIG_DIAGNOSTIC_MATCH(
channel_names=CHANNEL_ON_OFF,
models={"TS011F", "TS0121", "TS0001", "TS0002", "TS0003", "TS0004"},
)
@CONFIG_DIAGNOSTIC_MATCH(
channel_names="tuya_manufacturer",
manufacturers={
"_TZE200_7tdtqgwv",
"_TZE200_amp6tsvy",
"_TZE200_oisqyl4o",
"_TZE200_vhy3iakz",
"_TZ3000_uim07oem",
"_TZE200_wfxuhoea",
"_TZE200_tviaymwx",
"_TZE200_g1ib5ldv",
"_TZE200_wunufsil",
"_TZE200_7deq70b8",
"_TZE200_tz32mtza",
"_TZE200_2hf7x9n3",
"_TZE200_aqnazj70",
"_TZE200_1ozguk6x",
"_TZE200_k6jhsr0q",
"_TZE200_9mahtqtg",
},
)
class TuyaPowerOnStateSelectEntity(ZCLEnumSelectEntity, id_suffix="power_on_state"):
"""Representation of a ZHA power on state select entity."""
_select_attr = "power_on_state"
_enum = TuyaPowerOnState
_attr_name = "Power on state" Ok, will raise a separate request to ZHA. This PR is ready from my side. |
@dmulcahey Shall I include apparent power and power factor calculation into the quirk? |
I decided to include it, because it's just cool:) |
@Shulyaka I merged this into the current release and all the tests are now failing... Can you take a peek? |
Strange. Let me check... |
|
Something to do with the byte order |
Will this break your prior PR too? |
I have reverted a PR that mess with the TuyaDPType.VALUE, maybe related? |
Can I help in some way? |
It's up to you. But only this device is affected. |
ok then I'll just bump again once it's fixed |
Do you plan to reapply #1984 some day when the side effects are sorted out? |
My understanding is the following:
|
By the way there are now big endian types in zigpy: zigpy/zigpy#1124 |
This is a question for @javicalle I try to stay out of the Tuya stuff... |
I have to admit that I'm not familar with all that endians, but my understanding is that all the quirks using the
I was trying to figure out what the problem was with #1554 and in my analysis I have detected a problem with the reverse of TuyaDPType.VALUE working only in one direction:
I have to clarify that not all the quirks use these classes and not all the ones that use the classes have the problem.
That's correct. I believe that most of the test fails because the expected value on test, but I try to review your code again to search for problems in the DPType. |
@javicalle please check #2009 |
I have a new version, but I haven't found any user able to test.
Already doing. |
Please tag me when it is ready, I would like to check it as well if you don't mind. By the way we also reverse the endianess in Data.from_value(). |
I had missed that call. Thanks for pointing me. |
Add support for Tuya ts0601 _TZE200_hkdl5fmv circuit breaker (https://aliexpress.com/item/1005004749980758.html)
Special thanks to @danieledwardgeorgehitchcock for Koenkk/zigbee-herdsman-converters#3197