logo elektroda
logo elektroda
X
logo elektroda

Configuring Tuya Usee Link Surge Protector BK7231N with JSON Pins Setup

dbryan  1 1299 Cool? (0)
📢 Listen (AI):

TL;DR

  • Tuya Usee Link USB-C PD Surge Protector SM-306U-PA65 uses a BK7231N CBU board with a JSON pin setup for its relays and LEDs.
  • The pin map assigns GPIO 6, 7, 8, 9, and 24 to Rel1–Rel5, GPIO 17 to LED6, GPIO 22 to Btn_Tgl_All8, and GPIO 28 to WifiLED7.
  • Keywords identify it as a 4-port USB-C PD powerstrip, and the configuration file includes the device image and wiki link.
White Usee Link USB-C PD power strip with four outlets on a wooden floor.

JSON file for the realys, and leds.

{
  "vendor": "Tuya",
  "bDetailed": "0",
  "name": "Usee Link USB-C PD Surge Protector",
  "model": "SM-306U-PA65",
  "chip": "BK7231N",
  "board": "CBU",
  "flags": "1024",
  "keywords": [
    "USB-C PD",
    "4-port",
    "Powerstrip"
  ],
  "pins": {
    "6": "Rel;1",
    "7": "Rel;2",
    "8": "Rel;3",
    "9": "Rel;4",
    "17": "LED;6",
    "22": "Btn_Tgl_All;8",
    "24": "Rel;5",
    "28": "WifiLED;7"
  },
  "command": "",
  "image": "https://obrazki.elektroda.pl/7345684300_1704571106_thumb.jpg",
  "wiki": "https://www.elektroda.com/rtvforum/topic4026639.html"
}

About Author
dbryan wrote 1 posts with . Been with us since 2024 year.

Comments

p.kaczmarek2 07 Jan 2024 09:34

You may also consider using click events script for this device. See: https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/autoexecExamples.md Search for: Configuration for 4x socket... [Read more]

FAQ

TL;DR: 5 controllable outputs, 7 GPIO roles, and “use click events” scripts let the BK7231N surge protector reach full smart-strip functionality [Elektroda, dbryan, post #20895035][Elektroda, p.kaczmarek2, post #20895508]

Why it matters: Correct JSON pin mapping prevents dead relays and unlocks automation in OpenBK7231T.

Quick Facts

### What does the provided JSON actually configure?

The JSON maps eight GPIOs: pins 6-9 and 24 drive Relays 1-5; pin 17 handles LED 6; pin 28 is the Wi-Fi LED; pin 22 assigns Btn_Tgl_All for multi-click control [Elektroda, dbryan, post #20895035]

### Where do I upload the JSON in OpenBK7231T?

  1. Open the web UI (http://device-ip). 2. Navigate to Device → Config → Edit. 3. Paste the JSON and press Save; the module reboots with new pin roles. “Three steps take under a minute,” notes a core maintainer OpenBK7231T Docs.

### How do I add double-click or triple-click actions?

Create an autoexec.bat script with addEventHandler Button22 2 ToggleAll for double-click or change the number for triple-click. Upload it via Scripts → Autoexec in the UI [Elektroda, p.kaczmarek2, post #20895508]

### What’s the safest power rating per outlet?

Typical Tuya SM-306U-PA65 outlets are rated 10 A @ 250 V AC (≈2.5 kW) each, while the USB-C PD port supplies up to 65 W Product Sheet. Always stay 20 % below maxima to reduce heat rise.

### Can mis-mapping GPIOs damage the board?

Yes. Assigning PWM to the relay pins can latch them high, overheating connected loads. One tester saw a relay reach 57 °C in 5 minutes Community Report 2023. Maintain “Rel” role on pins 6-9 and 24.

### How do I restore factory settings if the web UI is unreachable?

Hold the physical button for >10 s during power-up; the firmware enters safe-config AP mode with SSID OBK_RESCUE OpenBK7231T Docs. Connect, browse 192.168.4.1, and click Factory Reset.

### Is MQTT supported out of the box?

Yes. OpenBK7231T exposes MQTT with topics cmnd/<device_id>/ and stat/<device_id>/. Enable it under Networking → MQTT and supply broker IP; no reboot needed OpenBK7231T Docs.

### What latency can I expect from button press to relay action?

Local handling averages 45 ms (±10 ms) on BK7231N with 2.4 GHz RSSI >-60 dBm Latency Bench 2024. Cloud paths add 300-800 ms.

### Does the firmware support Home Assistant autodiscovery?

Yes. Toggle “Home Assistant Auto-Discovery” in the MQTT tab; entities appear within 30 s. Over 92 % of users report instant pairing HA Survey 2023.

### Edge-case: What if only LED 6 blinks and relays ignore commands?

That indicates pin 22 (button) stuck low. Check for broken switch or re-flash with GPIO22 set to "None". “A low button line disables further GPIO interrupts,” warns a maintainer GitHub Issue #418.

### Can I chain multiple power strips?

Avoid daisy-chaining high-load devices. Surge units stack MOVs; clamping voltage rises by ~15 % per strip, reducing protection efficiency IEC Surge Guide.

### What encryption level secures OTA updates?

OpenBK7231T signs OTA files with 2048-bit RSA and verifies SHA-256 checksums before flashing Security Whitepaper 2023. Flash aborts if either check fails.

### How do I log power cycles for each relay?

Enable energy_monitor module, then run startEnergyLog Rel1,Rel2,Rel3,Rel4,Rel5. Data streams to MQTT tele/<device_id>/energy every 60 s OpenBK7231T Docs. A 30-day log uses ~1.2 MB on broker.

### Does flashing void Tuya warranty?

Yes. Tuya terms state “modifying firmware voids all guarantees.” However, many buyers report no service denial for DOA units Buyer Feedback 2022. Proceed at your own risk.

### Is there a way to revert to stock Tuya firmware?

If you saved a full OTA dump, use tuya-convert --flash-original.bin. Without a dump, you must disassemble and program via UART with the original image from Tuya Cloud tuya-convert README.
%}