Clipsal C-Bus add-on

Does anyone know how to call a cbus scene to turn off/On a group of my lights as this is how i currently do it when using my cbus light switches. The only thing i cannot see the cbus scene showing as an entity or i am not sure how to get home assistant to activate a cbus scene, directly

I am having issues where I have a dashboard switch that turns on and off a group of lights sometimes they do not all turn on and some times they do not all turn off. if i look at the individual control for that light in home assistant it always shows the correct command but cbus does not always seem to get the command.

Hi guys,
Looking for some help in the CBUS space please…

Ive been using HomeAssistant for a while (running on a Synology NAS) but have never connected it in anyway to my CBUS system.

To be honest the CBUS system is something that was in the house when we bought it and Ive never touched it… All I know is that we have lights, blinds (via timed relays rather than bklind controllers I believe) and scenes setup on it. There is no external connectivity that I can plug a serial / usb / LAN into.

Im upto speed on TCP/IP networking and the HA side of things, but what hardware and possibly software) do I need to be able tio get the cbus2mqtt addon taking to CBUS?

Any help or pointers would be greatly appreciated.

Thanks
Jon

Do you have a wiser by any chance?

No Wiser Im afraid. Just C-Bus running independantly of anything with no current means of connecting to it and a HomeAssistant instance running on my local LAN (which Id like to interface with the C-Bus via MQTT).

We have owned the house for about 8 - 10 years… The previous owner had the C-Bus installed a year or two before that when they did their reno’s.

Thx
Jon

I used to use Cgateweb which works by running C-gate on a linux machine (raspberry pi or similar single board computer will do) and having it publish C-bus events to MQTT. You will need either a C-bus RS232 CNI or a network CNI for this to work.

It hasn’t been updated for a few years so you may need to run an older version of linux to get it to work.

A more recent update is a docker container that @samsonsite reffered to earlier in this thread

Easier option is to buy and install C-bus SHAC (no sparky required), but they are not cheap.

Thanks. I have a Synoogy NAS running 24x7 and so ca install Docker to run the above container.

I just looked on the Clipsal site and the 5500SHAC is apparently discontinued (??). Perhaps the next dumb quesiton of the day… Is the network interface connector (to connect to my LAN over Ethernet), the 5500CN2?

Doing a quick read of the docker container readme link above, the 5500CN / CN2 needs to have an IP address before it can be used… Would it be naive of me to think the 5500CN will grab an IP address automatically via DHCP or do I need to use the CBus Toolkit to manually allocate it an IP address?

Also, once the 5500CN is installed and Docker container running, what sort of functionality can I expect in Homeassistant? I assume its a 2-way comms thing, ie press a physical light switch button and the Homeasistant entitiy updates (via MQTT) and visa-versa, toggle a Homeassistant switch and MQTT sends the command via the container to the CBus?

Apologies for the basic questions! Ive been putting this journey off for years and now’s the time to dive in!

Thanks
Jon

Forgot they discontinued the SHAC. It’s been replaced with a new model - Clipsal C-Bus Spacelogic Application controller… Who in marketing thought that was a good idea for a name?
https://www.clipsal.com/products/detail?CatNo=5500AC2&itemno=5500AC2&tab-document-1=0
Basically it’s a single board computer with built in C-Bus control and LUA scripting language.
The LUA script has MQTT built-in so Home assistant to talk to C-Bus only requires a couple of basic scripts. One has been done by ssaunders that even works with Home Assistant discovery.

As for the docker container, its been years since I used it so going off rough memory here. The 5500CN will need a static IP address - that can be done in your router (bind IP to MAC) or I think using the Lantronix Device Installer. Clipsal application note for using the device installer below.
https://updates.clipsal.com/ClipsalSoftwareDownload/mainsite/cis/technical/AN06-044-2.pdf
Once you have the docker container working and C-Bus is publishing topics to MQTT, you will need to add each light to your Home Assistant MQTT yaml file.

light:
  #############################     C-Bus Lights     ############################
  - name: Front Exterior
    command_topic: "cbus/write/254/56/0/switch"
    state_topic: "cbus/read/254/56/0/state"
    payload_on: "ON"
    payload_off: "OFF"

Hope that helps gets you started Jon.

This is aawesome. Many thanks.

Despite the terrible name, I do like the sound of the Spacelogic unit… It is pricey but Im thinking so is the standard 5500CN and the cost difference between the two maybe isnt so bad.

Time to do some price checking on the hardware before I go too much further.

Thanks again,
Jon

I run using a SHAC unit. It works well. One warning is that Clipsal are not good at support and updates and tend to just discontinue a product , ‘disown it’ at almost nil notice and launch a newer version. I have been caught so many times on this. The SHAC is an OEM product.

One advantage of the SHAC / later approach is you can code it to support nearly all the C-Bus applications not just lighting. I use it for HVAC and the measurement app.

Thanks for the helpful Scripts. awsome work!. i got it running for lights and with cards, it works well for on/off devices like lights… For Blinds, is there a simple method to add an up:stop:down button? i can control via MQTT messages, just not sure on best practice to add these messages to a button.

Kind Regards

Just FYI -

I have made a major refactor on the cgateweb implemention, and published the solution as 3 containers to isloate the parts.

Specifically for the C-Bus to MQTT setup, this now uses the C-Bus project file, to ensure discover of Dimmer, Relay and Phantom groups, and I also enabled Trigger Application with MQTT Events entity!

some Features

  • Build containers for all the parts
  • Refector the C-Gate to MQTT bridge
    • Supports the C-Bus project file
    • Discovers all Lighting Groups and Publishes for MQTT Discovery
    • Only Defined Groups Published
    • Home Assistant configuration automatically for
      • Group Names from Project
      • EntityID locked to network ID
      • Relays, Dimmers and Phantoms Auto-Detected and Configured
      • Extended Attributes for Outputs -
        • Unit Type, Index, Model, and Channel number
    • Trigger Application
      • Published as new Home Assistant MQTT Event
      • Trigger names and groups published

Bug fixes, etc.

Only defined groups are discovered, and configured correctly as Switch, Dimmer or Phantoms

Trigger application discovered and handled as MQTT Events
image

Real mapping attributes from the project file:

1 Like

Jaysus Damian, you were busy.
This is very timely because cbus2mqtt broke for me in July after a HA update.
Your version sounds good. I think I’ll adopt it as my new Cbus/HA solution.
I’m a bit dumb though. (Not much changed from the CQC/Elve days. LOL).
Where do you have Cgate installed?
I only fire up cgate when I need to get to toolkit or PICED on a windows PC. My HAOS is running on a dedicated Intel NUC - I could install cgate there too I suppose.

All the best, good to see you again here! Enda in Barcelona

Oh my gosh. It’s been far too long Enda. How have you been keeping.

I was in France last week and just catching up now - sorry about the delay.

So I have an old PI3 stuck beside the C-Bus CNi 5500 in the panel (the PI is housed in a 15€ DIN rail enclosure to keep it safe and look pro!

The pi has nothing installed. Just Raspbian OS; updated and the current version of Docker. That’s it!

Then I connected a USB to serial from the PI to the C-Bus CNI to get them connected.

Finally I grabbed the docker-compose.yaml file that’s in the readme of the repo which lists the 3 containers. Put the cbus project file in the corrrct folder and run

docker compose up

The logs will start with the serial2tcp first making the connection to the CNI.

Then the second container will load which is cgate. It will read its configuration and open the cbus toolkit xml file from the folder. Open the network and start the cgate connection. (Hint here. In the xml file we May need a quick edit to make sure the project is using a network connection and the IP Should be that which is assigned to the PI).

Finally - if Cgate loads the cgate2mqtt container will start, connect to both mqtt and the cgate server and then just smile

I’m home assistant we should see under mqtt the cbus environment and all your triggers and lights.

As for toolkit. When I need it I open it on my laptop, and connect it to the ip of the pi on port 10001 which is the same port the ser2tcp setup earlier. Makes the whole thing super clean to manage.

Cheers for :ireland: Ireland.

Hi all, I moved into a house with C-Bus in March and used @Samsonsite’s add-on to get HA talking to C-Bus. It was nice and easy but I have a problem where it works 99% of the time but also lights randomly don’t react some times. As that isn’t an active project I wanted to migrate to something that will get my lights reacting 100% of the time.

There seem to be multiple projects and ways to solve this so before I go down a rabbit whole I was hoping someone could advise which project is best for the Spacelogic 5500AC2 controller. I’m only using lights and exhaust fans. I’m running HA in a VM with all my other stuff in docker :slight_smile:

Cheers & thanks :slight_smile:

1 Like

You can implement MQTT through the SpaceLogic controller. I have done that but can’t vouch on the stability as that’s not something I use 24/7 mainstream. It’s still running after many months, certainly better than the 99% you’re quoting. The 99% could be a C-Bus wiring anomaly or more likely a dropped command if you’re overflowing the buffer. Does the ‘missed’ command make it correctly onto C-Bus?

SpaceLogic can support lighting as well as all the other C-Bus apps so it’s a flexible prospect and should work well I believe. I use this for the C-Bus measurement app for my voltage and temperature sensors and also for climate/heating.

I use a no longer available C-Bus to Ethernet device for C-Bus lighting and triggers which has worked flawlessly for 15 years.

1 Like

+1 for the MQTT method. I haven’t used the add-on as I had MQTT already setup in my Spacelogic but I can confirm in my install it’s been 100% stable. Never had any lights or switches not respond on the C-Bus side or the HA side.

1 Like

Thanks @xAPPO & @atomic10, my next question is which guide / post will direct me on how to setup MQTT in Spacelogic and integrate it into HA?

Is this the best solution or should I be looking elsewhere?

The one I used was from Nick Adams as I had no need for the extra functions in autoSteves - philips hue, pansonic ac, airtopia, etc.

Then I added a couple of lines to capture measurement application events and trigger events.

1 Like

Hi @Samsonsite

This looks perfect for my needs/ abilities. I purchased a home assistant green to give it a go. When I try to add your github link to repositories

it comes up with:

Cmd(‘git’) failed due to: exit code(128) cmdline: git clone -v --recursive --depth=1 --shallow-submodules – https://github.com/MtSamsonnite/ha-cbus2mqtt /data/addons/git/bca28fb7 stderr: 'Cloning into ‘/data/addons/git/bca28fb7’… fatal: could not read Username for ‘https://github.com’: No such device or address ’

No idea how to get around this or what the problem is, any chance of help

Thanks

Edit

A solution was very kindly provided over at git hub:

won’t let me add link

here it is