-
Notifications
You must be signed in to change notification settings - Fork 738
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
Add support for Tuya single button scene switch variant TS0041A
#2363
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #2363 +/- ##
==========================================
+ Coverage 85.05% 85.34% +0.28%
==========================================
Files 266 271 +5
Lines 8425 8520 +95
==========================================
+ Hits 7166 7271 +105
+ Misses 1259 1249 -10 ☔ View full report in Codecov by Sentry. |
Thats interesting its one |
Do you think it would be smart to add vendor specific data to the class ( _TYZB01_4qw4rl1u) to avoid mispairings? |
I think it shall being in this quirk then its the same functionality as all other TS0041. We have not seen any TS004X that need model info matching and all is working well if the cluster / end points is matching OK with exception for the TS004F that is one different story and if its needed we is implanting it later for getting all working the same way. |
TS0041A
zhaquirks/tuya/ts0041.py
Outdated
TuyaSmartRemoteOnOffCluster, | ||
], | ||
OUTPUT_CLUSTERS: [ | ||
TuyaSmartRemoteOnOffCluster, |
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.
Are both clusters used by that remote?
Or is replacing one OnOff
cluster enough?
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.
There is only one button, but i really dont know why it has one input and one output OnOff cluster.
It does not throw any errors or warnings as it is now, but We could try with replacing only one.
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.
Its one tuya thing and deleting it in replacement is making ZHA not making on switch in the GUI that is not working (at least for TS004F devices).
Testing if it working without it and its still sending commands OK and not getting problems / delays with fast key pressings.
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.
@TheJulianJES From testing and the device signature, it seems like both clusters has to be replaced. Works fine here.
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.
So when only one cluster is replaced, it doesn’t work?
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.
Try leaving it out completely, so you have just one Tuya OnOff cluster.
(If one doesn’t work, try the other one.)
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.
I thought that the number of output clusters must match the number in the device signature, otherwise it will fail loading the quirk. This is my proposed replacement:
replacement = {
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.ON_OFF_SWITCH,
INPUT_CLUSTERS: [
Basic.cluster_id,
PowerConfiguration.cluster_id,
TuyaSmartRemoteOnOffCluster,
],
OUTPUT_CLUSTERS: [
OnOff.cluster_id,,
Time.cluster_id,
Ota.cluster_id,
],
},
},
}
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.
The above code is the only one that is working reliably. PR has been updated with tuya cluster in only the input cluster.
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.
Ar you getting one switch in ZHA GUI then having it as input cluster after restarting HA ?
All TS004X is having problems with the dealt response shall being sent the wrong way or the device is making one pause between commands if making more fast. But it can being different with the A version you is having.
I have making one issue for sending it in the wrong detection but its not solved yet.
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.
This replacement/quirk does not provide the switch entity in the GUI as previous versions did.
If you have used a previous version, you will have to delete the switch entity manually as it is no longer provided by the integration, it will still be there after a restart if not deleted manually.
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. Thank you for your contributions. |
How about pulling this one? It works as it should. I am currently using this custom quirk. |
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.
LGTM, thanks!
Proposed change
Added support for variant TS0041A
Additional information
Sold as Cleverio in Sweden/Norway
https://www.kjell.com/no/produkter/smarte-hjem/smarte-hjem-losninger/cleverio-smarte-hjem/cleverio-multifunksjonsknapp-med-zigbee-3.0-p51830
Blueprint here:
https://community.home-assistant.io/t/zha-cleverio-tuya-1-button-scene-switch-ts0041a-tyzb01-4qw4rl1u/552120
Checklist
pre-commit
checks pass / the code has been formatted using Black