-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
TuyaMCU Update 1/3 #9769
TuyaMCU Update 1/3 #9769
Conversation
Is there any reason not to use a name like The current naming could interfere with other commands. If it's no issue I'll change it to
|
Make sense, please update it. |
Tnx. WOrking on it now. |
Add commands ``TuyaRGB``, ``TuyaEnum`` and ``TuyaEnumList`` (#9769)
{"TuyaEnumList":{"TuyaEnum1":8,"TuyaEnum2":9,"TuyaEnum3":7, "TuyaEnum4":3}}
Edit: 13:13:47 MQT: stat/tasmota_49A3BC/RESULT = {"TuyaEnum":{"Enum1":0,"Enum2":0,"Enum4":0}} 13:15:40 MQT: stat/tasmota_49A3BC/RESULT = {"TuyaEnumList":{"Enum1":8,"Enum2":9,"Enum4":3}} |
PR description updated with the new syntax. |
Thx. Yes I couldn't test the enum commands by lack of Tuya hardware but I expected it not to be a problem as you noticed too. I think it's about time I get tuya based hardware too ;-) |
You don't need to buy a device to play with a tuyaMCU, all the code was made using an emulator. ;-) |
I love it! |
no worries, i'll test it :P |
Changelog
TUYA_MCU_FUNC_FAN3
toTUYA_MCU_FUNC_FAN6
/stat
topicEnums management:
Tasmota has now more control over the Type 4 enum. Up to four can be added, with a range from
0
to9
.Functions:
New commands for enums:
After an enum is configured, use
EnumList
to declare the range it must respect, please note0
is always the first item in range.Usage:
TuyaEnumlist [1|2|3|4],[0|1|2|3|4|5|6|7|8|9]
Example: configure Enum 1 with a range from 0 to 8.
Warning: Entering a value greater than
9
will return an error.Tip:
TuyaEnumList
without payload will return the configuration of all the enums enabled in the list.To update an enum use the command
TuyaEnum
:Usage
TuyaEnum [1|2|3|4],[value in EnumList range]
Example: update Enum 2 to 4.
Warning: Entering a value not in range will return an error.
Tip:
TuyaEnum
without payload will return the state of all the enums configured.RGB color management:
TuyaMCU uses two types of RGB Hex format where the most recent is
0HUE0SAT0BRI0
(type 1) and the older beingRRGGBBFFFF6464
(type 2).Depending on the MCU code both can be case sensitive.
After enabling the RGB function check the
TuyaReceived
information and useTuyaRGB
to configure and store the correct (or the closest) format:TuyaRGB 0
: Type 1 - 12 characters uppercase - Example:00DF00DC0244
(default)TuyaRGB 1
: Type 1 - 12 characters lowercase - Example:008003e8037a
TuyaRGB 2
: Type 2 - 14 characters uppercase - Example:00FF00FFFF6464
TuyaRGB 3
: Type 2 - 14 characters lowercase - Example:00e420ffff6464
Tip:
TuyaRGB
without payload will return the actual configured format.Warning: Tuya left to the manufacturer the ability to personalize the payload for custom product, Tasmota can't comply with all possible protocols for color. If your device doesn't work there isn't much else to do.
Optional State topic:
The togglable topic (
Tuyasend9
) was updated to a more meaningful one.Before:
After:
Related issue (if applicable): fixes somehow #9737
Checklist:
patch: https://patch-diff.githubusercontent.com/raw/arendst/Tasmota/pull/9769.patch
diff: https://patch-diff.githubusercontent.com/raw/arendst/Tasmota/pull/9769.diff
NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass