-
Notifications
You must be signed in to change notification settings - Fork 825
Add battery reporting for Zemismart ZM85EL cover motors #2404
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 ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #2404 +/- ##
==========================================
- Coverage 85.20% 85.19% -0.02%
==========================================
Files 268 268
Lines 8444 8454 +10
==========================================
+ Hits 7195 7202 +7
- Misses 1249 1252 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I have a "ZM25EL-08/25" which is showing up as "_TZE200_pw7mji0l". Can someone tell me: Is the reason this PR hasn't been accepted because of the checks that weren't successful back in May? Can I do anything to make them successful? |
If looking on the tagging: |
Thanks @MattWestb, that helps. It appears that codecov is complaining about just 3 of the lines added to tuya/init.py that aren't covered by any tests. I've read the ZHA Quirks doco that mentions setting up a test file for a new quirk, and that seems to but that seems to focus on the device's .py file, not the init.py file. Is there any doco/reference/example to help me understand how to add tests for the extra lines in init.py? |
I dont have the knowledge then im not one code-worrier but i think its one Q for @TheJulianJES. |
Ideally, we'd get a message from the device (including battery report). In a test, we can use That test verifies that code (mostly) works, even when other parts (or your new code itself) is changed, without having to recheck every device. So, can you post a message from the device (turn on debug logs) which includes battery report? |
Ah OK. I appreciate your guidance @TheJulianJES. I'm hoping @michalmo can provide these logs. I don't know if I can do this with how my setup is at the moment. (And just highlighting that this isn't my code, I'm just trying to see what I can do to get it past the line.) I've enabled ZHA debug logs, but I'm not sure what I'm looking for. Is this info available in a raw Zigbee message? I'm guessing that the quirk needs to extract the battery level as an attribute, and then it will be logged, but without @michalmo's quirk mod running on my system, this isn't going to happen. I've replicated the "zhaquirks/tuya" directory onto my system, and it loads up fine with the current release of code. But when I add @michalmo's version of init.py and ts0601_cover.py, my ZHA fails with an error:
This isn't intended to side-track this PR into a coding lesson for myself (although I could do with a few Python lessons TBH, but that's a different issue), I just wanted to show where I've stalled, in case someone else can point me in the right direction. If I can't get my own copy of the modded quirk to load, I fear that I'm not going to be much help here. |
Can anyone help me to get this modified quirk running on my system, so I can get debug logs? |
Nobody? |
One good start can being the wiki https://github.com/zigpy/zigpy/wiki |
Add something like this to the quirk where you create the zha-device-handlers/zhaquirks/tuya/__init__.py Lines 956 to 961 in a014ef5
The PR adds it for The missing tests are still something that we likely need to address. |
The custom quirk by stast1 in _"[Device Support Request] custom quirk for Tuya Zemismart blind cover motor TS0601 TZE200_68nvbio9 with battery #3118" brings battery level functionality to my _TZE200_pw7mji0l motors. It updates and seems to move around a bit, but it does this in the TuyaSmart app too, so I think that is something on the motor end. |
Proposed change
Zemismart ZM85EL series devices that I own report battery status as Tuya attribute
0x0D
. This PR adds optional support for reporting battery level toTuyaManufacturerWindowCover
and moves the 3 manufacturer ids of these devices to a new quirk, with battery support enabled.Additional information
ZM85EL manufacturer ids are:
_TZE200_pw7mji0l
ZM85EL-1Z (added in Add support for zemismart ZM85EL-1Z blinds #1616) - I do not own a device with this id_TZE200_68nvbio9
alternative id for ZM85EL-1Z bought from Zemismart store on Aliexpress (added in Add Zemismart Roller Blind id: tze200 68nvbio9 #1349) - I own this device_TZE200_cf1sl3tj
ZM85EL-2Z (added in Add Zenismart Smart Curtain driver support #1652) - I own this deviceThese devices appeared in different quirks which have the same signatures and configuration.
Checklist
pre-commit
checks pass / the code has been formatted using Black