logo elektroda
logo elektroda
X
logo elektroda

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

andyc1 5544 35
Best answers

How do I manually configure OpenBeken for a Tuya S1-B-WT triac dimmer after flashing OBK so the switch and dimmer actually control the light?

Your device is a TuyaMCU dimmer, and the working OBK setup needs the correct baud rate plus the real dpIDs from the MCU log, not the guessed 1/2 mapping. Use an autoexec.bat like `startDriver TuyaMCU`, `tuyaMcu_defWiFiState 4`, `tuyaMcu_setBaudRate 115200`, then `setChannelType 1 toggle`, `setChannelType 2 dimmer`, `tuyaMcu_setDimmerRange 0 1000`, and finally `linkTuyaMCUOutputToChannel 20 1 1` and `linkTuyaMCUOutputToChannel 22 2 2` [#20652300][#20654338] The log you posted shows dpID 20 as a boolean on/off state and dpID 22 as a value for brightness, which is why the earlier 1/2 mapping did nothing [#20654116][#20654338] To identify dpIDs on your own device, open the Web App log and use the physical wall switch / dimmer input, since web-page toggles may not generate the same TuyaMCU packets [#20654184][#20654210] After updating the config, fully power-cycle the module; a web-app reboot alone did not reliably initialize all devices, but power off/on fixed the state reporting for the thread starter [#20665740]
Generated by the language model.
ADVERTISEMENT
  • #31 20816374
    atomphil
    Level 10  
    Posts: 31
    Help: 4
    Rate: 17
    >>20799162

    I try this

    Screenshot of Bad_Dimmer configuration in Home Assistant.

    but no luck. There is still just a switch in HA. :/
  • ADVERTISEMENT
  • #32 21285008
    GiovanniG11
    Level 2  
    Posts: 3
    Hi mates, I have an S1-B and would drive it by Node Red, unfortunately it's very complicated to make it work with Tuya protocol, so someone suggested me to refresh it.
    Can you please write a brief guide with instructions?
    1) how to flash it and with what exactly
    2) how to connect it/how change settings to make it work
    3) does it use MQTT? Which are the commands to give?
    Thank you a lot!
  • ADVERTISEMENT
  • #33 21285036
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12371
    Your device is most likely using TuyaMCU, so here is a TuyaMCU guide:
    https://www.elektroda.com/rtvforum/topic4038151.html
    Here is the flash tool we're using for Beken:
    https://github.com/openshwprojects/BK7231GUIFlashTool
    Here are our flashing guides, search for the ones for BK7231:
    https://www.youtube.com/@elektrodacom
    Some of the guides may use older flashing tools, so it's recommended to use BK7231 GUI Tool instead.
    Here is HA pairing guide: https://www.youtube.com/watch?v=pkcspey25V4

    Here are our docs:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/README.md
    You can also check autoexec examples and MQTT section.

    Please check out linked resources, but don't worry, we can also help you with the process step by step. First, make some photos of your device, then attempt to take 2MB flash backup...
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #34 21285042
    GiovanniG11
    Level 2  
    Posts: 3
    thank you, you cleared me..
    this process takes time too, learning, creating tool, using it and get confidence after flashing. Honestly I don't have now such time, so I will postpone my efforts for the future.
    Chances are I can get some success with Tuya protocol, I've sniffed the packet for turning on and off locally, if I can succeed also with dimmer values.. I can have the solution
  • ADVERTISEMENT
  • #35 21854299
    jtauscher87
    Level 7  
    Posts: 13
    Rate: 2
    PCB with annotated traces and test points, including Tx/Rx, GND, Vcc, 3.3V and L/N.

    In case this is helpful to anyone.
  • #36 21854335
    GiovanniG11
    Level 2  
    Posts: 3
    Thank you, anyway I consider much more efficient buy the WZ version (Zigbee) and use an adapter compatible with Zigbee2MQTT, there are several advantages: you don't need to reflash it to use it without the Tuya cloud, you may have more efficient connection/longer as Zigbee allows devices to repeat signals in case it's needed, you may save some energy as Zigbee requires less energy than Wi-Fi.
    I suppose the transmission may go wrong with Wi-Fi if there are too many broadcasts, as the processor needs to analyze all packets

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.
Generated by the language model.

FAQ

TL;DR: 1000-step dimming, “TuyaMCU works” [Elektroda, p.kaczmarek2, post #20654184], confirmed at 115 200 bps [Elektroda, p.kaczmarek2, post #20652300] Flash OBK, map dpID 20 to power and 22 to brightness; add MQTT retain to keep state.

Why it matters: Correct mapping and retain stop ‘unknown’ states in Home Assistant after every reboot.

Quick Facts

• Baud rate: 115 200 bps (TuyaMCU default) [Elektroda, 20652300] • Brightness range: 0–1000 (dpID 22) [Elektroda, post #20654276] • Power toggle: dpID 20, Boolean 0/1 [Elektroda, 20654276] • Enable OBK Flag 7 to retain MQTT state after HA restarts [Elektroda, post #20814571] • WB2S module flash size: Approx. 2 MB [OpenBeken docs]

What chipset is inside the Tuya S1-B-WT triac dimmer?

The dimmer uses a Tuya WB2S Wi-Fi module based on the BK7231S SoC and communicates with a TuyaMCU daughterboard over UART at 115 200 bps [Elektroda, andyc1, #20652186; p.kaczmarek2, #20652300].

Which tool and firmware should I flash?

Use BK7231 GUI Flash Tool with the latest OpenBeken (OBK) binary for BK7231S. Backup the 2 MB flash first, then write OBK to 0x0. OBK v1.17 or newer auto-detects TuyaMCU packets [OpenBeken docs; Elektroda, p.kaczmarek2, #21285036].

How do I wire the module for flashing?

Connect 3.3 V, GND, RX, TX to the WB2S header, then power-cycle to enter boot. Shorting CEN to GND also works, but a simple repower is faster [Elektroda, p.kaczmarek2, post #20665907]

What is the minimal working autoexec.bat?

  1. startDriver TuyaMCU
  2. tuyaMcu_setBaudRate 115200
  3. setChannelType 1 toggle; setChannelType 2 dimmer
  4. tuyaMcu_setDimmerRange 0 1000
  5. linkTuyaMCUOutputToChannel 20 1 1; linkTuyaMCUOutputToChannel 22 2 2 This five-line script makes the on/off switch and 0–1000 dimmer operational [Elektroda, 20654338]

Home Assistant shows only a switch, not a dimmer—how can I fix it?

Ensure Channel 2 is typed as “dimmer” and that MQTT discovery is enabled. Reload MQTT in HA or restart the broker. If discovery fails, add a light entity in configuration.yaml pointing to topic extension_1/2/set with payload 0-1000 [Elektroda, atomphil, post #20799131]

Why does the device lose state after HA restarts?

MQTT messages were published without the retain flag. Enable OBK Flag 7 (Always Retain) so the broker stores the last on/off and level values; HA then restores them on start-up [Elektroda, andyc1, post #20814571]

MQTT topic structure and commands?

Default base topic is extension_1. Send: • On: extension_1/1/set payload 1 • Off: extension_1/1/set payload 0 • Dim: extension_1/2/set payload 0-1000 OBK publishes current values to /get sub-topics with retain when Flag 7 is active [OpenBeken docs; Elektroda, #20654116].

Physical wall switch changes are not reflected—what to check?

Open Web-App log and look for incoming dpID packets. If none appear, verify UART wires and that autoexec.bat uses the same baud rate and dpIDs on every module. A cold power cycle fixed a partial TuyaMCU init bug on six units [Elektroda, andyc1, post #20665740]

Edge case: One module stops updating after flashing several units.

Match autoexec.bat across all devices, then power-cycle. Mismatched scripts prevented two-way communication; restarting via web UI alone did not clear the fault [Elektroda, 20665740]

Can I choose leading versus trailing-edge dimming?

Skydance’s OEM datasheet shows a DIP switch for leading-/trailing-edge selection, but the Tuya variant fixes trailing-edge in firmware; OBK cannot change it through software alone [Skydance datasheet; Elektroda, #20785588].

How do I factory-reset or reflash if I mis-configure OBK?

Hold the physical reset button for >10 s to erase config. If the web UI is unreachable, re-enter boot mode, read flash, and rewrite a clean OBK image with BK7231 GUI Tool [OpenBeken docs].

What happens if TuyaMCU sends no heartbeat?

OBK logs will show missing 55 AA packets. After 5 s without heartbeats, channels freeze until UART traffic resumes, preventing ghost toggles but also blocking HA updates [Elektroda, p.kaczmarek2, post #20654116]
Generated by the language model.
ADVERTISEMENT