FAQ
TL;DR: GHome SW6 on OpenBeken works with a ~10 W load-detect threshold; “Green LED will illuminate when the load is on and >10W.” Use simple event handlers or a Startup Command for correct MQTT control. [Elektroda, akosschneemaier, post #21538151]
Why it matters: This FAQ shows how to wire, script, and remotely control a BF7231N-based 3‑way switch with reliable state reporting.
Quick Facts
- Corrected pin: set Pin 6 to Rel (not Rel_n) for proper relay polarity. [Elektroda, akosschneemaier, post #21756650]
- Load detection: dInput_NoPullUp_n goes LOW when the load exceeds ~10 W; Green LED = ON, Red LED = OFF. [Elektroda, akosschneemaier, post #21538151]
- Working with 3‑way (paired with a non‑smart switch) confirmed “perfectly.” [Elektroda, akosschneemaier, post #21569154]
- Multiline Startup Command supports the same commands as autoexec.bat. [Elektroda, p.kaczmarek2, post #21760561]
- Device firmware dump shows unit patched against Cloudcutter exploit. [Elektroda, divadiow, post #21565391]
What is OpenBeken in this context?
OpenBeken is the firmware the user flashed onto the GHome SW6 (BF7231N) to replace the stock Tuya firmware and enable custom control, scripting, and MQTT integration. [Elektroda, akosschneemaier, post #21538151]
What pin setting is critical on the SW6?
Set Pin 6 to Rel, not Rel_n. This corrects relay polarity and ensures commands map to real circuit state. [Elektroda, akosschneemaier, post #21756650]
What is the full working pinout used by the community post?
Example mapping: 6=Rel_n;2 (later corrected to Rel), 14=LED;3 (Red), 22=Btn;2, 24=dInput_NoPullUp_n;3 (load sense), 26=LED_n;3 (Green), 28=Rel_n;1. [Elektroda, akosschneemaier, post #21565377]
How do I get correct MQTT on/off/toggle control and status?
Add event handlers so CH1 mirrors the sensed circuit state (CH3) and the relay channel toggles only when needed. Use: alias control_script if $CH1!=$CH3 then ToggleChannel 2; addEventHandler OnChannelChange 3 SetChannel 1 $CH3; addEventHandler OnChannelChange 1 control_script. [Elektroda, akosschneemaier, post #21565377]
Can I use Startup Command instead of autoexec.bat?
Yes. A single Startup Command string can replace autoexec.bat for this device, and it was tested successfully. “Tested, and the startup command works.” [Elektroda, akosschneemaier, post #21760468]
What Startup Command string was proposed?
Use: backlog powersave 1; alias control_script if $CH1!=$CH3 then ToggleChannel 2; addEventHandler OnChannelChange 3 SetChannel 1 $CH3; addEventHandler OnChannelChange 1 control_script. This sets power save and creates the handlers at boot. [Elektroda, divadiow, post #21756721]
Does OpenBeken support multiline Startup Command?
Yes. Multiline Startup Command and autoexec.bat share the same command implementation, so features match. [Elektroda, p.kaczmarek2, post #21760561]
How does load detection work on the SW6?
The dInput_NoPullUp_n line reads LOW when the attached load exceeds approximately 10 W. The Green LED indicates ON above that threshold; Red indicates OFF. [Elektroda, akosschneemaier, post #21538151]
Will this setup work in a real 3‑way with a non‑smart companion?
Yes. The poster uses it with a non‑smart switch and confirms full functionality once the handlers are in place. [Elektroda, akosschneemaier, post #21569154]
What if I want two smart switches in a 3‑way?
Use OpenBeken’s Tasmota Device Groups to synchronize state across two smart SW6 units on the network. [Elektroda, p.kaczmarek2, post #21544903]
Is there a native 3‑way driver coming?
A maintainer offered to implement a native C driver if needed. The working script may make it unnecessary. [Elektroda, p.kaczmarek2, post #21565621]
Where can I get the original firmware or logs?
The thread includes the original firmware upload and a detailed boot log for reference and diagnosis. [Elektroda, akosschneemaier, post #21538835]
Is the SW6 vulnerable to Cloudcutter?
The posted dump notes the device is patched against the Cloudcutter exploit, affecting OTA‑style flashing paths. [Elektroda, divadiow, post #21565391]
Why won’t the device list include my event handlers?
The device list cannot embed autoexec content. Use Startup Command, which the author notes could express needed logic. [Elektroda, divadiow, post #21756721]
Any platform limitations I should know?
OpenBeken cannot fetch HTTPS scripts directly (e.g., raw GitHub). The web app might fetch and push locally as a future workflow. [Elektroda, p.kaczmarek2, post #21760561]
How do I fix inverted relay behavior on new units?
Set Pin 6 to Rel. This corrects inversion seen with Rel_n and aligns physical output with software commands. [Elektroda, akosschneemaier, post #21756650]
How do I set up the SW6 for a non‑smart 3‑way in three steps?
- Assign pins (Btn, LEDs, dInput_NoPullUp_n=load sense, Relay, etc.) in OpenBeken.
- Add alias/control_script and two addEventHandler lines to keep CH1 synced and toggle CH2 only when needed.
- Reboot and verify button and MQTT on/off/toggle update CH1 correctly.
“Works perfectly.” [Elektroda, akosschneemaier, post #21565377]
What does the boot log tell me about the Tuya build?
The shared log shows a Tuya SDK build compiled on Apr 10, 2024, and BLE/Wi‑Fi init details for troubleshooting. [Elektroda, divadiow, post #21565391]