FAQ
TL;DR: This FAQ maps 13 dpIDs and explains why “You only need autoexec.bat” for the Milfra MFA05F. It is for OpenBeken users who flashed the BK7231N/CBU switch but lost PIR behavior, LED control, or active-hour logic until time sync and DP 101/102 were set correctly. [#21305821]
Why it matters: The thread shows that this switch can look half-broken after flashing even when the relay works, because the MCU still expects time, UART commands, and valid PIR scheduling.
| Wariant |
Moduł / architektura |
Jak go flashowano w wątku |
Główna konsekwencja |
| Starszy Milfra MFA05 |
ESP board |
Opisany jako łatwiejszy do flashowania |
Prostsza konfiguracja i mniej zależności od TuyaMCU |
| Nowszy Milfra MFA05F |
BK7231N + CBU + TuyaMCU |
tuya-cloudcutter lub serial po zablokowaniu MCU |
Wymaga autoexec.bat, dpID i synchronizacji czasu |
Key insight: The PIR path is controlled by the external MCU, not by direct GPIO. If local time or DP 101/102 are wrong, the sensor can stop triggering even though Wi‑Fi, browser control, and the relay still work. [#21062811]
Quick Facts
pir_delay on dpID 49 accepts 5–3600 s in 1 s steps, so motion hold time is configurable over a full 59 min 55 s range. [#21055031]
- The active PIR window uses dpID 102 start time and dpID 101 end time, each in 0–1440 min steps. A full-day window was set as
1 to 1440. [#21062811]
- Serial flashing attempts used the connector with TX/RX, GND, and 3.3 V, but one user only succeeded after grounding the board RST point and pulsing CEN. [#21154883]
- One blocked device reported Tuya firmware 2.1.17, which prevented use of tuya-cloudcutter and pushed the user toward ltchiptool over serial. [#21153165]
- The shared device template identifies BK7231N, CBU, model MFA05F, and flag value 1024, while the maintainer said the project had 565 devices and wanted to reach 600. [#21063907]
How do I configure the Milfra MFA05F motion sensor light switch in OpenBeken using the autoexec.bat from the thread?
Use the posted
autoexec.bat exactly, because this device is driven through TuyaMCU rather than normal GPIO pin mapping. 1. Start
NTP and
TuyaMCU, then call
tuyaMcu_sendCurTime. 2. Define Wi‑Fi state with
tuyaMCU_defWiFiState 4. 3. Create channels for relay, brightness switch, PIR switch, PIR delay, and PIR sensitivity, then send dpID states for LED mode and PIR hours. The working example sets PIR delay to
120 s, sensitivity to
Mid, and active hours to
1–1440 min.
[#21062811]
Why does the PIR sensor on the Milfra MFA05F stop working until tuyaMcu_sendCurTime and the DP 101/102 time window are set correctly?
The PIR stops because the MCU enforces an internal time schedule. The fix was not MQTT itself; it was sending local time with
tuyaMcu_sendCurTime and keeping dpID
102 start time plus dpID
101 end time valid. The user confirmed the switch “suddenly stopped working” because local time was missing, and motion resumed after time sync was added. A full-day schedule was sent as start
1 min and end
1440 min.
[#21062811]
What are the TuyaMCU dpIDs for the Milfra MFA05F, including relay, PIR, light sensor, sensitivity, delay, and timer functions?
The mapped dpIDs are:
1 relay
switch_1,
14 power-on state,
15 status LED mode,
43 light-sensor enable,
44 light-sensor state,
45 light threshold mode,
46 PIR enable,
47 PIR state,
48 PIR sensitivity,
49 PIR delay,
101 PIR end time,
102 PIR start time, and
103 timer raw data. That gives
13 datapoints in the shared dump. Sensitivity supports
low,
middle,
high, and delay spans
5–3600 s.
[#21055031]
What is a TuyaMCU device, and how is it different from a normal OpenBeken device that uses direct GPIO pins?
A TuyaMCU device does not expose most functions as direct GPIO roles inside OpenBeken.
"TuyaMCU" is a microcontroller-based control layer that handles sensors and relay logic over UART, instead of letting the Wi‑Fi chip drive each pin directly. On this MFA05F, OpenBeken mainly talks through
UART1, while the external MCU owns PIR, timing, and mode logic. That is why the maintainer said you only need
autoexec.bat, not a normal pin template.
[#21305821]
What is the CBU module in a BK7231N switch, and why does it matter for flashing and configuration?
The CBU is the Wi‑Fi module fitted in this switch, and it matters because you flash that module, not the whole motion-control design.
"CBU" is a BK7231N-based Wi‑Fi module that runs the network firmware, while a separate MCU still controls relay and sensor behavior through serial communication. That split explains why flashing OpenBeken alone does not automatically expose PIR as a direct sensor. The posted template names the board
CBU and chip
BK7231N.
[#21063907]
How can I flash the BK7231N/CBU version of the Milfra MFA05F with tuya-cloudcutter instead of serial flashing?
Use tuya-cloudcutter only if your unit still supports that cloud exploit path. One user flashed this exact BK7231N/CBU MFA05F with
tuya-cloudcutter and moved it to OpenBeken without serial work. Another user later reported firmware
2.1.17, which blocked cloudcutter and forced serial experiments instead. The practical rule from the thread is simple: if cloudcutter works on your firmware, it is easier than fighting the TuyaMCU board over serial.
[#21092461]
What steps worked for flashing the MFA05F via serial with ltchiptool by holding the board RST pad to GND and pulsing CEN?
The successful serial method was to keep the board’s
RST pad tied to
GND during power-on, then pulse
CEN to
GND until ltchiptool connects. 1. Ground the pad labeled
RST. 2. Power the board while RST stays low. 3. Tap
CEN to GND a few times until flashing starts. The user said this finally worked after repeated failures, and the board light blinked during reset attempts.
[#21154883]
Why does applying the web app template on this MFA05F seem to revert to default, while autoexec.bat still creates the working channels?
It happens because the template is not the main configuration mechanism for this TuyaMCU design. The maintainer explained that this device uses no normal pins except
UART1, so the web template can still look generic while
autoexec.bat creates working relay, PIR, and delay channels. A user saw the template appear to reset, yet the browser UI still exposed three switches after copying the script. In short, the script matters more than the template here.
[#21305821]
How do I set the status LED mode, PIR delay, PIR sensitivity, and active hours on the Milfra MFA05F with tuyaMcu_sendState commands?
Send the settings directly to the MCU using the datapoint numbers from the working script. The thread uses
tuyaMcu_sendState 15 4 1 for LED mode, links dpID
49 to a text field and sets
120 s delay, maps dpID
48 to
LowMidHigh and sets value
1 for Mid, then sends dpID
102 start time
1 and dpID
101 end time
1440. Those values restored expected LED and PIR behavior on the posted unit.
[#21062811]
What does the OpenBeken flag for TuyaMCU queue do, and when should it be enabled on devices like the MFA05F?
The thread recommends enabling the TuyaMCU queue when this switch is working but still depends on several UART commands and state exchanges. The maintainer suggested that the user “may also want to enable TuyaMCU queue in the flags” right after the final working setup was confirmed. The shared template later showed flags value
1024, which matches that recommendation in the posted device entry. Use it on MCU-driven devices where orderly command handling matters.
[#21063907]
How can I troubleshoot a flashed MFA05F where the relay works from the browser but the PIR and brightness sensor do not respond?
First, verify time sync and the PIR schedule. 1. Add
startDriver NTP, set an NTP server, and call
tuyaMcu_sendCurTime. 2. Send valid dpID
101/102 active hours. 3. Explicitly set PIR sensitivity and delay at least once. The failure pattern in the thread was clear: relay control worked from the browser, but PIR and light-sensor behavior failed until time and schedule were corrected. Another user later said PIR sometimes still needed dpID
101/102 adjustments or a reset.
[#21243160]
What is the difference between the older Milfra MFA05 with an ESP board and the newer MFA05F with BK7231N CBU and TuyaMCU?
The older MFA05 is easier to repurpose because it uses an ESP-based design, while the newer MFA05F adds a BK7231N CBU module plus a separate TuyaMCU. The thread explicitly calls the older version “easy to flash,” but the newer board needs cloudcutter compatibility or careful serial work. That hardware split also limits sensor access: on the MFA05F, PIR behavior stays inside the MCU unless you keep its UART protocol satisfied.
[#21092461]
How could I capture or inspect the UART traffic from the MFA05F running original Tuya firmware to discover missing datapoints or initialization commands?
Keep one switch on original firmware and log the serial exchange between the Wi‑Fi module and the MCU. The thread proposed exactly that after users found missing PIR behavior under Tasmota and ESPHome. One participant asked for a device with original firmware so they could see “what is being sent back and forth over the UART,” and another requested a
2 MB flash backup or config extract to confirm missing datapoints. That is the cleanest path to discover hidden initialization.
[#21224168]
What options are there for decoupling the PIR sensor from the relay on the Milfra MFA05F so it can be used with smart bulbs and automations?
You have only hardware-heavy options in this thread. The maintainer said you could remove the MCU, remove the Wi‑Fi module, or cut the MCU connection, then wire the relay and PIR differently. Another user wanted PIR events without relay triggering for smart bulbs, but found the behavior hard-coded in the MCU and saw no motion datapoint logged in ESPHome. The same reply warned that some PIR circuits may need PWM-based sensitivity handling, so the mod can grow complex fast.
[#21155031]
Why is PIR motion detection on some MFA05F units unreliable even with the light sensor disabled and sensitivity set to low, medium, or high?
The thread never reached a final root cause, but it points to MCU-side initialization and schedule state. One user reported the light turned on late “more often than not,” even in a windowless room with the light sensor supposedly disabled. Others said PIR did not work until they changed dpID
101/102, and one unit sometimes needed a reset afterward. The best thread-backed explanation is incomplete MCU state, not a simple OpenBeken GPIO issue.
[#21243160]
Generated by the language model.