Tuya platform - bitmask (and ro/rw) handling #3388
Unanswered
Stoatwblr
asked this question in
Component enhancements
Replies: 1 comment
-
|
🏷️ I've automatically added the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Component name
Tuya
Link to component documentation on our website
https://esphome.io/components/tuya/
Describe the enhancement
There is no handler for tuya bitmasks (type 0x5
There IS one in the modbus platform, with samples given at https://esphome.io/components/modbus_controller/#bitmasks
Something similar would be perfect:
eg: (if done as per modbus)
I'm aware that "binary sensor" on Tuya covers booleans, so some form of shoehorning is needed
The alternative is a bunch of lambda handling which seems a wasteful duplicate of resources
Right now the difference between ro and rw is covered by assigning different names and I'm not sure how writeable bitmasks should be handled (ie: register_type, or defining as a switch)
eg:
binary_sensor/switch
sensor/number
Tuya doesn't handle readonly Raw(0x0) or enum(0x4) DPids in any case - this needs fixing too
Use cases
In this instance: it's alarm decoding, but I have a portable AC with similar requirements for settings
Regarding the ro/rw issue: attempting to write back to readonly enum or raw items makes for a messy interface panel or a lot of cpu-sapping lambdas reinventing what's already there
Anything else?
No response
Beta Was this translation helpful? Give feedback.
All reactions