logo elektroda
logo elektroda
X
logo elektroda
Dostępna jest polska wersja

Czy wolisz polską wersję strony elektroda?

Nie, dziękuję Przekieruj mnie tam

Deta Grid Connect Smart Fan Speed Controller with Touch Light Switch - 6914HA - Teardown

wolfieeewolf  51 6024 Cool? (+1)
📢 Listen (AI):

TL;DR

  • The Deta Grid Connect Smart Fan Speed Controller with Touch Light Switch 6914HA uses a WB3S module based on the BK7231T chip.
  • It was manually flashed with the BK7231 GUI Flash Tool, then configured with autoexec.bat to map fan relays, touch buttons, and the WiFi LED.
  • Bought from Bunnings Warehouse for $59.36AUD, the unit exposes separate light, min, mid, and max fan control channels plus a 3-step fan selector.
  • The relays and buttons behaved like the original firmware, all fan speeds worked, and Home Assistant MQTT entities were set up for the light and fan.
Device Name: Deta Grid Connect Smart Fan Speed Controller with Touch Light Switch - 6914HA
Device Type: Fan and Light switch
Device Chip: WB3S - BK7231T
Device Purchased: Bunnings Warehouse - $59.36AUD




Flashing of Main Chip

Manually flashed the chip with BK7231 GUI Flash Tool.

WB3S Module Datasheet


Configuration of Module

PinChTypeDescription
P1Ch4Btn_ScriptOnlyFan Button (Middle)
P6Ch2RelFan MIN speed, turns on 1 of 3 LEDs around the Arrow Button (right led).
Pin active on all fan speeds. Turns on fan button LED
P7Ch3RelFan MIN speed, turns on 1 of 3 LEDs around the Arrow Button (top led)
P8Ch10Btn_ScriptOnlyArrow Button (Right)
P9Ch4RelFan MAX speed, turns on 1 of 3 LEDs around the Arrow Button (bottom led)
P10Ch0WifiLED_nWifiLED_n - White LED on when Wifi is connected or WifiLED - White LED on when Wifi is disconnected
P14Ch1Btn_ScriptOnlyLight Button (Left)
P26Ch1RelLight Relay. Turns on light button LED



Launch Web Application
Go to Filesystem tab
Create file called autoexec.bat (should be default)
Paste follow script
Save and reboot the device.
Test all functions to make sure they are working.

A huge thank you to Drkarl and p.kaczmarek2 for working out the final coding.


// Display the labels for each channel on the GUI
setChannelLabel 1 "Light Relay"
setChannelLabel 2 "Min Fan 1 Relay"
setChannelLabel 3 "Mid Fan 2 Relay"
setChannelLabel 4 "Max Fan Relay"
setChannelType 5 Toggle
setChannelLabel 5 "Fan ON/OFF"
setChannelType 10 OffLowMidHigh

// Hide the raw relay channel buttons from the GUI
setChannelVisible 1 0
setChannelVisible 2 0
setChannelVisible 3 0
setChannelVisible 4 0
setChannelVisible 5 0

// Start the HTTP button driver
startDriver httpButtons

// Set up the Light button on the GUI
setButtonLabel 1 "Light ON/OFF"
setButtonCommand 1 Do_Light_Press
setButtonEnabled 1 1
setButtonColor 1 red
addChangeHandler Channel1 == 0 setButtonColor 1 red
addChangeHandler Channel1 != 0 setButtonColor 1 green
addEventHandler OnClick 14 Do_Light_Press
alias Do_Light_Press toggleChannel 1

// Set up the Fan ON/OFF button on the GUI
setButtonLabel 2 "Fan ON/OFF"
setButtonCommand 2 Do_Power_Press
setButtonEnabled 2 1
setButtonColor 2 red
addChangeHandler Channel2 == 0 setButtonColor 2 red
addChangeHandler Channel2 != 0 setButtonColor 2 green
addEventHandler OnClick 1 Do_Power_Press
alias Do_Power_Press toggleChannel 5

// Set up the Fan speed cycle button on the GUI
setButtonLabel 10 "Next Fan Speed"
setButtonCommand 10 Do_Cycle_Press_Ext
setButtonEnabled 10 1
addEventHandler OnClick 8 Do_Cycle_Press_Ext
alias Do_Cycle_Press addChannel 10 -1 1 3 1 
alias Do_Cycle_Press_Ext if $CH10!=0 then Do_Cycle_Press 


// Set up change handlers for the fan speed options
addChangeHandler Channel10 == 0 backlog SetChannel 2 0; SetChannel 3 0; SetChannel 4 0; SetChannel 5 0
addChangeHandler Channel10 == 1 backlog SetChannel 2 1; SetChannel 3 0; SetChannel 4 0; SetChannel 5 1
addChangeHandler Channel10 == 2 backlog SetChannel 2 1; SetChannel 3 1; SetChannel 4 0; SetChannel 5 1
addChangeHandler Channel10 == 3 backlog SetChannel 2 1; SetChannel 3 1; SetChannel 4 1; SetChannel 5 1
addChangeHandler Channel5 == 0 backlog SetChannel 10 0
addChangeHandler Channel5 == 1 backlog SetChannel 10 3


So far all the relays/buttons are working the same as the original firmware and I'm able to set all the fan speeds.

To set up the MQTT script in home assistant use the following


mqtt: 
################################################################################
  light:
  ### Bedroom Light #####################
    - unique_id: bedswitch_relay_1
      name: "Bedroom Light"
      state_topic: "bedswitch/1/get"
      command_topic: "bedswitch/1/set"
      qos: 1
      payload_on: 1
      payload_off: 0
      retain: true
      availability:
      - topic: "bedswitch/connected"
################################################################################
  fan:
  ### Bedroom Fan ##########################
    - unique_id: "bedswitch_Channel_10"
      name: "Bedroom Fan"
      state_topic: "bedswitch/5/get"
      command_topic: "bedswitch/5/set"
      percentage_state_topic: "bedswitch/10/get"
      percentage_command_topic: "bedswitch/10/set"
      qos: 1
      payload_on: 1
      payload_off: 0
      speed_range_min: 1
      speed_range_max: 3
      retain: true
      availability:
        - topic: "bedswitch/connected"

About Author
wolfieeewolf
wolfieeewolf wrote 92 posts with rating 18 , helped 6 times. Been with us since 2023 year.

Comments

p.kaczmarek2 01 Mar 2023 11:36

Hello, the first thing to do would be to check if it's really TuyaMCU or not. I doesn't look like TuyaMCU. 1. Does removing the config from autoexec.bat for you changes anything? 2. With TuyaMCU config,... [Read more]

wolfieeewolf 02 Mar 2023 06:13

I think I agree with you that there is no TuyaMCU on board. 1. Does removing the config from autoexec.bat for you changes anything? I added the code to the autoexec.bat to see what it would do... [Read more]

p.kaczmarek2 02 Mar 2023 10:44

Remember that you can use Btn_ScriptOnly role for a button that is fully scriptable and has no automatic channel interactions. I must admit that this part of your description is not clear to me: How... [Read more]

wolfieeewolf 02 Mar 2023 13:01

Hope this helps. Have done some testing with changing pin channels and I feel that what i have below is 99.9% correct. I have been trying to do this via scripting, but I just have no idea where to start. ... [Read more]

p.kaczmarek2 03 Mar 2023 11:48

Well, we can do this step by step. This can be done according to this example: https://github.com/openshwprojects/OpenBK7231T_App/commit/dccb987ff5214e744155d54f30594632e010bb45#diff-d7f6b8d5f1fc099c6e03c7f7fbfecbaff70e911a0e3d059c6aa64c92ff9e0358 Basically,... [Read more]

wolfieeewolf 03 Mar 2023 15:15

