Skip to content
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

Closed
blackscreener opened this issue Jun 11, 2020 · 4 comments · Fixed by #9330
Closed

Support for 2 channel Tuya MCU dimmer #8663

blackscreener opened this issue Jun 11, 2020 · 4 comments · Fixed by #9330
Assignees
Labels
enhancement Type - Enhancement that will be worked on fixed Result - The work on the issue has ended

Comments

@blackscreener
Copy link

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:

ACTION Frame Header Version Command Word Data Length dpID Data Type Function Length Function Command Verification Method
1 ON 55aa 00 06 0005 01 01 0001 01 0e
1 OFF 55aa 00 06 0005 01 01 0001 00 0d
1 dim10 55aa 00 06 0008 02 02 0004 00000065 7a
1 dim20 55aa 00 06 0008 02 02 0004 000000c3 d8
1 dim30 55aa 00 06 0008 02 02 0004 00000127 3d
1 dim40 55aa 00 06 0008 02 02 0004 0000018b a1
1 dim50 55aa 00 06 0008 02 02 0004 000001ef 05
1 dim60 55aa 00 06 0008 02 02 0004 0000025b 72
1 dim70 55aa 00 06 0008 02 02 0004 000002be d5
1 dim80 55aa 00 06 0008 02 02 0004 0000031d 35
1 dim90 55aa 00 06 0008 02 02 0004 00000381 99
1 dim100 55aa 00 06 0008 02 02 0004 000003e8 00
2 ON 55aa 00 06 0005 07 01 0001 01 14
2 OFF 55aa 00 06 0005 07 01 0001 00 13
2 dim10 55aa 00 06 0008 08 02 0004 00000061 7c
2 dim20 55aa 00 06 0008 08 02 0004 000000c3 de
2 dim30 55aa 00 06 0008 08 02 0004 00000129 45
2 dim40 55aa 00 06 0008 08 02 0004 0000018d a9
2 dim50 55aa 00 06 0008 08 02 0004 000001ef 0b
2 dim60 55aa 00 06 0008 08 02 0004 00000254 71
2 dim70 55aa 00 06 0008 08 02 0004 000002b9 d6
2 dim80 55aa 00 06 0008 08 02 0004 0000031e 3c
2 dim90 55aa 00 06 0008 08 02 0004 00000380 9e
2 dim100 55aa 00 06 0008 08 02 0004 000003e8 06

xdrv_16_tuyamcu.zip

@ascillato2 ascillato2 added the feature request (devs?) Action - awaiting response from developers label Jun 11, 2020
@blackscreener blackscreener mentioned this issue Jun 14, 2020
6 tasks
@stale
Copy link

stale bot commented Jul 6, 2020

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.

@stale stale bot added the stale Action - Issue left behind - Used by the BOT to call for attention label Jul 6, 2020
@strongset
Copy link

There is any version with this request included?

@stale stale bot removed the stale Action - Issue left behind - Used by the BOT to call for attention label Jul 6, 2020
@effelle effelle self-assigned this Jul 30, 2020
@stale
Copy link

stale bot commented Aug 29, 2020

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.

@stale stale bot added the stale Action - Issue left behind - Used by the BOT to call for attention label Aug 29, 2020
@effelle
Copy link
Contributor

effelle commented Aug 29, 2020

Hold on.

@stale stale bot removed the stale Action - Issue left behind - Used by the BOT to call for attention label Aug 29, 2020
@effelle effelle mentioned this issue Sep 16, 2020
6 tasks
@effelle effelle linked a pull request Sep 16, 2020 that will close this issue
6 tasks
@ascillato2 ascillato2 added enhancement Type - Enhancement that will be worked on fixed Result - The work on the issue has ended and removed feature request (devs?) Action - awaiting response from developers labels Nov 18, 2020
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants