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

Czy wolisz polską wersję strony elektroda?

Nie, dziękuję Przekieruj mnie tam

Exploring the WiFi + RF Curtain Module [BK7231N] from Aliexpress: Features & Installation

atomphil  26 6480 Cool? (+8)
📢 Listen (AI):

TL;DR

  • A WiFi + 433 MHz RF curtain module from Aliexpress was modified to control a sunblind with Home Assistant.
  • The board uses stacked radio modules with a CB2S WiFi module under the RF module, and the flashing contacts stay accessible on the jumper board.
  • It has eight terminals instead of six, and the board is labeled HFY-CL02WF+RF Rev 2.0.
  • Flashing OBK with BK7231Flasher.exe worked easily, all GPIOs were recognized correctly, and the 433 MHz remote operated the three buttons.
  • The script timing still needs adjustment for the specific roller shutter, and Home Assistant integration is still unfinished.
Generated by the language model.
I bought a Wifi module with additional 433 MHz RF remote control from Aliexpress to be able to control our sunblind with HA.
In contrast to the even cheaper models, it has eight instead of six terminals, so you don't need any additional connectors for the neutral conductor (and phase if you want to use the hardware buttons). This allows simpler, cleaner and safer cabling.

WiFi+RF 433 MHz Module for Blinds with Remote on AliExpress

The following was delivered w/o a box:

Wi-Fi+RF curtain module with manual and accessories.

Manual:

Wi-Fi and RF curtain control module instruction manual Manual for WiFi module with RF 433 MHz remote control for blind operation.

The module from the outside and inside:

Wi-Fi and RF curtain control module with visible connectors and labels. WiFi module with additional terminals and capacitors on the circuit board. Close-up of the PCB board of the HFY-CL02WF+RF Rev 2.0 module showing electronic components.

Labelling on the board: HFY-CL02WF+RF Rev 2.0
The radio modules are stacked with a jumper board. The Wifi module is under the RF module, from the side it is visible that it is a CB2S.

Close-up of an electronic module showing the label CBE, circled in red.

The module does not have to be desoldered to flash OBK, the contacts are easily accessible on the jumper board. Flashing with BK7231Flasher.exe is very easy, even all GPIOs are recognised correctly.

Close-up of a WiFi module with RF 433 MHz remote, showing GND, VDD, RX, and TX labels.
The Pin layout is as follows:
PinSetting
6Relais 1
7Relais 3
10WifiLED
23Button 2
24Button 1
26Button 3


Configuration:
Code: JSON
Log in, to see the code


I have entered the following autoexec.bat (I have copied the script from here):


startDriver SSDP
PowerSave 1

// P6  - Relay 1 Close
// P7  - Relay 3 Open
// P24 - Btn   1 Close
// P23 - Btn   2 Stop
// P26 - Btn   3 Open

// 10  - Wifi LED

// description
SetChannelLabel 1 Close
SetChannelLabel 2 Stop
SetChannelLabel 3 Open

// logic
alias Reset_Stop_Close backlog SetChannel 2 0; SetChannel 1 0
alias Reset_Stop_Open backlog SetChannel 2 0; SetChannel 3 0
alias Reset_Close_Open backlog SetChannel 1 0; SetChannel 3 0

addChangeHandler Channel1 == 1 Reset_Stop_Open
addChangeHandler Channel1 == 1 backlog startScript autoexec.bat resetCloseAfterMinute
addChangeHandler Channel2 == 1 Reset_Close_Open
addChangeHandler Channel2 == 1 backlog startScript autoexec.bat resetStopAfterSecond
addChangeHandler Channel3 == 1 Reset_Stop_Close
addChangeHandler Channel3 == 1 backlog startScript autoexec.bat resetOpenAfterMinute

// do not proceed
return

// Scripts

resetCloseAfterMinute:
// wait 30 seconds
delay_s 30
// stop opening
SetChannel 1 0
// done
return

resetStopAfterSecond:
// wait 1 second
delay_s 1
// disable button
SetChannel 2 0
// reset all scripts
stopAllScripts
// done
return

resetOpenAfterMinute:
// wait 30 seconds
delay_s 30
// stop opening
SetChannel 3 0
// done
return


Everything has worked wonderfully so far, the RF remote control works on the three buttons, so it can also be used. The control times in the script still need to be adapted to the respective roller shutter.

I still have to work on a nice integration in Home Assistant. If anyone has any good advice on this, I would be happy to hear it.

Wi-Fi + RF curtain module with eight terminals and labels.

About Author
atomphil wrote 31 posts with rating 17 , helped 4 times. Been with us since 2023 year.

Comments

rodionzhitomirsky 15 Jan 2024 02:35

Hi! Your post was very helpful in exploring the same device on my side! Thanks! I went a bit further and fully integrated it into the HA. Here is my autoexec.bat (it also sets up the Channels, but... [Read more]

p.kaczmarek2 16 Jan 2024 23:43

That's a very nice script. We've also had some detailed scripting attempt presented here: Teardown of a Smart Life Curtain (Shutter) switch, Flashing, Configuring and setting up with HA [Read more]

rodionzhitomirsky 17 Jan 2024 02:51

Thank you! The thread you mentioned was my inspiration :). I just wanted to go further and have a possibility to somehow calibrate the roller and have possibility to open it to certain percentage. [Read more]

dawsonlebrown 28 Jan 2024 12:23

Thanks for this. I have just bought the same module, and was relieved to find this thread. I have implemented your scripts, and the module is working mostly correctly when triggering it through HA,... [Read more]

p.kaczmarek2 28 Jan 2024 12:55

That's a very strange issue. I tried to replicate that in a self test: flags 1156 here: https://github.com/openshwprojects/OpenBK7231T_App/commit/620df5ffe055e9e951d5bf2b5d323d3a0d28993b but... [Read more]

dawsonlebrown 28 Jan 2024 16:03

Sure, what I did was: using BK7231Flasher.exe 1.1.6 and with an identical "curtain module as in the OP", I clicked the "Do backup and flash new" button without having first downloaded the latest firmware... [Read more]

Angel0fDeath 29 Jan 2024 18:03

I found the same issue and reported here: https://www.elektroda.com/rtvforum/topic4022907-60.html However by me that occurs after issuing flags 0 command (to clear all flags) If I clear them manual,y,... [Read more]

cikaybe 28 Sep 2024 11:54

Is there any rf remote configuration that is needed? [Read more]

rodionzhitomirsky 28 Sep 2024 13:57

No. Rf functionality is implemented by other hardware apparently. So, you still can bind a remote and it will act as the native buttons. [Read more]

GAAD 17 Dec 2024 21:41

The controllers work, but I have a problem as above with flags 1156 I also cannot calibrate the shutters with a longer operating time. Can someone describe the calibration process step by step? If... [Read more]

p.kaczmarek2 18 Dec 2024 01:31

autoexec.bat script was not made by me and may not be perfect. If you have some time and will, we could try to chat together and come up with a better driver, but you would have to do the testing and... [Read more]

GAAD 18 Dec 2024 10:08

Of course I would be very happy to thank you for wanting to help. First problem - configuration as a roller shutter as in Tasmota, which automatically excludes the activation of both relays - if I remember... [Read more]

p.kaczmarek2 18 Dec 2024 10:42

I see... now, how should it be implemented in OBK? Can you make a draft (in Paint or on paper) of OBK web panel for shutter controller? What if there is a power outage during opening/closing? Should... [Read more]

GAAD 18 Dec 2024 18:06

I think it's better for it to remember the state before the restart. Exactly. This is the time to start opening and finish closing. We also need to exclude switching on during restart after incorrect... [Read more]

gliga69 25 Dec 2024 22:50

Hi, I’m trying to enhance the autoexec.bat file mentioned above. I’d like to add three buttons to the web interface that work in sync with the physical buttons, and I also want the physical buttons... [Read more]

GAAD 04 Jan 2025 14:55

It seems to me that it would be necessary to make one universal script for all roller shutter control modules. The declared parameters are: 1. flag in General Flag: curtain switch - automagically 2 buttons:... [Read more]

antonioriosarroyo 14 Mar 2025 22:23

Hi! Your post was very helpful in exploring the same device on my side! Thanks! I went a bit further and fully integrated it into the HA. Here is my autoexec.bat (it also sets up the Channels, but... [Read more]

p.kaczmarek2 14 Mar 2025 22:32

Hey I've checked with latest simulator and I guess buttons appears for me? I am referring to this autoexec.bat: https://www.elektroda.com/rtvforum/viewtopic.php?p=21362566#21362566 Not the one in earlier... [Read more]

antonioriosarroyo 14 Mar 2025 23:57

Thank you so much for responding. That one works for me, but the stop button doesn't. That's why I was trying to use the other one. [Read more]

FAQ

TL;DR: This FAQ helps OBK and Home Assistant users flash an 8-terminal HFY-CL02WF+RF curtain module and make it reliable. "Flashing with BK7231Flasher.exe is very easy," and the board exposes GPIO, relays, buttons, RF support, and a CB2S/BK7231N design without desoldering. [#20820404]

Why it matters: This thread shows how to turn a low-cost Tuya curtain controller into a cleaner, safer, and more configurable blind module with MQTT, percentage control, and retained wall-button operation.

Option Control model Timing method Home Assistant depth Main advantage
Basic OBK script Open / Stop / Close Fixed 30 s example Minimal Fast setup for working relays
Advanced OBK + MQTT script Target position 0–100% Loop with CH7 and CH8 Full MQTT cover entity Percentage control and reboot state
HA-driven simple relay script Timing handled in HA 31 s close / 34 s open example High Easier when board button logic is awkward

Key insight: The hardware works well with OBK, but real-world success depends on correct pin mapping, firmware version, and timing calibration. Older firmware could break button behavior, while newer builds kept RF and local buttons usable together. [#20932845]

Quick Facts

  • The HFY-CL02WF+RF board exposes 8 terminals instead of 6, which lets you wire neutral and phase without extra connectors for cleaner installation. [#20820404]
  • Verified pin map on the CB2S/BK7231N module: P6 relay, P7 relay, P10 WiFi LED, P23/P24/P26 buttons. [#20820404]
  • The reference OBK script used 30 s travel examples, while one later setup measured 31 s closing and 34 s opening for a real blind. [#20820404]
  • The advanced MQTT integration stores blind state in CH9, tracks current position in CH10, and target position in CH11. [#20910126]
  • A reported button-lock issue appeared on OpenBK7231N_QIO_1.17.308 and disappeared after upgrading to 1.17.427. [#20932845]

How do I flash OpenBK7231N on the HFY-CL02WF+RF WiFi + 433 MHz curtain module with a CB2S/BK7231N chip without desoldering the module?

You can flash it directly from the exposed contacts on the interconnect board, so you do not need to desolder the module. 1. Open the controller and locate the stacked RF and WiFi boards. 2. Connect BK7231Flasher.exe to the accessible flashing pads on the jumper board. 3. Flash OBK and verify that the GPIOs are detected correctly. The original teardown states, "Flashing with BK7231Flasher.exe is very easy," because the CB2S contacts remain reachable from the side. [#20820404]

What is the CB2S module in Tuya curtain controllers, and how does it relate to the BK7231N platform?

"CB2S" is a Tuya Wi‑Fi module that provides wireless connectivity, and in this controller it is the board built around the BK7231N platform. In the HFY-CL02WF+RF, the RF daughterboard sits above it, and the WiFi board is visible from the side. The posted JSON identifies the device as model HFY-CL02WF+RF with chip BK7231N and board CB2S, so CB2S is the hardware module and BK7231N is the MCU family it uses. [#20820404]

What is autoexec.bat in OpenBK7231N, and how is it used to control relays, buttons, and curtain timing logic?

"autoexec.bat" is an OBK startup script that assigns pins, labels channels, and runs automation logic after each boot. In this thread, it maps relays and buttons, creates aliases like Set_Stop, and uses delays such as 30 s or 1 s to stop motion automatically. More advanced versions also store blind position in channels, drive MQTT topics, and launch named scripts such as openSkylightToTarget and stopSkylight. [#20910126]

How can I configure the HFY-CL02WF+RF curtain module pins correctly in OBK for relays, buttons, and the WiFi LED?

Use the published pin map: P6 and P7 for the two relays, P23/P24/P26 for the three buttons, and P10 for the WiFi LED. The shared device JSON assigns P6 to Relais 1, P7 to Relais 3, P10 to WifiLED, P23 to Button 2, P24 to Button 1, and P26 to Button 3. In script form, the board was used as Close on P6, Open on P7, Stop on P23, Close button on P24, and Open button on P26. [#20820404]

Why does flags 1156 sometimes seem to enable unexpected flags like child lock or extra MQTT-related options after reboot in older OBK firmware?

Older firmware could mislead users because some higher-numbered flags appeared active after reboot even when the visible numeric value still showed 1156. One report on version 1.17.308 saw Flag 41 enable button ignore, plus extra flags such as 35, 36, 37, 39, 41, 42, and 43. Another follow-up explained the number field only counts the first 32 flags, so the display can look inconsistent even when more flags are shown below. [#20933371]

Which OpenBK7231N firmware version fixed the issue where Flag 41 ignored physical button events on this curtain module?

OpenBK7231N_QIO_1.17.427 fixed the reported issue on this curtain module. The failing setup used OpenBK7231N_QIO_1.17.308, where Flag 41 reappeared after reboot and physical wall buttons stopped working. After upgrading to 1.17.427, the same user reported that Flag 41 no longer set itself and the buttons worked normally after restart. [#20932845]

How do I integrate this BK7231N curtain module with Home Assistant over MQTT, including open, close, stop, and percentage position control?

Use OBK MQTT topics for relay state and channel-based position, then expose them as a Home Assistant template cover. The working example publishes current position on channel 10, target on channel 11, opening on channel 1, and closing on channel 3. Home Assistant then calls scripts that publish SetChannel 11 <position> followed by Open_To_Target, while stop publishes cmnd/<cover_id>/Stop_All. That gives open, close, stop, and 0–100% position control from one cover entity. [#20910126]

What is the best way to calibrate opening and closing times for roller shutters in OBK when the up and down travel times are different?

The best approach in this thread is to treat travel as time-based and allow separate values for each phase. One proposal suggests one simple mode with a single full-travel time, plus an advanced mode with separate times for unsealing, main opening, main closing, and resealing. That design handles shutters whose first seconds only open slats and whose upward and downward speeds differ, while still preserving percentage tracking as accurately as the timing model allows. [#21353191]

Where should I set the travel-time value in the OBK script if my blinds take about 31 seconds to close and 34 seconds to open?

Set the timing in the delay values used by the motion script, not in the pin map. One user first noted that the advanced script’s SetChannel 8 was the key timing value and found 2400 worked for his setup. He then switched to a simpler script with explicit delays, using delay_s 31 for closing and delay_s 34 for opening. If your blind stops halfway, adjust those timing lines first. [#21563330]

How can I make the physical wall buttons and the OBK web UI buttons stay synchronized when controlling a curtain or blind module?

Create separate GUI channels for Up, Stop, and Down, then bind both physical button events and GUI channel changes to the same aliases. A later script used channels 20, 21, and 22 as web buttons, hid the relay channels, and added handlers so wall-button presses and GUI clicks both called Start_Opening, Start_Closing, or Stop_Clicked. It also forced the inactive GUI buttons low when another direction became active, which keeps the interface aligned with the hardware state. [#21362566]

Why does the stop button in some OBK curtain scripts fail to sync properly with the end stops or remain highlighted incorrectly in the GUI?

The stop state can desynchronize when the script stops motion but does not reset the GUI channels at the same time. One working fix changed the Channel21 handler to call stopSkylight and added resets for channels 20 and 22 during calibration and stop handling. Before that adjustment, users reported the Stop button did not sync with end stops and the active direction could remain highlighted in green after the blind had already stopped. [#21482463]

What comparison is there between a simple time-based OBK curtain script and a more advanced Home Assistant-driven control script for blinds?

The simple OBK script is easier to tune, while the HA-driven approach gives better logic and percentage control. A minimal version only switches relays and waits fixed times like 31 s and 34 s, leaving most behavior to home automation. The advanced OBK script keeps CH9, CH10, and CH11 for saved, current, and target position, then exposes them over MQTT for full cover control. Choose the simple script when the board’s button logic is awkward, and the advanced script when you want local percentage movement. [#21563330]

How does the built-in 433 MHz RF remote work with the HFY-CL02WF+RF module after flashing OBK, and what RF configuration is actually needed?

No extra RF configuration was required in the reported setup. After flashing OBK, the 433 MHz remote still worked through the device’s separate RF hardware and behaved like the native buttons. A later reply confirmed that you can still bind a remote normally because the RF function is handled outside the OBK-controlled WiFi logic, so OBK does not need a dedicated RF script here. [#21242422]

What safety logic should be used in OpenBK7231N to prevent both shutter relays from turning on at the same time during operation or reboot?

Always clear the opposite relay before energizing a direction, and keep a short dead-time between direction changes. The advanced script does this with Set_Stop, then waits CH7 milliseconds before motion starts. A design discussion later stressed that a shutter mode should automatically exclude both directions at once, because users had seen bad flag states during reboot briefly enable both relays. Saved position after restart was also considered safer than blindly resetting movement state. [#21353788]

How could a universal OBK roller shutter driver be designed to support 2-button and 3-button switches, saved position after power loss, and optional separate times for unsealing, opening, closing, and resealing?

A universal driver should expose a shutter mode, four basic I/O parameters, one mandatory full-travel time, and optional advanced timing fields. The proposed design supports either 2 buttons or 3 buttons, prevents both relays from being active together, and remembers position across restart. For advanced users, it can add separate timing values for unsealing, opening, closing, and resealing, plus percentage channels for Home Assistant. That would cover simple limit-switch blinds and more precise time-based shutters in one model. [#21376628]
Generated by the language model.
%}