-
Notifications
You must be signed in to change notification settings - Fork 737
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
[Device Support Request] PC311-Z-TY Single-Phase Power Clamp Zigbee model 'TS0601' and manufacturer name '_TZE200_rks0sgb7 #2650
Comments
Got in the email from vladii07 an attempt at mapping values with external converter. Not so proficient in github - just posting my findings. Tested it as I have exactly the device as linked above. My comments are added to initial comments like this "- comment" `const fz = require('zigbee-herdsman-converters/converters/fromZigbee'); const valueConverter = { const definition = { meta:{ module.exports = definition;` |
[103, 'energy_forward_B', tuya.valueConverter.divideBy100], - tested by comparing to another device, OK |
Details:
NOTE: Readings accuracy is directly impacted by distance from other wires!!! One clamp was left without wire passing through, just wire next to it and it was showing 7W consumption. Working converter below: const fz = require('zigbee-herdsman-converters/converters/fromZigbee'); const valueConverter = { const definition = { meta:{ module.exports = definition; |
@KPfff Can you guide me to test this configuration? I have updated HA but I still have the old configuration. |
@lepalom, Are you familiar with setting up external converters?
If the device is still reporting old values then try removing it and adding it again. (Worst case force remove and pair once again) Note: Mind you that any historical data will not be brought over - it is like adding new device. Hope it helps :) |
@KPfff: many thanks for this investigation. I guess that part of the issue is that not everybody is using |
Work-in-progress "quirk":
|
@KPfff thanks a lot. Well, my problem is that I'm not using zigbee2mqtt. Now I have understood the problem. I have seen that there are like two big families to manage a zigbee devices: ZHA integration and zigbee2mptt. I have been using ZHA and I would like to test zigbee2mqtt, but I have to migrate all the devices. I will see. |
@jmuf Are you working on "quirk" for ZHA? |
I had a look but am stuck, no idea whether the "attributes" from @KPfff have been correctly put in place in this code, or whether something basic is missing (this is my first attempt at a "quirk"). |
Do we have someone who could check - validate this? |
Attached is a new version of the "quirk" (apparently need some offset to "translate" attributes numbers between zigbee2mqtt and ZHA), as usual need to rename to
If somebody has an idea/example on how to address the last point, I'd be happy for hints (instantiate a new "endpoint"?). This might also allow to not use "Phase B". |
@robertstumberger, Apologies I see I have added to the confusion - I think I thought that this is one of the threads on zigbee2mqtt project when in fact this is for ZHA. :( As far as mappings go I have been using this device with custom converter ever since with no issues. I haven't used ZHA integration but apparently custom quirks are formatted completely differently - so unless you can translate my mappings to custom quirk then I can't be of any help here. |
@robertstumberger : this is not so bad, the device has been recognized - please make sure you take the actual latest version of ts0601_sp_clamp_power.py , an earlier version indeed did not report any standard attribs back to HA. |
Reconfigure of "virtual cluster" is not working then the commands / attributes is not sent by the endpoint / cluster they is sent by the tuya MCU on the tuya cluster. |
Hej @jmuf , Maybe we will manage to add both Clamps? :-) |
Hi , |
Hej @jmuf , and if i go: this means, that the declarations for these entities are defined somewhere else and not in this Quirk (ts0601_sp_clamp_power.py) |
As you've seen, the
|
The quirk is partly functional... |
Here is a new version that has both clamps individually (as well as the total) However, I haven't yet found a way to give them different entity names (so you'll get 3x "xyz Summation delivered" and so on - you can always rename them yourself, of course). Pointers to some similar device than can do this would be welcome... |
Hi @jmuf |
@robertstumberger - thanks for the test. Could you edit the "quirk" and change
(per above "Power readings goes negative with reverse load"..). There also should be some "Sum received" attributes somewhere that sum up outgoing kWh... |
Latest version (with the above "negative" power for outgoing load, also some cleanups): ts0601_sp_clamp_power.py.v3.txt The issue of metric names (3x "Power") is still open.. |
* use separate classes for AB/A/B readings, with several Bus()es as Hash * allow to report negative power reading (under reverse load) * use constants from ElectricalMeasurement, Metering and for divisors * do not set voltage/current/energy multipliers, just divisors
Aims to address device support requests: 2 bidirectional clamps: zigpy#2549 (_TZE204_81yrt3lo) zigpy#2650 (_TZE200_rks0sgb7) 1 bidirectional clamp: zigpy#2420 (_TZE204_ac0fhfiq) 1 clamp: zigpy#1973 (_TZE204_cjbofhxw) @jmuf I've just spotted that in parallel you've also been working on zigpy#2870 for _TZE200_rks0sgb7, shall we pool ideas?
Amendments from details in zigpy#2650 & zigpy#2870 (however that approach uses attributes directly rather than datapoints).
Originally I was in same situation than robertstumberger : using ZHA, PC311-Z-TY .. and only had 2 values (LQI and RSSI) But numbers does seems good on my side. I've put one on a working oven and the other one on a fridge. Questions :
Thx for you help and for publishing all this ;) |
Hi to all ZHAzha: in the path I've uploaded the .py file, repairing the devide and restart HA but I see only 2 entities. |
@jmuf Was there any plans to merge https://github.com/zigpy/zha-device-handlers/files/13695705/ts0601_sp_clamp_power.py.v3.txt back into the main dev branch and also any luck in fixing the naming, specifically the A+B portion? |
There are currently two "competing" pull requests open
looks like that would need support in the base code (not happening?), or could possibly unclear how) be addressed if we go from "quirk" to "integrated in ZHA" (per #2840 ) |
We should be able to resolve the naming issue using the new quirks v2 format. I'm planning to reimplement mine using quirks v2 in the new year, exposing config options in the UI that should allow flipping the negative values for people who have that issue. It should make creating tests a fair bit easier too based on experience I've had with some other V2 quirks. |
[..]
FWIW, the update to homeassistant 2025.1 broke "my" quirk, will close the pull request. Hope that @jeverley 's version can move forward. |
Problem description
I would like to kindly ask to support this device:
[PC311-Z-TY Single-Phase Power Clamp Zigbee] (https://es.aliexpress.com/item/1005005931365212.html)
This device is the same commented here, in the zigbee2mqtt project.
Solution description
Fully integrated in HA.
Screenshots/Video
No response
Device signature
Device signature
Diagnostic information
Diagnostic information
Logs
No response
Custom quirk
In Koenkk/zigbee2mqtt#18734 they have configured it.
Additional information
No response
The text was updated successfully, but these errors were encountered: