-
Notifications
You must be signed in to change notification settings - Fork 686
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
Create Quirk for TS011F #1057
Create Quirk for TS011F #1057
Conversation
Quirk for the TS011F _TZ3000_cphmq0q7'}, _TZ3000_ew3ldmgx'}, _TZ3000_ps3dmato'}, _TZ3000_mraovvmm'}, _TZ3000_jvzvulen'}, _TZ3000_dpo1ysak'}],
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #1057 +/- ##
==========================================
+ Coverage 81.08% 81.19% +0.10%
==========================================
Files 195 196 +1
Lines 5160 5189 +29
==========================================
+ Hits 4184 4213 +29
Misses 976 976 ☔ View full report in Codecov by Sentry. |
Pull Request Test Coverage Report for Build 1338958385
💛 - Coveralls |
Try deleting the:
in the replace part (line 106 and 107), i think then ZHA is not getting the clusters and they is going to "dev nul". |
I removed
But still same entry in logs. But Im not sure if there related. |
You can trying defining it like this (from IKEA Styrbar):
but 2 different name for the clusters 0xE000 and 0xE001. Perhaps David is knowing how to do it OK ? |
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.
Run through black and isort to fix formatitng.
Test and consider the proposed changes
Otherwise looks good
Made changes but stil using ``` attributes = OnOff.attributes.copy() attributes.update({0x8002: ("power_on_state", PowerOnState)})```
If you is adding this at line 25 with one empty line before and 2 after:
and changing the line 79 and 80 to this (Signature cluster 0xE000 and 0xE001) :
and deleting the line 109 and 110 (in the replacement):
Do you still getting warning in HA long from the device ? |
Used TuyaZBOnOffRestorePowerCluster from INIT. PR1056
used flake 8 in VSCode
Added the missing dots
I Sort and Flake 8 fixed
Dont know why python check fails. |
The check have not failing but is not being run then you need having getting one PR merged for have the permission for having it being run after every changes (if not having blocking change requests that i is having in some PRs). You must waiting until the devs / maintainer is approving the test and you can see if somthing is not OK. You can see that last tests here https://github.com/zigpy/zha-device-handlers/pull/1057/checks. |
ISORT says files is OK. Using ISORT in VSCode
Whats Wrong With ISORT ? |
ISORT like having the block |
Strange, that VSCode and an online tool placed that block somewhere else.
Ill give it a change, again.
Verzonden vanaf mijn Galaxy
…-------- Oorspronkelijk bericht --------
Van: MattWestb ***@***.***>
Datum: 09-10-2021 08:40 (GMT+01:00)
Aan: zigpy/zha-device-handlers ***@***.***>
Cc: Michel Pluijm ***@***.***>, Author ***@***.***>
Onderwerp: Re: [zigpy/zha-device-handlers] Create Quirk for TS011F (#1057)
ISORT like having the block from zhaquirks.const import ( after line 25 (the last import then its the last in the sorting) and before class TuyaZBMetering(CustomCluster, Metering): ;-(((
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#1057 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ALL5FTJGR3JWG3XKHLV3CULUF7PW7ANCNFSM5FH7WU4A>.
|
Deleting line 27,28 and 29 (they is now not needed). @Adminiuga only in the replacements or? |
Only in replacement. In the signature itself you have options like constants, same way as currently. Alternativele, in the signature you could use |
Sorry i was wrong its reading it from the 2 deleted line (X 28 and 29) so re do it or moving it in to the class and you dont heed using the old names.
But i think its better doing like Adminiuga was writing. |
Final Version
Should be OK now. |
B I N G O O O ! ! ! :-)))) Only need releasing the the change request that was not working (the tuya power on state that is moved to tuya INI) :-)) |
YEEEEH, Finally..! @Adminiuga can you release the change request. I really liked doing this. learned a lot about how ZHA and Quirks work. :) |
Need one more change not matching with:
working with:
|
Then you is getting it loading do you getting the warning you was getting before ? |
@MattWestb But when I use:
the Quirk won't load, so my device poweronstate and divides are not good. |
I think and hope its working OK then in signature having the cluster number and the new classes in the replacement and you is not getting the complains. Testing the quirk that its loading and working OK with the last changes then black and the other tests was OK lats run. The last changes looks OK from my point of view but its not the same it being 110% OK for the system. I think Adminiuga is doing some "Dream Coding" (= sleeping then hi is in US TZ) so must waiting until hi is coming online. |
Feeling Stupid...!!!
shoud be
Tested and Matched. |
THAT I KNOWING !!!
;-)) Great that you was finding it and getting it working. |
Hi @Adminiuga |
Sorry for a newbie question but what is the release path for this change? Will this eventually be part of the Home Assistant ZHA? I really need to get power state restore working with my "TS011F by _TZ3000_mraovvmm" units. I guess for now I should install this "ZHA Device Handlers" extension? And then wait until this quirk is added to that? |
Than all is working OK is the devs merging it to dev branch and you can using it if you like and then its being released in the next HA release if all is going well. For using it before its in HA you can installing by configuring local quirks in HA and adding the new quirk in it #693 (comment). If you is god in coding you can doing one version with the power state and dont need the tuya INI but its little more work. |
Ok, thanks. So even after this has been merged to dev branch, just installing "ZHA Device Handers" extension (and possibly copying 1056+1057 somewhere) is not enough. I am only running one HA in Hassio and don't really want to mess it up. I guess I just have to wait for this to appear in HA. |
|
Thanks @miit86 ! Luck and no luck... I did the following:
But I cannot set the power_on mode to stick. I go to Cluster settings Clusters->OnOffRestorePowerCluster and from Cluster Attributes I select power_on_state (id: 0x8002)-> Get Zigbee attribute returns PowerOnState:Off. I try to set Manufacturer Code Override to 1 or 2 (I think they are On and LastState) but Getting the value again gives None |
Don set manifacturer attribute.
Use 0,1 or 2 on zigbee atrribute and click on set attribute
Verzonden vanaf mijn Galaxy
…-------- Oorspronkelijk bericht --------
Van: lemppari ***@***.***>
Datum: 15-10-2021 18:57 (GMT+01:00)
Aan: zigpy/zha-device-handlers ***@***.***>
Cc: Michel Pluijm ***@***.***>, Mention ***@***.***>
Onderwerp: Re: [zigpy/zha-device-handlers] Create Quirk for TS011F (#1057)
Thanks @miit86<https://github.com/miit86> !
Luck and no luck...
I did the following:
1. Installed the development library as described in https://github.com/zigpy/zha-device-handlers using the version 0.0.62 as it is the latest.
2. Created the file TS011F_plug.py from your comment above and put it to /config/deps/lib/python3.9/site-packages/zhaquirks/tuya directory, emptied pycache and restarted HA.
3. Removed and added my device again
4. Looking at the device, it is using the quirks version"Quirk: zhaquirks.tuya.TS011F_plug.Plug"
But I cannot set the power_on mode to stick. I go to Cluster settings Clusters->OnOffRestorePowerCluster and from Cluster Attributes I select power_on_state (id: 0x8002)-> Get Zigbee attribute returns PowerOnState:Off. I try to set Manufacturer Code Override to 1 or 2 (I think they are On and LastState) but Getting the value again gives None
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#1057 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ALL5FTKXUMAOXQ6TM4ANJVDUHBMOLANCNFSM5FH7WU4A>.
|
That did the trick, thank you so much! Thanks for MattWestb too! So next step for this in the official release path is to be included in some future version of zha-device-handlers (0.0.6?). Then from that to the HA general release. Until that I have to remember to check the status of quirk after updating HA. And after HA gets this by default I can remove zha-device-handlers (unless I want to start digging into zha myself... ;) ) |
With the quirk i provided you didnt need the zha device handlers pack.
The quirk doesnt need init for poweronstate.
The quirk for the pull request is a bit different.
It needs the poweronstate from init.
Thats because more plugs are using the same poweronstate class
Its better to use the custom quirk folder.
1. Set custom quirk folder in configuration.yaml
2. Create corresponding folder in config.
3. Copy quirk
4. Reboot
Verzonden vanaf mijn Galaxy
…-------- Oorspronkelijk bericht --------
Van: lemppari ***@***.***>
Datum: 15-10-2021 19:17 (GMT+01:00)
Aan: zigpy/zha-device-handlers ***@***.***>
Cc: Michel Pluijm ***@***.***>, Mention ***@***.***>
Onderwerp: Re: [zigpy/zha-device-handlers] Create Quirk for TS011F (#1057)
That did the trick, thank you so much! Thanks for MattWestb too!
So next step for this in the official release path is to be included in some future version of zha-device-handlers (0.0.6?). Then from that to the HA general release. Until that I have to remember to check the status of quirk after updating HA. And after HA gets this by default I can remove zha-device-handlers (unless I want to start digging into zha myself... ;) )
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#1057 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ALL5FTLGTASV35ZCK5JXN7TUHBOZHANCNFSM5FH7WU4A>.
|
The power state in INI is merged in dev and very likely is this also going in dev very soon then all test is OK and its working. If its working its better waiting until next release of HA it shall being inside it if all is going OK and you dont need doing and changes and done need deleting / changing any things. |
YEEEH..! Thanks Guys |
GREAT work done !! And now you can doing changes in your PRs and the tests is being triggered automatic as long no change request is made :-)) Some more device in the pipe that need more hacking attention ? |
Quirk for the TS011F
See Issue #1045