DSC-BRAIN USER GUIDE · SETUP
Tuya / SmartLife Wi-Fi devices (local)
Bind a SmartLife plug or water tester by its local key; the one-controller rule; the lamp-plug backstop.
● verified for 9.0.0 · corrected for 9.8.0 on 2026-09-30
● first mirrored 2026-09-15
On this page
DSC-Brain drives SmartLife (Tuya) Wi-Fi devices directly on your LAN on TCP port 6668. Once a device's local key is on the Pi the Tuya cloud is never used, and you can block the device's internet at the router. A plug switches mains power: check its rating covers the appliance, and follow your local rules for mains wiring. Before you start: the device is already set up in the SmartLife app, is on the same LAN as the Pi, and you know the fixed IP address it will keep (reserve one in your router). Check that your plug or tester is one DSC recognises in the supported devices finder first.
What Tuya devices are good for
| Use it for | Do not use it for |
|---|---|
Pumps, dosing, auxiliary fans (plug_* roles); the reservoir water tester; a mains-powered smoke, gas or CO alarm (battery Wi-Fi smoke alarms sleep between events, so the brain rarely reaches them; a Zigbee alarm is the reliable choice); a lamp plug with the backstop below |
Heater, humidifier, dehumidifier, heat mat. Those stay on the four Sonoff plugs. Each starts OFF at power-on and switches itself OFF when it has not heard from the brain for its grace time (heater 60 s, heat mat and humidifier 90 s, dehumidifier 240 s). A Tuya plug keeps its last state if the brain stops. |
If you have a Tuya Zigbee device (paired through a Tuya hub), pair it to the Pi's Zigbee coordinator instead. No keys, no cloud.
One local controller per device
A Tuya device accepts exactly one local connection. If another local Tuya app or hub holds it, the brain cannot, and the failure looks like a dead device: Err 901 Unable to Connect (protocol 3.1–3.3) or Err 914 Check device key or version (3.4–3.5) while a plain TCP connection to port 6668 succeeds. Do not rotate keys or re-pair — that changes the local key and wipes the device's schedules, and does not fix a conflict. Disable the device in the other app (disable it rather than remove it), then probe again from the card. The SmartLife phone app is the exception: it falls back to the cloud while something else holds the socket.
Binding a device
- Settings › Devices › Zigbee, Tuya / SmartLife (Wi-Fi, local) card › Add devices (import keys). There are two ways to get the keys. Smart Life sign-in: type your account User Code, scan one QR code in the Smart Life app and tick your devices. No Tuya developer account and no PC are needed, but the Pi needs internet for this step. tinytuya wizard: paste the
devices.jsonit writes and press Import. That route needs a free Tuya developer account (iot.tuya.com) with a cloud project, and it works with the Pi offline. - Step 2 (if Probe gets no answer, read One local controller per device above), for each device: enter its fixed IP and Version, press Probe (it should answer with raw datapoints and a suggested type), pick the Type (Smart plug, Relay / switch, Water quality tester, Smoke alarm, Gas alarm, Carbon monoxide alarm) and Save. Alarms differ between makers: probe first and fix the DPS map under Edit if the alarm datapoint sits elsewhere.
- In the device table give it a role and zone like a Zigbee device and an optional task, then Save roles & tasks. When DSC-KitLib knows the device's product, the row also shows it (naming only; it never binds a role).
Lamp plugs
A lamp that is not on a hub output (the plug-switched lamp in the 4×8, which holds two lamps: one dimmed by the hub, one on a plug) can be run from a plug bound as Lamp plug · 4×8 (or · 2×4). The brain then follows the hub's own photoperiod window, so the tent keeps the hub's clock rather than the plug vendor's schedule.
- On/off only. No sunrise or sunset ramp. The hub still ramps the lamp it dims itself.
- Leave an off-only schedule on the plug, a few minutes after your lights-off time. A brain outage between lights-on and lights-off would otherwise strand the lamp ON through the dark period. Never leave an on schedule on the plug — that is the only way the two can fight.
Water tester
A bound tester feeds the Tank card (EC, pH, water temperature) on Kit and Root, and the tank alerts (EC or pH out of range, water too warm). Set the EC unit multiplier and biases on Kit › Calibrate › Tank EC / pH bias.
Next: optional: Cameras, adding a camera.
Guide contents · Setup · Troubleshooting · Digital Stealth Care
DSC-Brain user guide · Tuya / SmartLife Wi-Fi devices (local) · this page is edited on the site; the Notion original was retired after the mirror
