Talks to Clipsal C-Bus using Python 3.7+.
Copyright 2012-2020 Michael Farrell. Licensed under the GNU LGPL3+. For more
details see COPYING
and COPYING.LESSER
.
Note: This software is not certified or endorsed by Clipsal or Schneider Electric. Clipsal claim that use of C-Bus with non-Clipsal hardware or software may void your warranty.
More information about the project is available on
the libcbus ReadTheDocs site, and in the docs
directory of the source
repository.
This is a reimplementation of the PCI serial protocol from scratch. This is done using a combination Clipsal's Open C-Bus documentation and reverse engineering (to fill in the gaps).
Unlike some contemporary alternatives, it does not use the libcbm
library/DLL from Clipsal, or C-Gate, which have serious problems:
The libcbm
module is written in C, and does not support x86_64
or
comparatively-modern ARM architectures (such as that used in the Raspberry
Pi).
libcbm
was previously only available as a static library for x86_32
Linux
and Windows systems. Source is available under the Boost
license, but this was last updated in 2009.
C-Gate requires an OS and architecture specific closed source serial library (SerialIO), the Java runtime, and itself has various licensing restrictions.
Because this is a pure-Python implementation, it should run on any Python
supported platform. It has been primarily developed on Linux on armhf
,
x86_32
and x86_64
and macOS on x86_64
.
At a high level, this project includes cmqttd
, a daemon to bridge a C-Bus PCI
to an MQTT Broker. cmqttd
supports Home Assistant's
MQTT Light model and MQTT topic auto-discovery.
Integration with Hass.io is still a work in progress.
This should work with the following C-Bus PC Interfaces (PCIs):
On Linux, this requires v2.6.25 or later kernel, with the cp210x
module.
5500CN Ethernet PCI (and likely also 5500CN2)
This software does not support configuring the Ethernet PCI for the first time. It must already have an IP address on your network.
This project has recently completed a migration to Python 3.7.
Most things should work, but I'm still going through updating all the documentation properly.
There are many backward-incompatible changes:
This only supports Python 3.7 and later.
Python 2.x support has been entirely removed, as Python 2 has been sunset as of 2020.
Python 3.6 and earlier support is not a goal. We want to use new language features!
D-Bus is no longer used by this project:
cmqttd
(C-Bus to MQTT bridge) replaces cdbusd
(C-Bus to D-Bus bridge).
dbuspcid
(virtual PCI to D-Bus bridge) has been removed. It has no replacement.
sage
(libcbus' web interface) and staged
(scene management system) have been removed.
cmqttd
supports Home Assistant's MQTT Discovery schema.
This allows libcbus
to reduce its scope significantly -- Home Assistant can interface with much
more hardware than C-Bus, and has a large community around it.
This no longer uses Twisted -- asyncio
(in the standard library) is used instead.
Many APIs have changed due to refactoring, and is subject to further change without notice. The
most stable API is via MQTT (cmqttd
).