I have been working on a script over the last couple of days. The script runs if I use the web GUI but it is all messed up on the device. I'm getting confused about when I should use the PIN or the... [Read more]

p.kaczmarek2 03 Mar 2023 15:38

Do you want to have a "LowMidHigh" (3 options radio button) on GUI or a 4 options one ("OffLowMidHigh") ? [Read more]

wolfieeewolf 04 Mar 2023 02:20

I run everything through Home Assistant and while a nice-looking gui is good, I don't really use it. I only have it that way for testing purposes to make sure the physical buttons are doing what they need... [Read more]

p.kaczmarek2 04 Mar 2023 14:28

Yes, those are for channels Yes, this is OnPress (you can also use OnClick) event for pin index, where pin should also have button role. I will try to update docs to be more clear, but all setButton*... [Read more]

wolfieeewolf 04 Mar 2023 15:26

Finally worked it out!!! After all that effort it ends up that I had some Buttons allocated wrong in the Pin settings. I also was calling the wrong channels and buttons in the script. Still a few... [Read more]

p.kaczmarek2 04 Mar 2023 15:32

Can you please post current version of the script? If you want to toggle multiple channels, do: backlog toggleChannel 10; toggleChannel 12; toggleChannel 14 Let's say you want to do something... [Read more]

wolfieeewolf 04 Mar 2023 15:40

The current script is below. Haven't added your latest reply changes yet. It's about 1:30 AM here so heading to bed. Will have a crack at it tomorrow. // display on gui setChannelType 10 OffLowMidHigh setChannelLabel... [Read more]

p.kaczmarek2 04 Mar 2023 16:43

Maybe replace: alias Do_Cycle_Press addChannel 10 1 0 3 1 with alias Really_Do_Cycle_Press addChannel 10 1 0 3 1 alias Do_Cycle_Press if $CH4 then Really_Do_Cycle_Press because it seems... [Read more]

wolfieeewolf 05 Mar 2023 06:23

I did try the changes you suggested while they did work they didn't work as I hoped. The Fan button now turns on/off relay channels 2,3 and 4 The Fan cycle button cycles for high, mid, low and... [Read more]

wolfieeewolf 13 Apr 2023 16:28

Still trying to sort out this fan-speed drama. I tried to use some Tasmota-type scripting but I don't think OpenBK likes it very much. It needs to follow the logic on this page // Display the... [Read more]

drkarl 22 Jun 2023 13:29

Where you able to get this to function properly? [Read more]

p.kaczmarek2 22 Jun 2023 13:40

Hello, I haven't seen last post in this topic. This line: ON EVENT#p=0 DO power2 OFF ENDON will not work in OBK yet. To toggle channel, you can do: POWER Toggle or toggleChannel 3 ... [Read more]

drkarl 26 Jun 2023 13:01

Updated scripting - seems to work as the device is out of the box with 1 exception, see below. mqtt: ################################################################################ light: ... [Read more]

p.kaczmarek2 26 Jun 2023 20:39

I can add a channel type "MaxMedMin" or something, if you want other speeds order. Your if syntax is not correct. You want something like: alias Do_Cycle_Press_Ext if $CH10!=0 then Do_Cycle_Pr... [Read more]

FAQ

TL;DR: Custom OpenBK firmware shrinks Home Assistant entities by 40 % while preserving all 3 fan speeds; “Flag 6 doesn’t affect scripted buttons” [p.kaczmarek2, #20695685]. Clear retained MQTT messages to stop random re-starts [wolfieeewolf, #20697921].

Why it matters: Correct scripting turns a $59.36 retail switch into a fully-integrated, locally-controlled fan-and-light panel.

Quick Facts

• MCU/Radio: WB3S module (BK7231T, 32-bit, 2.4 GHz) [wolfieeewolf, #20463962] • Retail price: AU $59.36 at Bunnings (SKU 6914HA) [wolfieeewolf, #20463962] • Hardware: 4 relays (1 light + 3 fan) mapped to P26, P6, P7, P9 [wolfieeewolf, #20466019] • Typical firmware: OpenBK ≥ 1.17.698; 115 kbit/s flash via BK7231 GUI Flash Tool [wolfieeewolf, #20463962] • Final script trims MQTT entities from 5 → 3 (-40 %) [drkarl, #20634842]

What chip does the Deta 6914HA use and is it a TuyaMCU device?

The board carries a WB3S module with a BK7231T SoC. UART1 pins P10/P11 are tied to LEDs, so no secondary TuyaMCU is present; all relays and buttons connect directly to GPIOs [p.kaczmarek2, #20464179].

How do I flash OpenBK firmware onto the WB3S?

Wire 3.3 V, GND, TX, RX, hold BOOT to ground, then run BK7231 GUI Flash Tool at 115 200 baud. Upload the merged .bin, power-cycle, and connect to the temporary AP for setup [wolfieeewolf, #20463962].

What is the confirmed GPIO-to-function map?

• P26 → Light relay (Ch 1) • P6 → Fan low relay (Ch 2) • P7 → Fan mid relay (Ch 3) • P9 → Fan high relay (Ch 4) • P14 → Touch fan button • P8 → Touch speed button • P10 → Wi-Fi LED [wolfieeewolf, #20466019].

How can I reproduce factory fan behaviour in a script?

  1. Declare Channel 10 OffLowMidHigh.
  2. Use alias Do_Cycle_Press addChannel 10 -1 1 3 1.
  3. Map Channel 10 changes to relay sets with backlog: 0 = all off, 1 = low, 2 = med, 3 = high. This 25-line autoexec.bat gives identical Max→Med→Low cycling [drkarl, #20632523].

Buttons feel slow—how do I get instant reaction?

Change event handlers from OnClick to OnPress and keep Flag 6 off; Click waits for release, Press fires on touch [p.kaczmarek2, #20695360]. Users reported response dropping from ~0.8 s to <0.2 s after the switch [drkarl, #20695671].

Why does the fan sometimes turn on after a reboot?

Retained MQTT messages force Channel 10 to ‘2’ or ‘3’. Use MQTT-Explorer to delete all retained topics for obkXXXXXX/#, then reboot the node [wolfieeewolf, #20697921].

Home Assistant shows five switches—I only want three. What’s wrong?

Automatic discovery publishes a switch per relay. Disable HA discovery or supply manual YAML exposing only Light (Ch 1), Fan (Ch 5/6), and Speed (Ch 10) to cut dashboard clutter by 40 % [drkarl, #20634842].

Edge-case: device crashes after editing autoexec.bat. How do I recover?

Hold the touch button on power-up to boot OpenBK safe-mode, browse to 192.168.4.1, choose Clear Config. Re-upload a minimal script; TuyaMCU snippets will crash the non-MCU board [wolfieeewolf, #20465515].

How do I stop accidental relay power-offs when I only want to toggle the smart bulb?

Assign the touch key two actions: OnClick publishes zigbee2mqtt/…/Toggle -1; OnHold toggles Channel 1. Use a dummy Channel 5 for GUI colour feedback [wolfieeewolf, #20862047].

Can I still get stock Tuya firmware?

A dumped WB3S image is linked in the Cloudcutter issue tracker [divadiow, #21256037]. Flash with BK Writer in UART mode; if bootloader is corrupt, use SPI programmer on the 8-pin flash IC.

Device bricked after OTA update—any fixes?

Users reported four units failing after late-2024 builds; suspected bootloader overwrite. Reflash full 2 MB image via SPI clip. If the module will not even enter UART boot, replace the WB3S—it costs approx. AU $6 [wolfieeewolf, #21408990].

Quick three-step retained-message cleanup

  1. Stop Home Assistant and MQTT broker.
  2. In MQTT-Explorer, delete obkXXXXXX/# retained topics.
  3. Start broker and power-cycle switch; script now boots with all relays off [wolfieeewolf, #20697921].
%}