Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tamHow to command EAWCBT-Tuya by openbk?
• Flash the EAWCBT-Tuya relay board with the current OpenBeken (OpenBK) firmware that matches its BK7231T/N SoC.
• Load the ready-made “EAWCBT-4CH-Relay” template (or manually map the GPIOs shown below).
• After the template is saved and the module reboots, the four relays can be commanded in several interchangeable ways:
– Web UI: click the four on-screen toggles.
– HTTP/REST:
http://<ip>/cm?cmnd=Power1%20On
(turn CH1 on)
http://<ip>/cm?cmnd=Power4%20Toggle
(toggle CH4)
– MQTT: publish to cmnd/<devTopic>/Power1
with payload ON / OFF / TOGGLE
(Tasmota-compatible).
– Local console / rules / scripts: Power1 1
, Power3 0
, Toggle 2
, or led_relay 1 1
.
These commands work immediately once Wi-Fi and (optionally) MQTT credentials are stored in the web interface.
1. Hardware overview
• EAWCBT-Tuya is a 4-channel dry-contact relay board powered by 7-36 V DC and built around a BK7231T (Beken) Wi-Fi MCU.
• Each relay has a corresponding tactile button and a Wi-Fi status LED (active-low).
• Original Tuya firmware is cloud-bound; OpenBeken provides 100 % local control.
2. Flashing OpenBeken
• Obtain the correct binary (OpenBK7231T_UA_x.x.x.bin
for BK7231T or _N_QIO_.bin
for BK7231N) from the “Releases” page of github.com/openshwprojects/OpenBK7231T_App.
• Put the module in download mode (hold CEN
low or power-cycle while GPIO0 is low, depending on PCB revision).
• Flash with hid_download_py
, bk_writer
, or OTA via Cloudcutter if the Tuya firmware revision is exploitable.
• After a successful flash the device starts in AP mode (SSID “OpenBK-xxxx”).
3. First-time web configuration
a) Connect to 192.168.4.1
, enter your LAN SSID / password → save.
b) Find the new DHCP address in your router and open it.
c) Load the template:
Config → Configure Module → Template → pick “EAWCBT-4CH Relay” ( firmware ≥1.17.260 ) → Save & Reboot.
If the template is missing, choose “Generic” and manually set:
| Pin | Role | Channel |
|----:|--------|--------:|
| P1 | LED_n | 1 |
| P26 | Relay | 1 |
| P24 | Relay | 2 |
| P9 | Relay | 3 |
| P6 | Relay | 4 |
| P20 | Button | 1 |
| P0 | Button | 2 |
| P10 | Button | 3 |
| P11 | Button | 4 |
d) (Optional) MQTT → fill broker IP, port, user/pass, and set a unique Client or Device Topic (e.g. eawcbt1
).
4. Command syntaxes (all equivalent)
• Web UI – auto-generated toggles and console field.
• HTTP (Tasmota-compatible /cm
endpoint):
GET /cm?cmnd=Power<ch> <On|Off|Toggle>
• Bare REST:
GET /api/channel/<ch>/set/<0|1|2>
(0 = off, 1 = on, 2 = toggle)
• MQTT (default topic scheme):
Command: cmnd/<topic>/Power<ch>
→ ON/OFF/TOGGLE
State: stat/<topic>/POWER<ch>
→ ON/OFF
• Console/Scripting:
Power3 0
, led_relay 2 1
, SetChannel 4 2
, etc.
• Home-Assistant: enable MQTT discovery or use the built-in REST integration.
5. Typical automation snippets
• Interlock (only one relay on):
addEventHandler OnChange 1 if $CH1==1 then Power2 0;Power3 0;Power4 0 endif
• Timed pulse (relay 2 on for 2 s):
Pulse 2 2000
• Daily schedule (relay 1 on at 07:30, off at 22:00):
addClockEvent 7 30 0 Power1 1
addClockEvent 22 0 0 Power1 0
• OpenBeken v1.18+ adds:
– Web-installer (Chrome, no USB-Uart needed on supported boards).
– JSON REST API /api
(documented in /api/help
).
– Native Home-Assistant autodiscovery (no YAML).
– Built-in templates database that now includes EAWCBT.
• Community focus is moving toward OTA exploits (Cloudcutter 3.0) to avoid soldering.
• Energy-measurement drivers and Matter gateway branch are in beta (2024-Q2 road-map).
• Command compatibility: OpenBeken intentionally mirrors Tasmota’s PowerX
and MQTT topic grammar, so most existing automation blueprints work unchanged.
• Why two command families (Power
vs led_relay
)? – Power
is the Tasmota façade; led_relay
/SetChannel
are the native engine spoken by rules and the REST API. Both manipulate the same internal channel state.
• Security: because everything is purely local, disable the legacy Tuya cloud on the phone app and set a strong Web UI password (Config → Security).
• Voltage domains: the relay contacts are dry, so you must supply the line you want to switch to COM
; then take the load from NO
or NC
.
• Flashing third-party firmware voids manufacturer warranty.
• Ensure isolation distances on the PCB meet your local safety regulations if you intend to switch mains voltage.
• Only control equipment within the relay’s rated current (usually 10 A max for resistive loads).
• Keep MQTT brokers and Web UI protected—unauthenticated open relays could cause property damage.
1. Keep a backup of the original Tuya firmware (bk_writer –r
) before flashing.
2. After first successful operation, export the template to a JSON file (Tools → Template → Export
).
3. Use an mDNS name (Config → Device Name → eawcbt1.local
) to avoid changing IP addresses in automations.
4. For bulk deployments, use the /api/channel
REST calls inside Ansible/Node-RED flows.
5. If a relay does not actuate, revisit GPIO mapping; 90 % of issues are wrong pin roles, not firmware bugs.
• Cloudcutter OTA only works on Tuya firmware build 1.0.6 and lower; newer batches may require UART flashing.
• Some early EAWCBT boards use BK7231N; the pinout above is still valid, but the firmware build must match the flash layout (QIO vs UA).
• Current OpenBeken does not yet expose RSSI/state via Home-Assistant if MQTT is disabled (planned).
• Test the beta Matter-over-MQTT bridge branch for platform-agnostic commissioning.
• Experiment with the Lua-like rule engine for more complex automations (edge counting, debouncing, inter-module messaging).
• Investigate adding ACS712/HLW8032 for current monitoring—the spare pins (e.g. P7/P8) can be repurposed.
• Join the #openbeken
Discord or the elektroda.pl thread for nightly builds and template sharing.
Flash the board with the latest OpenBeken, apply the EAWCBT template (or set the GPIOs manually), and you can drive any of the four relays locally through the Web UI, HTTP (/cm?cmnd=PowerX
), MQTT (cmnd/<topic>/PowerX
), or the on-board console. OpenBeken’s Tasmota-compatible command set plus its growing REST API make the EAWCBT-Tuya a fully local, automation-friendly 4-channel relay with no Tuya cloud dependence.