logo elektroda
logo elektroda
X
logo elektroda

Configuration Issues with Tuya S1-B-WT Triac Dimmer after OBK Firmware Flashing

andyc1 3465 33
ADVERTISEMENT
  • #1 20649501
    andyc1
    Level 3  
    Configuration Issues with Tuya S1-B-WT Triac Dimmer after OBK Firmware Flashing Hello,
    I have a Tuya generic S1-B-WT triac dimmer which I have successfully flashed with the latest OBK firmware.
    I can navigate to the device IP address and can launch the web application. There is a cloudcutter profile available but when I paste it into the import section of the app, it doesn't seem to generate any useful script. I've been through the 3-step import process and restarted the device, but nothing happens. Here is the JSON code:
    Code: JSON
    Log in, to see the code


    I'm completely new to this sort of stuff and have no idea how to configure it manually or how to interpret this code.
    Can anyone help?

    Thanks

    Update.

    After reading this post : https://www.elektroda.com/rtvforum/topic3898502.html I thought that maybe my device has a TuyaMCU. So I copied the autoexec.bat script from that post and added it via the file system tab. I now have an on/off switch I can toggle and a dimmer slider on the main page. Unfortunately these do not actually make the device do anything, the light connected to the device doesn’t come on.
    Is there anything else I should do?
    Again, I’m a complete beginner so my understanding is minimal.
  • ADVERTISEMENT
  • #2 20652080
    p.kaczmarek2
    Moderator Smart Home

    Hello, can you extract OBK config that way:
    https://www.youtube.com/watch?v=WunlqIMAdgw
    so I can determine whether it's TuyaMCU and check the baud rate used?

    Still, by judging from the CC profile, it kinda looks like TuyaMCU, but at a higher baud rate than the device you linked, so no wonder it didn't work...
    Helpful post? Buy me a coffee.
  • #4 20652300
    p.kaczmarek2
    Moderator Smart Home
    The binary you have attached confirms the data from CC profile:
    Code: JSON
    Log in, to see the code

    Please try following autoexec.bat:
    
    startDriver TuyaMCU
    tuyaMcu_defWiFiState 4
    tuyaMcu_setBaudRate 115200
    

    Reboot, then open Web App log, and try pressing the button, changing brightness, etc, etc, and copy the web app log here so we can see which dpIDs are received by OBK.

    EDIT: You could also try to guess dpIDs, maybe they still have dpID 1 for switch and 2 for dimmer, if that's the case, then try:
    
    startDriver TuyaMCU
    tuyaMcu_defWiFiState 4
    tuyaMcu_setBaudRate 115200
    
    // not sure about those ids:
    
    setChannelType 1 toggle
    setChannelType 2 dimmer
    tuyaMcu_setDimmerRange 0 1000
    linkTuyaMCUOutputToChannel 1 1 1
    linkTuyaMCUOutputToChannel 2 2 2
    
    
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #5 20654116
    andyc1
    Level 3  
    Hello,
    I've copied the autoexec.bat to the device with your suggestion of trying dpId 1 for switch and dpId 2 for dimmer again. The device still doesn't work, however.
    Here is the log after I've toggled the switch and moved the dimmer :

    Info:MAIN:Time 737, idle 266616/s, free 84936, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 738, idle 256722/s, free 84936, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 739, idle 252465/s, free 84936, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 740, idle 256624/s, free 84936, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 741, idle 261507/s, free 84936, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 742, idle 261891/s, free 84936, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 743, idle 263425/s, free 84936, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 744, idle 254676/s, free 84712, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 3/38
    Info:MAIN:Time 745, idle 256978/s, free 84936, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 746, idle 256964/s, free 84936, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 747, idle 249703/s, free 84936, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 748, idle 253313/s, free 84936, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 749, idle 256125/s, free 84936, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 750, idle 516447/s, free 84936, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 751, idle 252728/s, free 84936, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 752, idle 256741/s, free 84936, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 753, idle 256820/s, free 76320, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 3/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 754, idle 258886/s, free 84936, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 755, idle 248278/s, free 84936, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MQTT:Channel has changed! Publishing 0 to channel 1
    Info:MQTT:Publishing val 0 to extension_1/1/get retain=0
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic extension_1/1/get
    Info:MAIN:Time 756, idle 254900/s, free 84936, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MQTT:Channel has changed! Publishing 1 to channel 1
    Info:MQTT:Publishing val 1 to extension_1/1/get retain=0
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic extension_1/1/get
    Info:MAIN:Time 757, idle 250274/s, free 84936, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 758, idle 258054/s, free 84936, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MQTT:Channel has changed! Publishing 0 to channel 1
    Info:MQTT:Publishing val 0 to extension_1/1/get retain=0
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic extension_1/1/get
    Info:MAIN:Time 759, idle 247987/s, free 84936, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MQTT:Channel has changed! Publishing 1 to channel 1
    Info:MQTT:Publishing val 1 to extension_1/1/get retain=0
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic extension_1/1/get
    Info:MAIN:Time 760, idle 254244/s, free 84728, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 761, idle 249814/s, free 84936, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MQTT:Channel has changed! Publishing 9 to channel 2
    Info:MQTT:Publishing val 9 to extension_1/2/get retain=0
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic extension_1/2/get
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 762, idle 259644/s, free 84936, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MQTT:Channel has changed! Publishing 20 to channel 2
    Info:MQTT:Publishing val 20 to extension_1/2/get retain=0
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic extension_1/2/get
    Info:MAIN:Time 763, idle 252325/s, free 84936, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 764, idle 254945/s, free 84936, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MQTT:Channel has changed! Publishing 58 to channel 2
    Info:MQTT:Publishing val 58 to extension_1/2/get retain=0
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic extension_1/2/get
    Info:MAIN:Time 765, idle 255425/s, free 84936, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MQTT:Channel has changed! Publishing 81 to channel 2
    Info:MQTT:Publishing val 81 to extension_1/2/get retain=0
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic extension_1/2/get
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 766, idle 252698/s, free 84936, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 767, idle 253144/s, free 84936, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 768, idle 254858/s, free 84936, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 769, idle 256429/s, free 84936, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 770, idle 251833/s, free 84712, MQTT 1(2), bWifi 1, secondsWithNoPing 1, socks 3/38
  • #6 20654184
    p.kaczmarek2
    Moderator Smart Home

    Did you toggle the dimmer by using a physical switch? There is no toggling in log.

    Toggling the dimmer on the web page will not help.

    You need to attach a physical switch to the device like in the Tuya manual and use it to adjust the dimmer mode. Then copy the log here.
    Helpful post? Buy me a coffee.
  • #7 20654204
    andyc1
    Level 3  
    Do you mean wire in a standard dimmer switch as in this wiring diagram?
    Configuration Issues with Tuya S1-B-WT Triac Dimmer after OBK Firmware Flashing
    If not, please explain.
    What should I look for in the log to check I've done it correctly?
  • #8 20654210
    p.kaczmarek2
    Moderator Smart Home
    Yes, wire it as on manual.

    Your log currently shows that TuyaMCU works:
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    

    Text above was copied from your log. But we need to know dpIds.

    So something like:
    
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 7, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 07 00 05 01 01 00 01 01 0F 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 1, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 01 01 

    You need to know which dpID is brightness (0 to 1000 value) and which is toggle (1 or 0).

    See related topic: https://www.elektroda.com/rtvforum/topic3971440.html
    Helpful post? Buy me a coffee.
  • #9 20654276
    andyc1
    Level 3  
    Info:MAIN:Time 120, idle 255798/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38

    Info:GEN:sta: 1, softap: 0, b/g/n

    Info:MAIN:Time 121, idle 256285/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 122, idle 257517/s, free 84720, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 3/38
    Info:MAIN:Time 123, idle 261994/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 124, idle 259182/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 125, idle 258917/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 126, idle 259142/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 127, idle 252645/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 128, idle 509759/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 129, idle 275874/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 130, idle 260798/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38

    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:MAIN:Time 131, idle 248198/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 132, idle 257561/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 133, idle 260344/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 134, idle 277193/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 135, idle 253442/s, free 76328, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 3/38
    Info:MAIN:Time 136, idle 266841/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 137, idle 264837/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 14 01 00 01 01 25
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 20, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 16 02 00 04 00 00 03 E8 18
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 22, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 1000
    Info:MAIN:Time 138, idle 254529/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 139, idle 240308/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 140, idle 268222/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38

    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:MAIN:Time 141, idle 255353/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 142, idle 261834/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 143, idle 253031/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 144, idle 260330/s, free 76328, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 3/38
    Info:MAIN:Time 145, idle 259039/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 146, idle 257863/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 147, idle 254984/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 148, idle 524373/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 149, idle 264002/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 150, idle 256541/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38

    Info:GEN:sta: 1, softap: 0, b/g/n
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 14 01 00 01 01 25
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 20, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 16 02 00 04 00 00 03 E8 18
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 22, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 1000
    Info:MAIN:Time 151, idle 252131/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 152, idle 241174/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 153, idle 258513/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 154, idle 259229/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 155, idle 251885/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38
    Info:MAIN:Time 156, idle 269107/s, free 84936, MQTT 1(4), bWifi 1, secondsWithNoPing 1, socks 2/38
  • ADVERTISEMENT
  • #10 20654338
    p.kaczmarek2
    Moderator Smart Home

    This means dpID 20 is a boolean toggle on and off, and the dpID 22 is a value - dimmer state.

    Please change the dpIDs in autoexec.bat to reflect your device configuration.

    Reminder:


    linkTuyaMCUOutputToChannel dpId varType tgChannel

    Helpful post? Buy me a coffee.
  • #11 20654390
    andyc1
    Level 3  

    Yes, it works!
    Thank you very much for your help, I've learned a lot today.
    I'm going to try integrating into Home Assistant next, hopefully auto discovery will work okay because I don't know anything about YAML (yet).
  • #12 20654465
    p.kaczmarek2
    Moderator Smart Home

    Thank you, now I would like to add your device to our devices list. Can you give me some more information about where it was bought, how it looks like, maybe some screenshots from the seller page or photos of the box...
    https://openbekeniot.github.io/webapp/devicesList.html
    Helpful post? Buy me a coffee.
  • #14 20664674
    andyc1
    Level 3  

    Hello again,
    I have now flashed a further 6 modules of the same type and integrated all into Home Assistant. They all seem to work fine except for one issue.
    The modules can be switched on independently from Home Assistant via wall switches that operate via radio frequency.
    When I turn on/off the original module via the wall switch, the module's state correctly shows as "on"/"off" in HA and also in the OBK web app. The dimming level is also correctly shown.
    This does not work with the other 6 modules, i.e. if I switch them on/off via their wall switch, the "on"/"off" state is not reflected correctly within HA or the OBK app.
    If I restart the modules via the OBK web app, then their "on"/"off" state changes within the OBK web app and HA to correctly show their actual state.
    Once I use their wall switches again, however, the correct state is lost and I have to restart the modules again.
    I'm not aware that I have configured these modules any differently from the original one that works correctly.
    What might the problem be?
  • #15 20664687
    p.kaczmarek2
    Moderator Smart Home
    If a state change from physical button (or from RF) does not show in OBK app, this can mean that you haven't configured TuyaMCU correctly.

    Are you able to control those switches from OBK panel? Is the communication broken just in one direction, or is there no communication at all?

    Please try opening Web App Log and then changing physical switch state. Is the TuyaMCU packet for given dpID change received by OpenBeken?
    Helpful post? Buy me a coffee.
  • #16 20664783
    andyc1
    Level 3  

    I can confirm that I can control ALL switches from the OBK panel both on and off.

    The web log for the switch that works correctly shows that the TuyaMCU packet is received by OBK when the physical switch is used:
    Info: MQTT: Channel has changed! Publishing 1 to channel 1
    Info: MQTT: Channel has changed! Publishing 0 to channel 1

    I tried one of the other switches and the web log does not show this info when the physical switch is activated.
  • #17 20664845
    p.kaczmarek2
    Moderator Smart Home
    How your autoexec.bat looks like on such switch?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #18 20664898
    andyc1
    Level 3  

    For the switch that doesn't work correctly:

    startDriver TuyaMCU
    tuyaMcu_defWiFiState 4
    tuyaMcu_setBaudRate 115200

    setChannelType 1 toggle
    setChannelType 2 dimmer
    tuyaMcu_setDimmerRange 0 1000
    linkTuyaMCUOutputToChannel 20 1 1
    linkTuyaMCUOutputToChannel 22 2 2

    It is the same for the switch that does work correctly although strangely the number of characters is different (217 above, 220 below):

    startDriver TuyaMCU
    tuyaMcu_defWiFiState 4
    tuyaMcu_setBaudRate 115200

    setChannelType 1 toggle
    setChannelType 2 dimmer
    tuyaMcu_setDimmerRange 0 1000
    linkTuyaMCUOutputToChannel 20 1 1
    linkTuyaMCUOutputToChannel 22 2 2
  • #19 20665740
    andyc1
    Level 3  

    I think I may have solved the issue.
    First, I made sure all the devices used the same autoexec.bat as the device that was working.
    Next, I restarted the devices from the web app. This didn't seem to work.
    Finally, I powered off all the devices and then restarted them. This seems to have worked and all switches are now reporting the correct state on the OBK web app and in HA.
  • #20 20665763
    p.kaczmarek2
    Moderator Smart Home
    Hmmm, I wasn't aware of this, but maybe there was some bug in the Tuya MCU itself that caused it to partially skip the initialization of the communication. Still, it's a new thing to me. I always repower my devices after doing config so I didn't know about this problem.

    I am glad to hear you've got it solved.
    Helpful post? Buy me a coffee.
  • #21 20665834
    andyc1
    Level 3  

    Thanks.
    I have one further thing I thought I should mention regarding the flashing procedure.
    The Wi-Fi module is a wb2s. I had read that when flashing it was necessary to short CEN to ground at the "waiting for...." stage to continue the procedure. This did not work for me and in the end, I just had 3v, TX, RX, and Gnd connected and let the script run. This worked fine, and I was able to successfully flash the OBK firmware.
  • #22 20665907
    p.kaczmarek2
    Moderator Smart Home
    There are two way to reboot device:
    - you can short CEN to ground
    - or you can just disconnect and reconnect the power
    Both should work fine, I prefer the latter.
    Helpful post? Buy me a coffee.
  • Helpful post
    #23 20784769
    atomphil
    Level 10  

    p.kaczmarek2 wrote:
    Thank you, now I would like to add your device to our devices list. Can you give me some more information about where it was bought, how it looks like, maybe some screenshots from the seller page or photos of the box...https://openbekeniot.github.io/webapp/devicesList.html


    It is also a device from the Skydance ecosystem: https://www.iskydance.com/index.php?c=product_show&a=index&id=1606

    Perhaps the devices list should be updated.
  • #24 20785588
    p.kaczmarek2
    Moderator Smart Home
    Thank you, that's a very informative find. Futhermore I can see that documentation on the Skydance's site is very detailed, that's nice. Let me post here some screenshots:
    Image of a WiFi-RF dimmer with text on a webpage.
    Image of LED dimmer specifications and features. System wiring diagram with installation and mechanical structure description. Infographic showing features and applications of the Skydance AC TRIAC dimmer with Wi-Fi, RF, and push-button control.
    They even offer a leading edge or trailing edge dimming selection? Nice.
    Helpful post? Buy me a coffee.
  • #25 20799075
    atomphil
    Level 10  

    Thanks to the information in this thread, I was able to install OpenBeken on my S1-B(WT) very easily. Everything works wonderfully, except for one thing:

    In the Home Assistant, the dimmer only reports as a switch and not as a dimmer. What do I need to change to be able to dim in the HA?
  • #26 20799107
    p.kaczmarek2
    Moderator Smart Home
    Please post your current configuration, all available information, and I will try to check what's wrong.

    Alternatively, you can always add the device manually - through the configuration.yaml.
    Helpful post? Buy me a coffee.
  • #27 20799131
    atomphil
    Level 10  

    Thanks for your fast reply. In the Home Assistant, the dimmer only reports as a switch and not as a dimmer, and the signal strength is displayed as an extra sensor and not on the device.

    Home Assistant interface with Bad_Dimm 1 device

    My autoexec.bat:

    startDriver TuyaMCU
    startDriver SSDP
    tuyaMcu_defWiFiState 4
    tuyaMcu_setBaudRate 115200
    PowerSave 1
    setChannelType 1 toggle
    setChannelType 2 dimmer
    tuyaMcu_setDimmerRange 0 1000
    linkTuyaMCUOutputToChannel 20 1 1
    linkTuyaMCUOutputToChannel 22 2 2



    If I write the following in autoexec.bat, I can dim the brightness, and the signal strength is not displayed as an extra sensor (but of course, it shows the full RGBCCT panel, I only need a dimmer slider):

    startDriver TuyaMCU
    startDriver SSDP
    tuyaMcu_defWiFiState 4
    tuyaMcu_setBaudRate 115200
    PowerSave 1
    tuyaMcu_setupLED 24 0
    


    Lighting control interface with brightness slider set to 33%.

    How can I add the device manually through configuration.yaml?
  • #28 20799162
    p.kaczmarek2
    Moderator Smart Home
    The first script should work with HASS Discovery as well too, I need to check that.

    You can check this topic for manual dimmer YAML guide:
    https://www.elektroda.com/rtvforum/topic3898502.html
    Helpful post? Buy me a coffee.
  • #29 20814571
    andyc1
    Level 3  

    Hello,
    I'd like to post an update to my original posts with an issue that cropped up that I have now been able to resolve.

    Whenever Home Assistant was restarted, the state of the devices would change to "unknown" within Home Assistant and I was unable to operate them via HA. I would have to switch them on via the wall switch before their state reported correctly and then dim them for their brightness level to be shown in HA.
    This became quite a problem as it would happen with any power cuts as well as HA updates.

    I eventually solved this within the OBK interface by going to: config/configure general/flags and enabling flag 7 - Always set Retain flag to all published values.

    If anyone has a similar issue, hopefully this will help.
  • #30 20814615
    p.kaczmarek2
    Moderator Smart Home
    Hello @andyc11 , the following issue with potential fixes was also discussed here:
    OpenBeken Devices Displaying Multiple Switch Toggle Icons upon Home Assistant Restart
    Helpful post? Buy me a coffee.

Topic summary

The discussion revolves around configuration issues with the Tuya S1-B-WT triac dimmer after flashing it with OpenBeken (OBK) firmware. The user successfully accessed the device's web application but faced challenges with the cloudcutter profile import, which did not yield a functional script. Various troubleshooting steps were suggested, including verifying the baud rate, using the correct dpIDs for the dimmer and switch, and ensuring proper wiring with a physical switch. After several attempts and adjustments to the autoexec.bat file, the user managed to resolve the issues, enabling the device to function correctly with Home Assistant. Additionally, the conversation touched on flashing procedures and the importance of consistent configurations across multiple devices.
Summary generated by the language model.
ADVERTISEMENT