logo elektroda
logo elektroda
X
logo elektroda

Treatlife DS01 Dimmer TuyaMCU dpIDs and autoexec.bat config for OpenBK

ShellDude 1923 17
Best answers

Can I use OpenBeken on a Treatlife DS01 dimmer with a WB3S module, and what TuyaMCU/dpID autoexec.bat settings are needed?

Yes—this Treatlife DS01 dimmer works in OpenBeken as a TuyaMCU device over the UART link, and it does not need GPIO configuration if the MCU is handling the controls [#20760747][#20760726] Use 9600 baud; the earlier 115200 setting broke communication, and the working setup was `startDriver TuyaMCU`, `tuyaMcu_setBaudRate 9600`, `setChannelType 1 toggle`, `linkTuyaMCUOutputToChannel 1 1 1`, `setChannelType 2 dimmer`, `tuyaMcu_setDimmerRange 14 1000`, `linkTuyaMCUOutputToChannel 2 2 2`, and `tuyaMcu_defWiFiState 4` [#20760778][#20760726] The thread also found that dpId 4 is the dimming mode with values 0/1/2, and dpId 3 is the minimum dimming level with a valid range of 10–1000, which OBK may expose if needed [#20760828]
Generated by the language model.
ADVERTISEMENT
  • #1 20760096
    ShellDude
    Level 4  
    Posts: 10
    My apologies in advance if this has been covered before.

    I have a Treatlife DS01-Dimmer wall outlet with a WB3S controller I would like to free from Tuya and use with HA directly over MQTT.

    I have been unable to locate anything here, or generally, that states whether or not I can use OpenBeken with it.

    I have the switch torn down at the moment and have been able to locate all the proper pins / etc.

    It appears this device used to use a Tuya ESP module and was swapped out for the WB3S at some point as Tasmota has a template for it with an ESP8266.

    It has visual similarities with the DS02/DS03 referenced in the Beken device database but is basically a binary on/off and tactile slider type dimmer.

    Any pointers would be greatly appreciated!
  • ADVERTISEMENT
  • #2 20760180
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14405
    Help: 650
    Rate: 12336
    Hello, I think it should work, it will be most likely a TuyaMCU device like many others that we have already supported. We can give it a try. Flash a single piece for a start.

    Please provide more information if you can and we'll try to setup it together.
    Helpful post? Buy me a coffee.
  • #3 20760191
    ShellDude
    Level 4  
    Posts: 10
    I made a ton of progress on this tonight. OpenBeken is flashed. I couldn't get the Windows Flasher to work but a 3rd party python one worked just fine. This could be for a number of reasons (Windows arm VM on a MacBook, flakey uart drivers, etc).

    I found a template for it as well in the cloudcutter repo, applied it, created an autoexec.bat, and just finished putting it all back together.

    It's getting late here so I'll pick back up in the morning by reconnecting it to my mains power and see how things go.

    This is awesome. I had originally thought it was an esp chip and was all prepped to flash tasmota but once I got a good look at the board, I had to quickly scramble -- and found OpenBeken!

    Will report back here if I find myself needing help. I've got one more of these I need to flash and a binary (non-dimmer) version to do as well.

    I'll be sure to follow the guidelines for publishing a legitimate template for them assuming everything works out
  • #4 20760224
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14405
    Help: 650
    Rate: 12336
    I am happy to hear that it worked out for you. Did you also force the WiFi state 0x04, which is required by some devices which do not want to function unless they think that they are connected to the cloud?
    You can see some examples in our docs:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/README.md
    I will be making a generic TuyaMCU guide soon, so futher users should have the process even easier with the new guidance.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #5 20760240
    ShellDude
    Level 4  
    Posts: 10
    I did find that have it in my autoexec.

    I'm pretty sure I'm going to have to configure the pin roles. While the template I used created two channels, all ports are undefined in GPIO Doctor.

    Looking at the board pwm0, and pwm3 are soldered.
  • ADVERTISEMENT
  • #6 20760245
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14405
    Help: 650
    Rate: 12336
    Wait, the Tuya device can be either TuyaMCU or GPIO-based. I haven't seen any device requiring both TuyaMCU driver and GPIO configuration.

    You can check if your device is TuyaMCU very easily. Just do the GPIO extraction:
    https://www.youtube.com/watch?v=WunlqIMAdgw&ab_channel=Elektrodacom
    Helpful post? Buy me a coffee.
  • #7 20760645
    ShellDude
    Level 4  
    Posts: 10
    Here's what i got back:

    Quote:
    Sorry, no meaningful pins data found. This device may be TuyaMCU or a custom one with no Tuya config data.
    No module information found.
    And the Tuya section starts at UNCOMMON POSITION 0


    I also noticed the following in the log when using the DS02S autoexec.bat

    Info:TuyaMCU:Consumed 255 unwanted non-header byte in Tuya MCU buffer
    Info:TuyaMCU:Skipped data (part) 00 FE 00 FE 00 FE 00 FE 00 FE 00 00 F0 00 FE 00 FE 00 FE 00 FE 00 00 00 00 00 00 00 F0 00 FE 00 00 00 00 00 00 FE 00 00 00 00 00 00 00 00 00 00 00 FE 00 00 00 00 00 00 00 00 00 00 00 00 F0 00 00 00 00 00 00 00 F0 00 00 F0 00 00 00 00 00 00 00 F0 00 00 00


    And my autoexec:

    startDriver TuyaMCU
    tuyaMcu_setBaudRate 115200
    setChannelType 1 toggle
    setChannelType 2 dimmer
    tuyaMcu_sendState 4 4 0
    tuyaMcu_sendState 3 2 10
    tuyaMcu_setDimmerRange 10 1000
    linkTuyaMCUOutputToChannel 1 1 1
    linkTuyaMCUOutputToChannel 2 2 2
    tuyaMcu_defWiFiState 4


    Added after 1 [hours] 9 [minutes]:

    Doing some basic diagostics with just the tuyaMCU driver loaded:

    Power button ON to OFF:
    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 08 02 02 00 04 00 00 03 49 65 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 2, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 841
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 01 01 00 01 00 11 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: 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 03 03 00 00 05 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 3 (WiFiState) with 7 bytes
    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


    Power button OFF to ON:
    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 08 02 02 00 04 00 00 03 49 65 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 2, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 841
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 01 01 00 01 01 12 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: 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 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes


    Adjust brightness to MAX:
    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 08 02 02 00 04 00 00 00 96 AF 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 2, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 150
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 96 AF 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 2, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 150
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 96 AF 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 2, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 150
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 96 AF 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 2, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 150
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 96 AF 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 2, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 150
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 02 02 00 04 00 00 01 A9 C3 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 2, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 425
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 02 02 00 04 00 00 01 A9 C3 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 2, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 425
    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 08 02 02 00 04 00 00 02 BF DA 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 2, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 703
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 02 02 00 04 00 00 02 BF DA 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 2, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 703
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 02 02 00 04 00 00 03 E8 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 2, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 1000
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 02 02 00 04 00 00 03 E8 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 2, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 1000
    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


    Adjust brightness to MIN:
    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 08 02 02 00 04 00 00 03 E8 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 2, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 1000
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 02 02 00 04 00 00 03 E8 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 2, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 1000
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 02 02 00 04 00 00 03 E8 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 2, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 1000
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 02 02 00 04 00 00 03 85 A1 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 2, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 901
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 02 02 00 04 00 00 02 BF DA 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 2, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 703
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 02 02 00 04 00 00 02 3E 59 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 2, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 574
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 02 02 00 04 00 00 01 82 9C 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 2, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 386
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 96 AF 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 2, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 150
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 96 AF 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 2, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 150
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 96 AF 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 2, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 150
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 02 02 00 04 00 00 00 96 AF 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 2, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 150
    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


    Bear with me as I'm still learning. I'll see about parsing this and figuring out how to apply it.
  • #8 20760713
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14405
    Help: 650
    Rate: 12336
    At the current moment I am not sure whether it's a TuyaMCU device or not. Would you be able to provide the picture of the board? Is there a MCU connected to the WiFi module on UART1 (RX1, TX1) port?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #9 20760726
    ShellDude
    Level 4  
    Posts: 10
    I am super new to this but I do think it is using tuyaMCU.

    After enabling just the tuyaMCU driver, I watched the tuya packets flowing across the bus via the web app log interface.

    From that I constructed a couple simple commands based on the values being returned (focusing right now on just the toggle):
    setChannelType 1 toggle
    linkTuyaMCUOutputToChannel 1 1 1


    And complete success... I am now able to control the toggle via OpenBeken and receive updates when I physically press it!

    Moving on to the dimmer now!

    Added after 10 [minutes]:

    And similar for the dimmer...

    setChannelType 2 dimmer
    tuyaMcu_setDimmerRange 14 1000
    linkTuyaMCUOutputToChannel 2 2 2


    I now have full control of the switch / dimmer and am using the following autoexec.bat:

    startDriver TuyaMCU
    setChannelType 1 toggle
    linkTuyaMCUOutputToChannel 1 1 1
    setChannelType 2 dimmer
    tuyaMcu_setDimmerRange 14 1000
    linkTuyaMCUOutputToChannel 2 2 2
  • #10 20760747
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14405
    Help: 650
    Rate: 12336
    That's good to hear. If that's the case, then you don't need any GPIOs, right? Everything is controlled by TuyaMCU protocol on the UART line.
    Helpful post? Buy me a coffee.
  • #11 20760758
    ShellDude
    Level 4  
    Posts: 10
    Yes, everything I need to control / view / monitor is working 100% with just the tuyaMCU protocol. I'll move to the basic binary switch tonight.

    All the documentation for OpenBeken made the learning curve super fast!

    I wonder if it was the 115200 baud rate in the DS02S autoexec that messed things up. I'll see about recreating the initial issue I was having by swapping out a few of the startup commands and see which one caused me problems.

    Does not work
    startDriver TuyaMCU
    tuyaMcu_setBaudRate 115200
    setChannelType 1 toggle
    setChannelType 2 dimmer
    tuyaMcu_sendState 4 4 0
    tuyaMcu_sendState 3 2 10
    tuyaMcu_setDimmerRange 10 1000
    linkTuyaMCUOutputToChannel 1 1 1
    linkTuyaMCUOutputToChannel 2 2 2
    tuyaMcu_defWiFiState 4


    Works
    startDriver TuyaMCU
    
    setChannelType 1 toggle
    linkTuyaMCUOutputToChannel 1 1 1
    
    setChannelType 2 dimmer
    tuyaMcu_setDimmerRange 14 1000
    linkTuyaMCUOutputToChannel 2 2 2
  • #12 20760778
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14405
    Help: 650
    Rate: 12336
    Well, now that you post two configs, it seems that it's obviously a 9600-baud device, 9600 is a default value for baud here. So, this line:
    
    tuyaMcu_setBaudRate 
    

    breaks the communication.

    Futhermore, what is the purpose of:
    
    tuyaMcu_sendState 4 4 0
    tuyaMcu_sendState 3 2 10
    

    It seems that someone tried to send some data to the MCU on the start, but I don't think it's needed.
    Helpful post? Buy me a coffee.
  • #13 20760788
    ShellDude
    Level 4  
    Posts: 10
    Found those settings here: https://www.elektroda.com/rtvforum/topic3957849.html#20566728

    Looks like there are some additional channels on the DS02S the author was trying to accommodate.

    Added after 3 [minutes]:

    Here's my "final" autoexec.bat:

    startDriver TuyaMCU
    tuyaMcu_setBaudRate 9600
    setChannelType 1 toggle
    linkTuyaMCUOutputToChannel 1 1 1
    setChannelType 2 dimmer
    tuyaMcu_setDimmerRange 14 1000
    linkTuyaMCUOutputToChannel 2 2 2
    tuyaMcu_defWiFiState 4
  • #14 20760828
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14405
    Help: 650
    Rate: 12336
    Ah yes, it seems he has found the following dpIDs:
    
    
    dpId 4 corresponds with the dimming mode (Valid values are 0,1,2)
    dpId 3 corresponds with the minimum dimming level (Valid values range is 10 - 1000)

    It may be possible to access them from OBK if that's needed.
    Helpful post? Buy me a coffee.
  • #15 20762194
    ShellDude
    Level 4  
    Posts: 10
    Wouldn't you know it, my Single Pole Binary switch (Treatlife ‎SS01S-1) and my second dimmer (Treatlife ‎DS01-Dimmer) are both ESP8266EX devices.

    The two dimmers were bought about a year and a half apart. The older one is an ESP8266EX bought in June of 2020 and the newer one we worked to get working here was purchased in December of 2021.

    That was quite a treat bouncing between Tasmota and OBK to get these 3 devices configured.

    Thanks again for all your assistance!

    Added after 4 [minutes]:

    I have found bouncing between both Tasmota and OBK, that OBK is much more responsive (at least via the web interface). The web interface offers more options, provides direct Home Assistant Discovery via its MQTT configuration, and overall was more pleasant to work with.

    If you ever have a port of this that runs on ESP devices, I would not hesitate to convert my ESP devices to it.
  • #16 20764751
    ShellDude
    Level 4  
    Posts: 10
    Moving on to converting other devices of mine, I have come across an IR Blaster with a Realtek WBR3 board in it. I saw reference to OBK being updated to include support for these controllers and would like to know if it is worth giving it a shot.

    IR Blaster circuit with LEDs and Realtek WBR3 component on a dark background. IR Blaster with Realtek WBR3 card on a round circuit board.
  • #17 20765233
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14405
    Help: 650
    Rate: 12336
    ShellDude wrote:

    I have found bouncing between both Tasmota and OBK, that OBK is much more responsive (at least via the web interface). The web interface offers more options, provides direct Home Assistant Discovery via its MQTT configuration, and overall was more pleasant to work with.

    If you ever have a port of this that runs on ESP devices, I would not hesitate to convert my ESP devices to it.


    Thank you, those platforms are planned, I will post on forum when we'll be needing testers. Just follow the thread and wait for more info.

    Btw, I don't know if you are aware of it, but we also have an OpenBeken Windows port (with simulator).
    Helpful post? Buy me a coffee.
  • #18 21379248
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14405
    Help: 650
    Rate: 12336
    Helpful post? Buy me a coffee.

Topic summary

✨ The discussion focuses on flashing and configuring the Treatlife DS01-Dimmer wall outlet, equipped with a WB3S controller, to operate independently from Tuya cloud services using OpenBeken firmware and MQTT integration with Home Assistant. Initial assumptions about the device containing an ESP8266 module were corrected after teardown revealed a WB3S chip, confirming it as a TuyaMCU device communicating over UART. Successful flashing was achieved using a third-party Python flasher due to issues with the Windows flasher. Configuration involved creating an autoexec.bat script with appropriate TuyaMCU commands, including setting channel types for toggle and dimmer functions, defining dimmer ranges, and establishing UART baud rate at 9600 (default), as 115200 caused communication failures. The user identified relevant dpIDs for dimming mode (dpId 4) and minimum dimming level (dpId 3), which can be accessed via OpenBeken. GPIO configuration was unnecessary since control is fully managed via the TuyaMCU protocol. The user also compared OpenBeken favorably to Tasmota for responsiveness and Home Assistant integration. Additional notes mention other Treatlife devices (SS01S-1 binary switch and an older DS01-Dimmer) based on ESP8266EX, and interest in OpenBeken support for Realtek WBR3-based IR Blaster devices, with plans for future testing and guides.
Generated by the language model.

FAQ

TL;DR: Treatlife DS01‑Dimmer on WB3S runs OpenBeken via TuyaMCU at 9600 baud; “It’s obviously a 9600‑baud device.” Keep config minimal and avoid 115200. [Elektroda, p.kaczmarek2, post #20760778]

Why it matters: For Treatlife DS01‑Dimmer owners leaving Tuya cloud, this FAQ shows how to map dpIDs, build autoexec.bat, and integrate with Home Assistant fast.

Quick Facts

Does Treatlife DS01‑Dimmer with WB3S work on OpenBeken without GPIO mapping?

Yes. Load the TuyaMCU driver and link dpId 1 to a toggle and dpId 2 to a dimmer. No GPIO roles are required. Users confirmed full control and updates from physical button presses using only TuyaMCU. “I now have full control of the switch / dimmer.” [Elektroda, ShellDude, post #20760726]

What baud rate should I set for TuyaMCU on DS01‑Dimmer?

Use 9600 baud. Do not set 115200, as it breaks communication. “It’s obviously a 9600‑baud device.” You can omit tuyaMcu_setBaudRate entirely because 9600 is the default. This stabilizes UART and avoids buffer errors during startup. [Elektroda, p.kaczmarek2, post #20760778]

How do I map dpIDs for on/off and brightness on this dimmer?

Map dpId 1 to a toggle (bool 0/1) and dpId 2 to a dimmer value. Logs show dpId 1 toggling and dpId 2 reporting values up to 1000. Link these to channels in autoexec for MQTT and UI control. [Elektroda, ShellDude, post #20760645]

How do I set a working dimmer range and link channels?

Set a practical range and link outputs. How‑To: 1) startDriver TuyaMCU. 2) setChannelType 1 toggle; linkTuyaMCUOutputToChannel 1 1 1. 3) setChannelType 2 dimmer; tuyaMcu_setDimmerRange 14 1000; linkTuyaMCUOutputToChannel 2 2 2. This delivers smooth control and proper updates. [Elektroda, ShellDude, post #20760726]

What do dpId 3 and dpId 4 control on Treatlife dimmers?

dpId 3 sets the minimum dimming level with a range of 10–1000. dpId 4 controls the dimming mode, with valid values 0, 1, or 2. “It may be possible to access them from OBK if that’s needed.” Use these only if you need advanced tuning. [Elektroda, p.kaczmarek2, post #20760828]

Do I need GPIO roles for DS01‑Dimmer, or is it TuyaMCU‑only?

It’s TuyaMCU‑only for control. “Everything is controlled by TuyaMCU protocol on the UART line.” Skip GPIO role assignment unless your specific hardware variant proves otherwise. This simplifies configuration and reduces errors. [Elektroda, p.kaczmarek2, post #20760747]

My GPIO extractor says “Sorry, no meaningful pins data found.” What does that imply?

That output indicates a TuyaMCU or custom design without a useful Tuya GPIO table. The DS01‑Dimmer variant discussed operates via TuyaMCU on UART, so the extractor will show no meaningful pin data. Continue with TuyaMCU mapping. [Elektroda, ShellDude, post #20760645]

Why did a DS02S template or 115200 baud make my DS01‑Dimmer misbehave?

The DS01 variant uses 9600 baud, and 115200 “breaks the communication.” Extra sendState lines from other templates are unnecessary here. Keep config minimal, keep 9600, and link only the needed dpIDs. [Elektroda, p.kaczmarek2, post #20760778]

Should I force Wi‑Fi state 0x04 on this device?

Some TuyaMCU devices require Wi‑Fi state 0x04 to operate normally off‑cloud. Add tuyaMcu_defWiFiState 4 in autoexec if the device seems unresponsive until “cloud‑connected.” This helps pass device self‑checks. [Elektroda, p.kaczmarek2, post #20760224]

What’s a minimal autoexec.bat for the DS01‑Dimmer?

Minimal lines: startDriver TuyaMCU; setChannelType 1 toggle; linkTuyaMCUOutputToChannel 1 1 1; setChannelType 2 dimmer; tuyaMcu_setDimmerRange 14 1000; linkTuyaMCUOutputToChannel 2 2 2. This works at default 9600 baud without extra sendState commands. [Elektroda, ShellDude, post #20760726]

How do I integrate OpenBeken with Home Assistant quickly?

Enable MQTT in OpenBeken and provide broker details. OpenBeken publishes Home Assistant Discovery topics automatically, so entities appear without custom YAML. Users reported fast, smooth setup using this path. [Elektroda, ShellDude, post #20762194]

Is OpenBeken more responsive than Tasmota for these dimmers?

A user found OpenBeken “much more responsive.” He also noted the OBK web interface offers more options and direct Home Assistant Discovery. This can speed testing and onboarding. [Elektroda, ShellDude, post #20762194]

What if my Treatlife unit has an ESP8266EX instead of WB3S?

Some Treatlife units ship with ESP8266EX. The user flashed those with Tasmota, while WB3S models ran OpenBeken. Check your module before flashing to choose the correct firmware path. [Elektroda, ShellDude, post #20762194]

Does OpenBeken support Realtek WBR3‑based IR blasters now?

Yes. A new guide covers WBR2, WBR3, WBRU, and W701‑VA2‑CG pinout, datasheet, and flashing for Home Assistant. Follow that reference for onboarding steps. [Elektroda, p.kaczmarek2, post #21379248]

Can I prototype configurations without hardware using a simulator?

Yes. There is an OpenBeken Windows port with a simulator. Use it to draft autoexec settings and explore features before hardware flashing. [Elektroda, p.kaczmarek2, post #20765233]

How can I verify TuyaMCU traffic is alive after boot?

OpenBeken logs show Tuya frames. Heartbeat frames appear as 55 AA 03 00..., while State frames appear as 55 AA 03 07.... If logs flood with odd bytes, recheck baud and config. [Elektroda, ShellDude, post #20760645]
Generated by the language model.
ADVERTISEMENT