-
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
Support for 2 channel Tuya MCU dimmer #8663
Labels
enhancement
Type - Enhancement that will be worked on
fixed
Result - The work on the issue has ended
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
There is any version with this request included? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hold on. |
Merged
6 tasks
This was referenced Feb 12, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
Type - Enhancement that will be worked on
fixed
Result - The work on the issue has ended
Have you looked for this feature in other issues and in the docs?
Yes
Is your feature request related to a problem? Please describe.
Default implementation of tuya mcu api in xdrv_16_tuyamcu.ino support only dimmer with one channel. Also we need two brightness sliders in web interface,
Describe the solution you'd like
Support for two brightness sliders in web interface when fnId: 22 (2nd dimmer) is define with non zero dpId. I tried to add TUYA_MCU_FUNC_DIMMER2 to xdrv_16_tuyamcu.ino but workaround with two sliders from PWM dimmer sends dim command to 2 channels. Also input from button send on/off state to 2 channels. Likely bad executecommand in:
if (fnId == TUYA_MCU_FUNC_DIMMER2) { //2 channel AddLog_P2(LOG_LEVEL_DEBUG, PSTR("TYA: 2CH RX Dim State=%d"), packetValue); Tuya.new_dim2 = changeUIntScale(packetValue, 0, Settings.dimmer_hw_max, 0, 100); if (Tuya.ignore_dimmer_cmd_timeout2 < millis()) { if ((power || Settings.flag3.tuya_apply_o20) && // SetOption54 - Apply SetOption20 settings to Tuya device (Tuya.new_dim2 > 0) && (abs(Tuya.new_dim2 - Settings.light_dimmer) > 1)) { Tuya.ignore_dim2 = true; snprintf_P(scmnd, sizeof(scmnd), PSTR(D_CMND_DIMMER "3 %d"), Tuya.new_dim2 ); ExecuteCommand(scmnd, SRC_SWITCH); } }
Describe alternatives you've considered
Additional context
DpID's for MS-105B: 2 Gang Dimmer Switch:
dpID 1 - on, off 1 ch
dpID 2 - dimmer 1 ch
dpID 7 - on, off 2 ch
dpID 8 - dimmer 2 ch
Logs from @LukevdPalen:
xdrv_16_tuyamcu.zip
The text was updated successfully, but these errors were encountered: