Dear community,
dear developers,
I’d really like to see support for real CAN bus devices like USB-to-CAN dongles.
Why CAN bus?
CAN bus has become very popular not only in vehicles. Also industry plants and machines communicate via CAN bus.
The following points make it really interesting for “private” use and also for domotic / home automation applications:
- well known, lots of documentation
- easy to understand/use
- cheap
- robust
- broadly available
- flexible
From home automation view, the bus is easy to install and there is no need for WiFi stuff, which in turn improves security and peace of mind. It will still work even of the WiFi router crashes and the user can always physically access the bus to see whats going.
“Big players” in that field (like Ixxat or PEAK) provide drivers and APIs. Linux brings the popular package of drivers “socketcan”. There is also a python library called “python-can”, which could be useful for a potential integration.
When thinking about “conventional” CAN (not CANopen), we could work with a similar approach as with MQTT:
while we have “topics” in MQTT, we could use “identifiers” with CAN bus to filter messages to where they belong.
The MQTT “payload” is the “data field” in the CAN frame.
In fact I already have a system running, consisting of 8 window covers (including position), light swithes (including feedback), servaral IOs and sensors completely based on CAN bus. But to integrate this into my HA, I had to additionally create a CAN-to-MQTT gateway (based on a ESP8266), which translates the MQTT topic into a CAN ID and the MQTT payload into the CAN bus data field - and vice-versa!
This works.
But obviously it is a little bit odd to take this indirect route through the WiFi network - a USB-to-CAN dongle is about 100 bucks (big-brand) or much less like 30-50 bucks (see devices like this HERE), with native Linux support - which in return gives you a true industry standard bus with all advantages mentioned above.
I personally am familiar with CAN bus, but not with Linux programming and with HA development. I am very willing to help, if I “can” .
What do you think?
Greetings,
Joachim