logo elektroda
logo elektroda
X
logo elektroda

WF-DS01 BK7231N Dimmer Not Responding to MQTT Dimmer Commands, Only Power Works

lhakanl 366 3
ADVERTISEMENT
  • #1 21807660
    lhakanl
    Level 2  
    This is a WF-DS01 Touch Wall Dimmer, BK7231N-based.
    All my earlier (several years old) WF-DS01:s are ESP8266-based.

    Most things seem to work, however not dimming via command in console or via mqtt.
    The power command works as expected.
    The local touch buttons also work. And both local dimming and power produces mqtt output.
    The somewhat strange thing is that "led_dimming/get" is used in the mqtt output when dimming and just "1/get" when powering on/off.
    Also "led_dimming" seem to imply that DC PWM should be used ? (allthough this is an AC Triac dimmer).
    When sending the dimmer command, no tuya activity is detected in the log (except for heartbeat).

    I assume that there is some configuration that I have missed or done wrong ??

    > mosquitto_pub -h pi -t cmnd/tasmota/dimmer-11/power -m off
    > mosquitto_pub -h pi -t cmnd/tasmota/dimmer-11/power -m on
    produces mqtt:
    
      cmnd/tasmota/dimmer-11/power off
      tasmota/dimmer-11/1/get 0
      stat/tasmota/dimmer-11/RESULT {"POWER":"OFF"}
      cmnd/tasmota/dimmer-11/power on
      tasmota/dimmer-11/1/get 1
      stat/tasmota/dimmer-11/RESULT {"POWER":"ON"}
    

    > mosquitto_pub -h pi -t cmnd/tasmota/dimmer-11/dimmer -m 100
    produces mqtt:
    
      cmnd/tasmota/dimmer-11/dimmer 100
      tasmota/dimmer-11/led_dimmer/get 100
      stat/tasmota/dimmer-11/RESULT {"POWER":"OFF"}
    


    Debug log when switching power off (switching on is similar) via mqtt (heartbeat removed):
    
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic cmnd/tasmota/dimmer-11/power
    Info:CMD:tasCmnd POWER (power) received with args off
    Info:MQTT:Channel has changed! Publishing 0 to channel 1
    Info:MQTT:Publishing val 0 to tasmota/dimmer-11/1/get retain=0
    Info:MQTT:Publishing val {"POWER":"OFF"} to stat/tasmota/dimmer-11/RESULT retain=0
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic tasmota/dimmer-11/1/get
    Debug:MQTT:channelSet topic 4216992 with arg 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 01 01 00 01 00 11
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 1 type 1-bool len 1
    Info:TuyaMCU:ParseState: byte 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 01 01 00 01 00 11
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 1 type 1-bool len 1
    Info:TuyaMCU:ParseState: byte 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 02 02 00 04 00 00 01 5E 78
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 2 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 350
    Debug:TuyaMCU:ApplyMapping: mapped dp 2 value 350 to 35
    Info:MQTT:Channel has changed! Publishing 35 to channel 2
    Info:MQTT:Publishing val 35 to tasmota/dimmer-11/2/get retain=0
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic tasmota/dimmer-11/2/get
    Debug:MQTT:channelSet topic 4216992 with arg 35
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 03 02 00 04 00 00 00 0A 24
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 3 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 10
    Debug:TuyaMCU:ApplyMapping: id 3 (val 10) not mapped
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 05 02 00 04 00 00 03 E8 07
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 5 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 1000
    Debug:TuyaMCU:ApplyMapping: id 5 (val 1000) not mapped
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 06 02 00 04 00 00 00 00 1D
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 6 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 0
    Debug:TuyaMCU:ApplyMapping: id 6 (val 0) not mapped
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 0E 04 00 01 00 21
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 14 type 4-enum len 1
    Info:TuyaMCU:ParseState: byte 0
    Debug:TuyaMCU:ApplyMapping: id 14 (val 0) not mapped
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 1A 01 00 01 01 2B
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 26 type 1-bool len 1
    Info:TuyaMCU:ParseState: byte 1
    Debug:TuyaMCU:ApplyMapping: id 26 (val 1) not mapped
    


    Debug log when dimming via mqtt (heartbeat removed):
    
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic cmnd/tasmota/dimmer-11/dimmer
    Debug:CMD: dimmer (dimmer) received with args 100
    Info:MQTT:Publishing val 100 to tasmota/dimmer-11/led_dimmer/get retain=0
    Info:MQTT:Publishing val {"POWER":"OFF"} to stat/tasmota/dimmer-11/RESULT retain=0
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic tasmota/dimmer-11/led_dimmer/get
    Debug:MQTT:channelSet topic 4216992 with arg 100
    


    Debug log when switching power off (switching on is similar) via local buttons (heartbeat removed):
    
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 01 01 00 01 01 12
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 1 type 1-bool len 1
    Info:TuyaMCU:ParseState: byte 1
    Info:MQTT:Channel has changed! Publishing 1 to channel 1
    Info:MQTT:Publishing val 1 to tasmota/dimmer-11/1/get retain=0
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic tasmota/dimmer-11/1/get
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 02 02 00 04 00 00 01 54 6E
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 2 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 340
    Debug:TuyaMCU:ApplyMapping: mapped dp 2 value 340 to 34
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 03 02 00 04 00 00 00 0A 24
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 3 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 10
    Debug:TuyaMCU:ApplyMapping: id 3 (val 10) not mapped
    Debug:MQTT:channelSet topic 4216992 with arg 1
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 05 02 00 04 00 00 03 E8 07
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 5 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 1000
    Debug:TuyaMCU:ApplyMapping: id 5 (val 1000) not mapped
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 06 02 00 04 00 00 00 00 1D
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 6 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 0
    Debug:TuyaMCU:ApplyMapping: id 6 (val 0) not mapped
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 0E 04 00 01 00 21
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 14 type 4-enum len 1
    Info:TuyaMCU:ParseState: byte 0
    Debug:TuyaMCU:ApplyMapping: id 14 (val 0) not mapped
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 1A 01 00 01 01 2B
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 26 type 1-bool len 1
    Info:TuyaMCU:ParseState: byte 1
    Debug:TuyaMCU:ApplyMapping: id 26 (val 1) not mapped
    


    Debug log when dimming via local buttons (heartbeat removed):
    
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 02 02 00 04 00 00 01 5E 78
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 2 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 350
    Debug:TuyaMCU:ApplyMapping: mapped dp 2 value 350 to 35
    Info:MQTT:Channel has changed! Publishing 35 to channel 2
    Info:MQTT:Publishing val 35 to tasmota/dimmer-11/2/get retain=0
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic tasmota/dimmer-11/2/get
    Debug:MQTT:channelSet topic 4216992 with arg 35
    


    In the config, "Pin Settings:" are blank,.
    "Channel types:" are "1: Toggle" and "2:Dimmer". All other are "Default".

    https://www.aliexpress.com/item/32980493334.html

    Close-up of the back of an electronic switch with PCB and Zigbee module
    PCB mounted in white wall casing with electronic components and black antenna
    AI: Which firmware and version are you running on the BK7231N-based WF-DS01 (e.g., OpenBK7231T/OpenBeken, Tasmota, or something else), and is it an official or custom build?
    Official OpenBK7231N_QIO_1.18.245.bin
    AI: Could you share your full TuyaMCU or template configuration, including any DPIDs/channel mappings or custom rules you’ve set (beyond just the Channel types and Pin Settings)?
    autoexec.bat:

    startDriver TuyaMCU
    tuyaMcu_defWiFiState 4
    setChannelType 1 toggle
    setChannelType 2 dimmer
    tuyaMcu_setDimmerRange 0 1000
    linkTuyaMCUOutputToChannel 1 bool 1
    linkTuyaMCUOutputToChannel 2 val 2
  • ADVERTISEMENT
  • #2 21809428
    p.kaczmarek2
    Moderator Smart Home
    Thank you for reporting the issue.

    This is because our TuyaMCU dimmer resides outside core LED dimmer. Here's self test:
    https://github.com/openshwprojects/OpenBK7231T_App/pull/1947

    Now, the question is, how do we fix it? Would it be enough to detect TuyaMCU in Dimmer command and forward it there? Or shall whole LED driver be made tuyamcu-aware...

    Maybe something like tuyaMCU_setupLED but for single color? Maybe I could try making tuyaMCU_setupDimmer?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 21810278
    lhakanl
    Level 2  
    My uneducated guess is that Tuya-MCU dimmer commands are the same for all kinds of dimmable devices?
    If that's the case, detecting Tuya in dimmer command and forwarding to Tuya sounds like a feasible solution?
  • #4 21812507
    lhakanl
    Level 2  
    I'm sorry, but I have given up on this one.
    I needed to replace the old broken unit.
    The power boards of both units are rather similar, and it turned out that it worked right off to swap out the BK7231 controller board and instead use the old ESP8266 controller board.
ADVERTISEMENT