node-red-contrib-dali-sensor 0.4.0
Node-RED node for parsing DALI sensor data and outputting motion and lux
Node-RED dali-sensor Node
Overview
The DALI Sensor node is designed for use with the Lunatone DALI-2 IoT Gateway to easily filter and process DALI-2 sensor signals inside Node-RED.
It allows you to monitor occupancy (motion), lux levels, and lux alarms from connected DALI-2 sensors, with filtering by short address and instance type/number.
This node is ideal when you want to:
- Extract and use specific motion or lux data from the DALI bus.
- Convert raw DALI sensor frames into clean, meaningful outputs.
- Optionally add automatic delayed Off logic for motion detection.
Features
- Short address filtering — Only process messages from the target DALI-2 device.
- Scheme selection — Supports both:
- Device scheme (instance types)
- Device/Instance scheme (instance numbers)
- Instance mapping — Configure which instance is motion and which is lux.
- Lux setpoint — Auto-generate a Lux Alarm output when lux drops below the threshold.
- Boolean or string outputs — Select
"true"/"false"or"On"/"Off"for binary outputs. - Auto-Off option — Motion turns On immediately, then Off after a non-resettable delay.
- Only send on change (new) — Each output is sent only when its value changed, instead of on every sensor frame.
Outputs
The node has three outputs:
| Output Port | Name | Description |
|---|---|---|
| 1 | Motion | Latched occupancy state. Controlled by Auto-Off if enabled. |
| 2 | Lux Value | Raw lux reading (integer). |
| 3 | Lux Alarm | Boolean/On-Off depending on whether lux is below the setpoint. |
Auto-Off Feature
When Auto Off is enabled:
- "On" is emitted immediately on motion detection.
- First "Off" starts a delayed turn-off (non-resettable).
- Further Off frames during countdown are ignored.
- An On during countdown cancels the pending Off.
- Default delay is 30 seconds (configurable).
msg.delay(in ms) on the message that starts the countdown can override the timeout.- Status shows a live countdown.
If Node-RED restarts during a countdown, the node will re-arm the remaining delay and emit Off when it expires.
Only Send on Change
DALI-2 sensors re-report their state every few seconds, and by default every frame re-emits Motion, Lux Value and Lux Alarm even when nothing changed. Wired straight to an NHC2 output, that means a write every few seconds per sensor — enough to hit the Hobby API rate limit and make the controller re-evaluate everything that depends on those flags.
When On Change is enabled:
- Each output is sent only when its payload differs from the last one sent on that output.
- A Motion frame no longer re-sends Lux Value / Lux Alarm (and vice versa).
- The first frame after a deploy or restart is always sent, so downstream devices re-sync.
- Auto-Off still emits its delayed Off (it is a change).
Configuration
| Field | Description |
|---|---|
| Name | Node label in the flow. |
| Short Address | DALI short address of the target device. |
| Motion Instance | Instance number/type for motion (for Device/Instance scheme). |
| Lux Instance | Instance number/type for lux (for Device/Instance scheme). |
| Lux Setpoint | Threshold for triggering Lux Alarm. |
| Use Boolean | Output binary states as "true"/"false" instead of "On"/"Off". |
| On Change | Only send an output when its value changed (default off). |
| Auto Off | Enable automatic delayed Off for motion. |
| Timeout | Delay in seconds before motion turns Off (default 30). |
Example Flow
[
{
"id": "dali-sensor-example",
"type": "dali-sensor",
"name": "Office Motion & Lux",
"shortAddress": "1",
"motionInstance": 0,
"luxInstance": 1,
"luxSetpoint": 400,
"useBoolean": true,
"enableAutoOff": true,
"autoOffDelaySec": 30,
"wires": [
["debug-motion"],
["debug-lux"],
["debug-alarm"]
]
}
]