-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Tuya mcu support #6353
Tuya mcu support #6353
Conversation
More and more Tuya MCU based devices are coming in the market and people requesting to support them. This patch makes Tuya module more configurable and easier to add new functionalities. Its not just a dimmer or a switch anymore. After this Patch Tuya MCU module has a list of supported functions and the user would need to map the functionId to dpId of their device. Once mapped correctly the Tuya module will take care for handling proper function for dpId. Currently functions supported are 1. Relays1 to 8 : FunctionID 11 to 18 2. Dimmer : FunctionID 21 3. Power ( Deca Watt ) : Function ID 31 4. Current ( milli Amps ) : Function ID 32 5. Voltage ( deca Volts ) : Function ID 33 The changes are - Use a TuyaMCU command to map DPs to Functions instead of many different SetOptions. SetOption41, 44, 45, 46, 65 won't be needed after this patch. - TuyaMCU command takes argument like `11,1` which means Map Function id 11 (Relay1) to DPID 1 - Migrates old settings flags and options to new TuyaMap command
Many Thx |
@arendst : Thanks for merging this in. Given that this is now merged, I would suggest removal of SetOption41, 44, 45, 46, 65 in next stable development release. Given that SetOption 44, 45, 46 were added in 6.6.0.8+, these can be easily dropped. |
Right. I will investigate the consequences and get rid of them ASAP to make the user base as small as possible. |
While preparing for clean up I came across Shouldn't they be replaced by the new functionality? If not then SetOption65 is still needed. |
Redesign Tuya support by Shantur Rathore (#6353)
Yes, |
Cleaned up in #6355 |
@shantur this did work for some period, I left it alone for a while and the MCU stopped responding, is this a known issue? how can I help debug this? |
Are you planning support for 2 channel tuya mcu dimmer? |
@blackscreener : Open a new issue and post some logs |
Description:
More and more Tuya MCU based devices are coming in the market and people requesting to support them. This patch makes Tuya module more configurable and easier to add new functionalities. Its not just a dimmer or a switch anymore.
After this Patch Tuya MCU module has a list of supported functions and the user would need to map the functionId to dpId of their device. Once mapped correctly the Tuya module will take care for handling proper function for dpId.
Currently functions supported are
The changes are
11,1
which means Map Function id 11 (Relay1) to DPID 1Tuya Dimmer
module toTuya MCU
A wiki page for new Tuya MCU implementation will be created once this PR is merged in.
As per plan each SetOption can be removed as well after this goes in.
Related issue (if applicable): fixes #6319
Checklist: