C-Bus
C-Bus is Clipsal’s proprietary home and building automation bus, used to control lighting, HVAC, security and similar building services over a low-speed serial network of C-Bus units (relays, dimmers, sensors, panels). A network is reached through a PC Interface (PCI) unit, which the driver talks to over TCP.
The Go driver is functional: it reads status, issues SAL commands, monitors SAL and MMI traffic, and browses installed units. The Java driver only opens a connection; it has no tag handler and implements none of the four operations below.
Supported Operations
| Name | Value | Description |
|---|---|---|
|
Reads a unit’s status via a |
|
|
Sends a SAL command via a |
|
|
Monitors SAL or MMI traffic via a |
|
|
Discovers installed units and their attributes via an |
Connection String
C-Bus has the following connection string format:
c-bus:{transport}://{ip-address}:{port}?{options}
The only supported transport is tcp, and it connects to the PCI’s default port 10001
when no port is given:
c-bus:tcp://192.168.42.11
Connection String Options
Name |
Type |
Default Value |
Required |
Description |
Name |
Clipsal C-Bus |
|||
Code |
|
|||
Maven Dependency |
<dependency> <groupId>org.apache.plc4x</groupId> <artifactId>plc4j-driver-c-bus</artifactId> <version>1.0.0</version> </dependency> |
|||
Default Transport |
|
|||
Supported Transports |
|
|||
Config options: |
||||
|
BOOLEAN |
false |
Source check. |
|
Transport config options: |
||||
tcp |
||||
|
INT |
5000 |
Connection timeout in milliseconds. |
|
|
INT |
0 |
Socket read timeout in milliseconds. 0 means no timeout. |
|
|
INT |
0 |
Socket write timeout in milliseconds. 0 means no timeout. |
|
|
BOOLEAN |
true |
Enable TCP_NODELAY (disable Nagle’s algorithm). |
|
|
BOOLEAN |
false |
Enable SO_KEEPALIVE. |
|
|
INT |
81920 |
Send buffer size in bytes. 0 uses system default. |
|
|
INT |
81920 |
Receive buffer size in bytes. 0 uses system default. |
|
|
STRING |
Local address to bind to (optional). If not set, uses default. |
||
|
INT |
0 |
Local port to bind to (optional). 0 uses ephemeral port. |
|
Tag Addresses
Addressing is implemented in Go only. The Java driver connects but implements no operations and has no tag handler. See the protocol support matrix for what each implementation does.
General Format
A tag address is one of five prefixed forms. Each may carry an optional bridge chain
(b<address>[-b<address>]{0,5}, up to 6 bridges) to route the command across bridged
networks.
status/-
status/[<bridges>/]binary|level=0xNN/<application>- reads the binary or level status of an application’s group addresses. cal/-
cal/[<bridges>-]<unit>/recall=[<param>, <count>]|identify=<attr>|getStatus=<param>, <count>-
device/network management ("CAL") commands addressed to a unit. Only
recall=,identify=andgetStatus=are implemented; see below.
-
sal/-
sal/[<bridges>/]<application>/<salCommand>- sends a SAL command to an application. salmonitor/-
salmonitor/<unit>|/<application>|- a subscription tag that monitors SAL traffic for a unit and/or application, or*for either. mmimonitor/-
mmimonitor/<unit>|/<application>|- a subscription tag that monitors MMI traffic, with the same unit/application/*shape assalmonitor/.
The parser also accepts cal/ forms it does not implement: reset, write=[<param>,
0xNN], identifyReply=<attr>, reply=<param>, status=<app> and
statusExtended=<app> all parse without error but are marked TODO: implement me in the
driver and return Not implemented when used.
Applications for sal/ and status/ come from the driver’s application table; most are
implemented (LIGHTING, TEMPERATURE_BROADCAST, VENTILATION, IRRIGATION_CONTROL,
POOLS_SPAS_PONDS_FOUNTAINS_CONTROL, HEATING, AIR_CONDITIONING, TRIGGER_CONTROL,
ENABLE_CONTROL, AUDIO_AND_VIDEO, SECURITY, METERING, ACCESS_CONTROL,
CLOCK_AND_TIMEKEEPING, TELEPHONY_STATUS_AND_CONTROL, MEASUREMENT,
MEDIA_TRANSPORT_CONTROL, ERROR_REPORTING, HVAC_ACTUATOR), but RESERVED,
FREE_USAGE, ROOM_CONTROL_SYSTEM and TESTING are accepted by the address parser and
likewise not yet implemented.
Browsing
info/ is not a tag address - it is a browse query, parsed separately by ParseQuery
rather than ParseTag, and used only with the browse operation:
info/-
info/<unit>|/<identifyAttribute>|- lists installed units, optionally filtered to one unit and/or one identify attribute.
Data Types
C-Bus tags are commands and status requests, not typed memory addresses, so no
:{data-type} suffix is used or accepted. Values are decoded from the C-Bus response as a
Struct (or NULL for status/); there is no data type to select on the address itself.
Examples
| Address | Meaning |
|---|---|
|
binary status of all LIGHTING group addresses |
|
the same, routed across one bridge |
|
the same, routed across six bridges |
|
get status of parameter |
|
the same |
|
recall 4 values of parameter |
|
send the |
|
the same, routed across one bridge |
|
monitor SAL traffic for unit |
|
monitor all SAL traffic |
|
monitor MMI traffic for unit |
|
monitor all MMI traffic |
|
browse query for unit |
|
browse query for every installed unit and every attribute |
Notes and Tips
Array notation does not apply to C-Bus addresses: the brackets in a cal/ command such as
recall=[0x20, 4] hold that command’s own parameters (a parameter number and a count), not
a selection appended to an address. A command that reads several values still reports that
through the tag’s array info, exactly like any other list - there is simply no separate
selection syntax layered on top.