DSC-BRAIN USER GUIDE · HOW IT WORKS

Zigbee and Tuya — roles, tasks and placement

How a paired device becomes entities: capability class, role, zone and placement, tasks and policy state, climate deltas, and the additive rule for plugs.

  verified for 9.0.0 · firmware train 8.2.0.0

  last verified 2026-09-17 · mirrored 2026-09-15

From join to entity

  1. Zigbee2MQTT on the Pi pairs the device and publishes its datapoints over the internal MQTT bus.
  2. The brain fingerprints it into a capability class (climate, liquid, plug, motion, safety, hazard, meter, other) and offers the matching device types. When the installed DSC-KitLib library has a fingerprint for it, the device is also named as a product (automatch): only a single exact match is applied on its own, it only names the device (it never binds a role or changes control), and a product you confirm or clear always wins.
  3. You give it a role (where and what), a zone (room, 4×8, 2×4, indoors outside the room, outdoors, or a zone you added) and optionally a placement (canopy, intake, exhaust, floor…) and a task.
  4. Every bound datapoint becomes a fleet entity you can chart, inspect, alert on and use in a rule.

Placement is data

Zone → placement → position is stored on the binding. The Twin draws placed sensors as markers, and the climate model derives deltas when both ends exist: canopy-to-exhaust, canopy-to-intake, canopy-to-floor, floor-to-ceiling, exhaust-to-intake, tent-to-room, room-to-outdoors (temperature and RH). Indoors and outdoors zones make room-to-outdoors meaningful. A placed sensor silent past the stale window drops out of the deltas rather than freezing them.

Tasks and policy state

A task turns a reading into an action, and the desks show Problem / Clear only from the task's policy state; the raw Wet / Dry is shown separately. Some leak sensors report wet as occupancy; the brain treats those as liquid, not motion.

Task Acts
Liquid level → appliance OOS Yes: the bound appliance goes out of service with its relay forced off while wet, and comes back once the dry reading has held for 2 minutes
Floor flood → alert Critical banner and a grow-log line only, never OOS
Runoff tray → notify Warning banner and a grow-log line while the tray is wet; the plant's sitting-in-runoff state is tracked whether or not this task is set
Follow photoperiod Switches a lamp plug with the hub's window
Safety cut-off Opt-in, on a smoke, gas or CO alarm: heater and heat mat out of service with relays forced off, lamp plugs switched off and held off. Fans, dehumidifier and humidifier are left alone; hub-dimmed lamps are not cut. By default it stays on until you release it on the Safety cut-off card (Settings › Devices), which can also run a test; set to release after clear, it lets go once every tripping alarm has read clear for 10 minutes
Operator datapoint task No: the device reports, nothing is switched

Zigbee state is retained across brain restarts.

Smoke, gas and CO alarms. A Zigbee or Tuya alarm bound to a hazard role (Smoke alarm · room, · 4×8 or · 2×4, Gas alarm · room, CO alarm · room) raises Smoke detected, Gas detected or Carbon monoxide (critical) the moment it reports, with no hold, and writes a grow-log line. An alarm silent for 26 hours raises Safety alarm silent (warn). Alerts alone switch nothing; the Safety cut-off task is what acts.

Bluetooth LE sensors the Pi hears are listed on the Bluetooth sensors (BLE) card under Settings › Devices, with their latest reading and a KitLib product match. Nothing to pair, and neighbours' sensors can appear. On this release they are listed and identified only; they do not feed climate roles.

Plugs are additive

Zigbee and Tuya plugs add loads (pumps, dosing, aux fans, a lamp). The four climate legs stay on the hub-driven Sonoff relays because those fail safe with the hub. A Tuya plug holds its last state when the brain stops; a Zigbee plug likewise has no hub cut-out behind it.

Tuya specifics

One local connection per device; the brain owns it while bound. Protocol version and local key come from the SmartLife developer flow. A water tester exposes EC, pH and temperature as tank entities.

DSC-Brain user guide · Zigbee and Tuya — roles, tasks and placement · this page is edited on the site; the Notion original was retired after the mirror