Skip to main content
Version: 1.0

DALI

The DALI component provides methods to scan and ping control gears. It uses DALI as RPC namespace and provides the methods:

All control gears are controlled through light:0 component.

Methods:

DALI.SetConfig

DALI component does not provide configuration

DALI.GetConfig

DALI component does not provide configuration

DALI.GetStatus

DALI.GetStatus does not expect any arguments

Find more about the status response properties in status section

DALI.StartScan

This method starts scanning the DALI bus for control gears.

DALI.StartScan does not expect any arguments

Response

The result from this method is null when scan is started succesfully.

If invoked while scanning is already in progress, an error is returned:

{
"code": -114,
"message": "scan is already in progress"
}

If invoked and internal dali bus driver can not be loaded, an error is returned:

{
"code": -114,
"message": "driver error"
}

DALI.PingKnownDevices

This method pings all scanned control gears. If some control gears can not be accessed, error control_gear_missing is raised in component status.

DALI.PingKnownDevices does not expect any arguments

Response

The result from this method is null when pinging is started succesfully.

If invoked while scanning is already in progress, an error is returned:

{
"code": -114,
"message": "scan is already in progress"
}

If invoked and internal dali bus driver can not be loaded, an error is returned:

{
"code": -114,
"message": "driver error"
}

If invoked and bus has hever been scanned, an error is returned:

{
"code": -114,
"message": "bus not scanned"
}

If invoked and there are no control gears found during scan, an error is returned:

{
"code": -114,
"message": "there is no devices on bus"
}

Configuration

DALI component does not provide configuration

Status

The status of the DALI component contains information about number of scanned control gears on DALI bus and scanning process information.

Properties:

PropertyTypeDescription

cg_count

number or null

Number of scanned control gears (null if scan has never been executed)

scan

object

Information about the scan process, only present when scan is running

PropertyTypeDescription

cg_count

number

Number of found control gears during scan

started_at

number

Unix timestamp, start time of the scan process (in UTC)

errors

array of type string

Shown only if at least one error is present. May contain control_gear_missing, driver

info

* control_gear_missing is an error indicating that some ot the scanned control gears can not be accessed.

* driver is an error indicating internal DALI driver error.

Notifications

This section describes notifications for events specific to the DALI component. For general information please see this page.

DALI component can send notifications for the following events:

  • scan_complete
  • ping_complete

Examples

DALI.GetConfig example

note

DALI component does not provide configuration

DALI.SetConfig example

note

DALI component does not provide configuration

DALI.GetStatus example

http://192.168.33.1/rpc/DALI.GetStatus

Response

{
"cg_count": 0
}

DALI.StartScan example

http://192.168.33.1/rpc/DALI.StartScan

Response

null

DALI.PingKnownDevices example

http://192.168.33.1/rpc/DALI.PingKnownDevices

Response

null

Notifications example

  • Scan complete:

Example 1:

Notification that the DALI bus scan process has finished.
{
"src": "shellyddimmer-c8f09e8a2bbc",
"dst": "user_1",
"method": "NotifyEvent",
"params": {
"ts": 1631266595.43,
"events": [
{
"component": "dali",
"event": "scan_complete",
"cg_count": 2,
"ts": 1631266595.43
}
]
}
}
  • Ping scanned control gears complete:

Example 2:

Notification that the DALI bus ping control gears has finished.
{
"src": "shellyddimmer-c8f09e8a2bbc",
"dst": "user_1",
"method": "NotifyEvent",
"params": {
"ts": 1631266595.43,
"events": [
{
"component": "dali",
"event": "ping_complete",
"ts": 1631266595.43
}
]
}
}