-
Notifications
You must be signed in to change notification settings - Fork 933
Tuya PJ-1203A MatSeePlus Energy Meter (TS0601 _TZE204_81yrt3lo/_TZE284_81yrt3lo) v2 quirk #4498
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
base: dev
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #4498 +/- ##
==========================================
+ Coverage 92.24% 92.32% +0.08%
==========================================
Files 369 372 +3
Lines 12094 12228 +134
==========================================
+ Hits 11156 11290 +134
Misses 938 938 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Quirk itself validated working in all scenarios with the last commit - will update the validate the tests cases tomorrow prior to making a final commit (haven't got access to my dev container today to automate testing these). |
…o 2 CT Bidirectional Energy Meter - Removed the over-engineered channel logic implemented in previous v2 PR - ElectricalMeasurement and Metering clusters just handle reporting, no calculations - Implements interval based signing logic to ensure the correct energy flow value is used to sign power - Ensures that the calculated total (replacing DP 115 due to a device bug in _TZE204) uses the correct pairing of power values - Allows selective enablement of the late flow report bug mitigation (off by default)
d955c00 to
2dc9886
Compare
…ers missing Codecov line
|
Ready for review, let me know of any issues👍 |
…simplify _process_power_and_energy_flow. No functional change in outcome
…uces code repetition - Improve clarity of comments - Use TuyaEnergyFlow type value for _align_value_with_energy_flow comparision
Proposed change
Adds support for MatSeePlus PJ-1203A 2 CT clamp Energy Meter.
Addresses Device Support Requests
Simplifies original pull requests
Separated from other Tuya devices to isolate logic handling the late flow reporting behaviour summarised below:
There is a known issue on the _TZE204_81yrt3lo (with appVersion 74, stackVersion 0 and hwVersion 1).
The energy_flow datapoints are (incorrectly) emitted during the next update. This is quite problematic
because that means that the direction can be inverted for up to update_frequency seconds.
More detail in the Zigbee2MQTT tuya.ts device handler
The quirk makes use of common power value signing logic for both device variations (combining power and energy flow DP values), however the mitigation for the late energy flow bug is disabled by default.
This is because it is not required in the
_TZE284device revision (sharing the same data points, but reporting the correct direction in the current interval), nor is it required if the_TZE204device is used to measure power that always flows in the same direction.Exposes Electrical Measurement entities
Exposes Metering entities
Exposes configuration entities
Additional information
Checklist
pre-commitchecks pass / the code has been formatted using Black