logo elektroda
logo elektroda
X
logo elektroda

Inside MoesGo Two Channel Smart Dimmer Module MS-105B: CB2S Tuya Module & Holtek HT66F3195

leśny_ziutek 7806 34
ADVERTISEMENT
  • ADVERTISEMENT
  • #32 20901151
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14612
    Help: 655
    Rate: 12630
    The Martin Jerry Dimmer uses PWM dimmer, which is different from what MCU does. It's like a TuyaMCU dimmer but with different communication, in this case controlled via PWM:
    Screenshot of a webpage section with information about the PWM dimmer module.
    Getting other dimmers to work directly with OBK would require porting MCU functionality to OpenBeken, so OpenBeken would need to be able to detect phase via optocoupler and then quickly turn the light on at the specific point of sine wave. It is certainly doable, but there were no requests ever to that.

    Why would you like such a feature? Would you help with testing?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #33 21348324
    hulakov
    Level 1  
    Posts: 1
    >>20899239 With this config, the dimmer works in a very small range. In particular, minimal brightness is too bright. Is there a way to fix it?
  • ADVERTISEMENT
  • #34 21351383
    leśny_ziutek
    Level 12  
    Posts: 52
    Help: 3
    Rate: 9
    Different light bulbs behave differently. I have two dimmable bulbs: Osram Glow Dim and Philips WarmGlow, both with the adjust of the color temperature when dimming. Both have their pros and cons but only the Philips one can be dim very deeply: 0-100%. The Osram one is more like 30-100%.

    You can try change the range with the tuyaMcu_setDimmerRange command.

    My current autoexec.bat is below:

    
    startDriver TuyaMCU
    
    tuyaMcu_defWiFiState 4
    tuyaMcu_setDimmerRange 100 900
    
    setChannelLabel 1 L1 1
    setChannelType 1 toggle
    linkTuyaMCUOutputToChannel 1 bool 1
    
    setChannelLabel 2 L2 1
    setChannelType 2 toggle
    linkTuyaMCUOutputToChannel 7 bool 2
    
    setChannelType 3 dimmer
    linkTuyaMCUOutputToChannel 2 val 3
    
    setChannelType 4 dimmer
    linkTuyaMCUOutputToChannel 8 val 4
    
    setChannelLabel 5 toggle_L1_after
    setChannelType 5 textField
    linkTuyaMCUOutputToChannel 6 val 5
    
    setChannelLabel 6 toggle_L2_after
    setChannelType 6 textField
    linkTuyaMCUOutputToChannel 12 val 6
    
    mqtt_broadcastInterval 120
    
    PowerSave 1
    
  • #35 21351390
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14612
    Help: 655
    Rate: 12630
    tuyaMcu_setDimmerRange takes two arguments, min and max. And in the post you linked I can see:
    Screenshot of code where the tuyaMcu_setDimmerRange function has a missing space between arguments.
    did someone lost a space?
    Helpful post? Buy me a coffee.

Topic summary

✨ The MoesGo Two Channel Smart Dimmer Module MS-105B features a CB2S Tuya Module based on the BK7231N microcontroller and a Holtek HT66F3195 MCU for dimming control. The power stage uses two SLD8N65SV MOSFETs (650V, 7A) and rectifying bridges with S3M diodes (1000V, 3A). It operates as a trailing edge dimmer with voltage waveform characteristics demonstrated at various dimming levels. The device employs a TuyaMCU architecture requiring external MCU communication, flashable OTA only with matching firmware profiles, and UART port management for flashing. Configuration and control are managed via OpenBeken firmware using autoexec.bat scripts to set channel types, link TuyaMCU dpIDs to channels, and define dimmer ranges. The dimmer supports toggling and dimming channels with dpIDs mapped for boolean and value types, including additional dpIDs for toggle-after timing functions. Flash memory wear is minimized by optimized write operations. Integration with Home Assistant via MQTT is possible, though initial issues with dimming control were resolved by correcting JSON configurations. Workarounds for using rocker switches involve assigning unused GPIO pins with TglChannelOnToggle roles due to TuyaMCU's autonomous handling of physical buttons. The Martin Jerry MJ-SD01 dimmer differs by using PWM control without an external MCU, unlike TuyaMCU-based dimmers. Adjusting minimal brightness levels depends on the bulb type and can be tuned via the tuyaMcu_setDimmerRange command. The community provides detailed flashing instructions, configuration examples, and troubleshooting for OTA flashing, dpID mapping, and device integration.
Generated by the language model.

FAQ

TL;DR: This 2-channel MoesGo MS-105B dimmer uses a CB2S BK7231N and a Holtek HT66F3195; “the third one” was the first working Cloudcutter profile on firmware 1.0.2. This FAQ helps OpenBeken users flash it OTA, enter AP mode, map TuyaMCU dpIDs, stop post-flash beeping, and restore proper Home Assistant dimming control. [#20827936]

Why it matters: The thread turns a hard-to-flash Tuya dimmer into a repeatable OpenBeken setup with verified channel mapping, OTA steps, and Home Assistant fixes.

Variant Observed low-end dimming result Working range example
Philips WarmGlow Can dim very deeply 0–100%
Osram Glow Dim Minimum stays visibly bright ~30–100%

Key insight: The MS-105B is not a simple BK7231N dimmer. OpenBeken works well only after you treat it as a TuyaMCU device, set Wi-Fi state 0x04, and map each bool/value dpID pair to the right channels. [#21351383]

Quick Facts

  • The teardown identified a CB2S Tuya module with BK7231N, plus a Holtek HT66F3195 MCU that handles dimming-side logic. [#20827148]
  • The power stage uses 2× SLD8N65SV MOSFETs rated 650 V, 7 A at 25°C, 1.1 Ω, and two rectifier bridges built from S3M diodes rated 1000 V and 3 A. [#20827148]
  • Scope captures showed this is a trailing-edge dimmer, tested with a 77 W halogen bulb at 1%, 30%, 50%, and 100% app settings. [#20827148]
  • A proven OpenBeken mapping is: L1 = dpID 1 bool + dpID 2 value, L2 = dpID 7 bool + dpID 8 value; dpID 6 and 12 act as delayed toggle timers. [#20830306]
  • Home Assistant discovery was corrected after upgrading from OpenBeken 1.17.308 to 1.17.326, which removed the extra switch entities and left two light entities plus RSSI. [#20838746]

1. What is a trailing edge dimmer, and how is it different from other AC dimming methods?

A trailing edge dimmer cuts the end of each AC half-cycle, not the beginning. The MS-105B was verified as trailing edge from captured waveforms at 1%, 30%, 50%, and 100% using a 77 W halogen load. "Trailing edge dimmer" is an AC phase-cut dimmer that reduces power by switching off late in each mains half-cycle, with the key characteristic that conduction starts normally and ends early. [#20827148]

2. How can I flash a MoesGo MS-105B dimmer with a CB2S BK7231N module using tuya-cloudcutter and OpenBeken OTA?

You can flash it OTA with tuya-cloudcutter if the installed Tuya firmware has a matching profile. 1. Check the device firmware in the Tuya or Smart Life app; the reported version here was 1.0.2. 2. Run sudo ./tuya-cloudcutter.sh, choose third-party firmware, then select the firmware-version method and a BK7231N profile. 3. Put the dimmer into slow-beep AP mode, let Cloudcutter connect twice, then flash an OpenBeken .ug.bin image. Avoid upgrading Tuya firmware first, because that can block OTA flashing. [#20827829]

3. Which firmware profile works for the MoesGo Two Channel Smart Dimmer MS-105B on Tuya firmware 1.0.2, and how do I find the right one?

The first confirmed working profile on Tuya firmware 1.0.2 was bk7231n_common_user_config_ty. The user tried profiles in sequence and reported that “the third one” worked first. To find the right one, select the exact Tuya firmware version, confirm the chip is BK7231N by opening the device, and test candidate 1.0.2 profiles one by one until Cloudcutter succeeds. [#20827936]

4. What sequence puts the MoesGo MS-105B into Tuya AP mode when it only beeps or blinks?

The working sequence is to remove the device from Tuya cloud, power it on, then connect S1 to L ten times. The thread reports a rhythm of about once every 2 seconds, using either an isolated pushbutton or a short piece of wire. Fast beeping indicates one state, while slow beeping is the AP mode Cloudcutter needs. After a power cycle, this device often re-entered the required mode automatically. [#20827829]

5. Why does the MS-105B start beeping after OpenBeken flashing, and how does tuyaMcu_defWiFiState 4 stop it?

It beeps because the Holtek-based TuyaMCU still drives the buzzer and LEDs after flashing, and it expects a different Wi-Fi status from the BK7231N side. Adding tuyaMcu_defWiFiState 4 to autoexec.bat and rebooting both the main chip and MCU stopped the buzzer, although it took some time to mute fully. The same post confirmed the command worked after earlier testing suggested otherwise. [#20828080]

6. What is TuyaMCU in devices like the MoesGo MS-105B, and why does Tuya use an external Holtek HT66F3195 MCU for dimming?

TuyaMCU is the external controller that handles dimming logic and exposes states through dpIDs. "TuyaMCU" is a secondary microcontroller subsystem that manages device-side functions such as dimming and switch inputs, with the key characteristic that the Wi-Fi SoC talks to it through a command protocol instead of driving the load directly. In this thread, the external MCU was a Holtek HT66F3195, and the likely reason was reliable real-time tasks such as zero-cross detection and MOSFET timing. [#20827829]

7. How do I map the correct TuyaMCU dpIDs for both channels of the MS-105B in OpenBeken?

Map the two channels as bool/value pairs: L1 uses dpID 1 to channel 1 and dpID 2 to channel 3, while L2 uses dpID 7 to channel 2 and dpID 8 to channel 4. The working commands were linkTuyaMCUOutputToChannel 1 bool 1, 2 val 3, 7 bool 2, and 8 val 4. This mapping was confirmed after querying states and testing both wall inputs. [#20830306]

8. Where are OpenBeken setChannelType settings stored, and does leaving them in autoexec.bat cause flash wear?

setChannelType settings are stored in flash, but leaving them in autoexec.bat does not create harmful flash wear. The maintainer explained that writes are optimized, flash is written only when a value changes, and multiple changes are grouped into one write when possible. TuyaMCU dpID mappings are different: those are not stored between reboots, which is why autoexec.bat remains necessary for the link commands. [#20828152]

9. How can I use tuyaMcu_sendQueryState and tuyaMcu_sendState to inspect or control TuyaMCU value and boolean dpIDs?

Use tuyaMcu_sendQueryState to dump all current dpIDs, then use tuyaMcu_sendState [dpID] [dpType] [dpValue] to write one back. In the captured log, tuyaMcu_sendQueryState exposed bool dpIDs 1 and 7 and value dpIDs 2, 6, 8, and 12. tuyaMcu_sendState then let the user test what hidden value-type dpIDs actually did, instead of guessing from the logs alone. [#20828278]

10. What do dpID 6 and dpID 12 do on the MoesGo MS-105B, and how can they be used for delayed toggle-after-seconds control?

dpID 6 and dpID 12 act as delayed toggle timers, one per channel. The thread verified that tuyaMcu_sendState 6 2 0 does nothing, 6 2 1 toggles L1 after 1 second, and 6 2 30 toggles L1 after 30 seconds; dpID 12 behaves the same way for L2. A practical setup linked them to text fields named toggle_L1_after and toggle_L2_after, which made the timer values editable from the interface. [#20828527]

11. Why does Home Assistant discover extra switch entities instead of proper dimmer controls for an OpenBeken dual dimmer, and which build fixes it?

It happened because OpenBeken published extra MQTT discovery entities incorrectly for this dual TuyaMCU dimmer. The user first saw four entities, including two extra switches, on build 1.17.308. After the maintainer fixed the bug and recommended build 1.17.326, Home Assistant showed the correct result: two light entities with brightness topics and one RSSI sensor. [#20838746]

12. How should I configure Home Assistant MQTT discovery for a two-channel OpenBeken TuyaMCU dimmer so brightness control appears correctly?

Publish each channel as a light entity, not as a separate switch, and bind brightness topics to the dimmer channels. In the working discovery JSON, L1 used stat_t ~/1/get, cmd_t ~/1/set, bri_stat_t ~/3/get, and bri_cmd_t ~/3/set, while L2 used channels 2 and 4 the same way, with bri_scl set to 100. After upgrading to 1.17.326, the user confirmed Home Assistant showed two light controls and brightness worked correctly. [#20838746]

13. What is a Tuya dpID, and how does it relate to channels, dimmer values, and TuyaMCU integration in OpenBeken?

A Tuya dpID is the numbered data point that the external MCU uses to report or accept states. "dpID" is a Tuya data-point identifier that labels one function in the TuyaMCU protocol, with the key characteristic that each identifier also carries a type such as boolean or value. On this dimmer, dpIDs 1 and 7 were booleans for on/off, dpIDs 2 and 8 were dimmer values, and OpenBeken linked each one to a local channel. [#20828101]

14. How does a TuyaMCU phase-cut dimmer compare with the Martin Jerry PWM dimmer approach for OpenBeken support?

A TuyaMCU phase-cut dimmer relies on an external MCU for mains timing, while the Martin Jerry design uses a PWM dimmer path that OpenBeken can drive differently. The maintainer said direct support for other phase-cut dimmers would require OpenBeken itself to detect the optocoupler phase point and switch the load quickly at the right sine-wave position. That makes the TuyaMCU design more dependent on protocol mapping, while the PWM design depends on a different control method entirely. [#20901151]

15. What is the best way to improve minimum brightness on the MS-105B with different dimmable bulbs like Philips WarmGlow and Osram Glow Dim using tuyaMcu_setDimmerRange?

Adjust the minimum and maximum with tuyaMcu_setDimmerRange min max, then tune for each bulb type. In the later working example, tuyaMcu_setDimmerRange 100 900 improved behavior, while an earlier setup used 1 1000. Real bulbs differed sharply: Philips WarmGlow could dim from 0–100%, but Osram Glow Dim behaved more like 30–100%, so the best low-end result came from range tuning plus choosing bulbs with a deeper native dimming curve. [#21351383]
Generated by the language model.
ADVERTISEMENT