Skip to content

Dali2 input device events - #25029

Open
murfett-au wants to merge 2 commits into
arendst:developmentfrom
murfett-au:dali2-input-device-events
Open

murfett-au wants to merge 2 commits into
arendst:developmentfrom
murfett-au:dali2-input-device-events

Conversation

@murfett-au

Copy link
Copy Markdown

Description:

Related issue (if applicable): n/a

Second of three DALI-2 input device changes. Depends on #1 (event message decoding); review only the last commit until that merges.

DALI-2 control devices (IEC 62386-103) such as push buttons, occupancy and light sensors use 24-bit frames and have their own short address space, separate from control gear. Until now they could only be commissioned with raw DaliSend255 frames.

New commands

  • DaliDeviceScan 1|2[,<max_count>] assigns short addresses with the 24-bit INITIALISE / RANDOMISE / COMPARE / PROGRAM SHORT ADDRESS sequence. Mode 1 clears all control device short addresses first. Mode 2 probes the bus and only addresses devices without one, so existing addresses are never reused. Returns the number assigned, like DaliScan.
  • DaliDevice lists control devices that answer on short addresses 1..64, in the same form as DaliGear.
  • DaliDevice <device> reports version, status and each instance's type, enabled flag and event scheme.
  • DaliDevice <device>,<scheme> sets the event scheme on all instances of a device (0 = broadcast). Input devices default to the Instance scheme, which carries no short address, so scheme 2 (DeviceInstance) is what makes commissioning useful: every event then identifies the device that sent it.

Implementation notes

  • The binary search shared with DaliScan gained a device flag defaulting to false, so control gear commissioning is unchanged.
  • IEC 62386-103 constants are kept in the driver to leave the TasmotaDali library untouched.
  • Control gear and control device short addresses are independent name spaces, so the two scans are deliberately separate commands.

Tested with: zencontrol zc-switch rotary (3 push button instances) on an ESP32-S3-Pico with the Waveshare Pico-DALI2. Sequence: Backlog DaliDeviceScan 1; DaliDevice; DaliDevice 1; DaliDevice 1,2, then confirmed rotation events arrive with "Scheme":"DeviceInstance" and an Address field.

Documentation for the Commands section of docs/DALI.md will follow in tasmota/docs.

Checklist:

  • The pull request is done against the latest development branch
  • Only relevant files were touched
  • Only one feature/fix was added per PR and the code change compiles without warnings
  • The code change is tested and works with Tasmota core ESP8266 V.2.7.8
  • The code change is tested and works with Tasmota core ESP32 V.3.3.8 from Platform 2026.05.50
  • I accept the CLA.

NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass

murfett-au and others added 2 commits September 13, 2026 13:05
Input devices such as push buttons (IEC 62386-301), occupancy sensors
(303) and light sensors (304) communicate with 24-bit event messages.
Tasmota logged these frames at log level 4 and discarded them, so it
could not react to any DALI-2 switch or sensor on the bus.

Decode the 24-bit frame according to the five IEC 62386-103 addressing
schemes and publish the result for rules and MQTT, for example

  {"DALI":{"Event":"0x82840B","Scheme":"Instance","Type":1,"Instance":1,
           "Info":11,"Name":"LongPressRepeat"}}

Push button events carry the part 301 event name, occupancy events the
Movement/Occupied/Repeat/Sensor flags and light sensor events the
Illuminance value. 24-bit frames with bit 16 set are commands from
another application controller and are ignored.

Tested with a zencontrol zc-switch rotary on an ESP32-S3-Pico with the
Waveshare Pico-DALI2, driving one channel of a DA4-T DT6 driver via
rules.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Control devices (IEC 62386-103) such as push buttons and sensors are
addressed with 24-bit frames and have their own short address space,
separate from control gear. Until now they could only be commissioned
by hand with raw DaliSend255 frames.

Add DaliDeviceScan 1|2[,<max_count>] which assigns short addresses using
the 24-bit INITIALISE / RANDOMISE / COMPARE / PROGRAM SHORT ADDRESS
sequence. The existing binary search used by DaliScan is shared through
a device flag so control gear commissioning is unchanged. Mode 2 probes
the bus first so addresses already in use are never reassigned.

Add DaliDevice which lists addressed control devices, reports one
device's version, status and instances (type, enabled, event scheme),
and sets the event scheme of all its instances, for example

  {"DaliDevice":{"Device":1,"Version":"2.0","Status":0,"Instances":[
    {"Instance":0,"Type":1,"Name":"PushButton","Enabled":1,"Scheme":"Instance"}]}}

Input devices default to the Instance event scheme which carries no
short address, so DaliDevice <device>,2 switches them to DeviceInstance
events that identify the sending device.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant