-
Notifications
You must be signed in to change notification settings - Fork 934
Add the onoff attribute cluster to ts004f #4537
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
These attributes are not available on the output side, only on the input side. This fixes warnings about direction being wrong on the onoff cluster, since the onoff cluster was removed on the input side.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #4537 +/- ##
=======================================
Coverage 92.28% 92.28%
=======================================
Files 371 371
Lines 12158 12163 +5
=======================================
+ Hits 11220 11225 +5
Misses 938 938 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@MattWestb Do you remember why you added this attributes to the output side of this cluster? The rotation events seem to come from the output cluster, but the attribute data is on the input cluster. Feel like we should remove those attributes from the output cluster (TuyaSmartRemoteOnOffCluster) |
|
This looks like it should not be a complete OnOff cluster on input here, since not all attributes are supported on input and we end up creating a switch entity. |
|
This will depend on zigpy/zha#590 |
|
Hej du glade !! Im not one code worrier and more "copy and paste / try and fail" but we was starting with the dimmer switch that is only having the short and long press commands but it was one long road getting there. Next was the rotating knob that we was decoding and only adding the new commands it was sending and it was looking working OK but no deep diving so more then likely it can being in wrong direction like tuya oft have done. In the end the deleting the On/Of in cluster so THA is not doing one light in the GUI. I have one dimmer switch and one rotating knob so can doing testing and sniffing if you need more info for debugging the problem. |
|
Anyway you can test reading writing of the switch mode on any of the devices you have? And see if you get any data from that attribute when it's on output endpoint? I cant get that to work on any of the ts004f. (I would like to remove it from the output cluster if possible) |
|
Was reading all attributes on Clusters: Edit: Writing 0 or 1 say OK but no working mod not changed on the device and no attribute changed in ZHA log. |
|
Good then it looks like it works same as I see it. If you also add the onoff cluster or the attribute cluster on input side it works. (The events still must be on output side) Maybe there was some compatibility that switches direction of a cluster command that was removed (the warning that is logged). |
|
The TS004X devices is having the same defect (and some other tuya devices) so i think they is also have lost some functionality from ZHA but still working on the device then its possible doing it. |
Proposed change
These attributes are not available on the output side, only on the input side.
This fixes warnings about direction being wrong on the onoff cluster, since
the onoff cluster was removed on the input side.
Additional information
I have tested reading of the switch_mode attribute from this, which now works as expected.
Depends on: zigpy/zha#591 to ensure the OnOff cluster does not end
up adding a switch entity.
Depends on: zigpy/zha#590 to make sure this is added as a select entity
Device diagnostics
Checklist
pre-commitchecks pass / the code has been formatted using Black