C-Bus into HA - Beginners Guide (for space logic controllers)

autoSteve has an amazing project on Github that pulls in all your C-Bus items into Home Assistant, with auto discovery and comprehensive documentation.

The problem I found as a newb to HA & C-Bus, the documentation scared me off so I thought I would help other newbs with a simple version for first time users with a more limited scope. The idea of this guide is for people who may not be familiar with C-Bus to get their first set of lights into Home Assistant. Once that is done, you should have a basic understand and the rest of the autoSteve’s documentation can take you further. This guide only uses two scripts and 1 add-on and can be up and running in 15mins :slight_smile:

What do you need?

  • C-Bus controller that supports LUA (SHAC/NAC/AC2/NAC2). These are generally the network controllers, if you have an older controller that needs a serial cable (or the Wiser), this is not the guide for you.
  • HAOS not HA Core

If you don’t have a controller I purchased the 5500AC2 which works excellently and this is what I used for the guide, it is pricey but also the most reliable solution from my research.

Prepare Home Assistant
Create your MQTT user

  • Settings → People → Users (tab at the top)
    • Add User
      • Username: matt
      • Password: (what ever you want, just remember it you will need it later)
      • Display Name: what ever you want
      • Local network only: Yes
      • Admin: No

Install Mosquitto

  • Settings → Add-ons → Add-on store
  • Find Mosquito Broker and install

Setup C-Bus Controller
First open the project in another tab - GitHub - autoSteve/acMqtt: CBus Automation Controller: Home Assistant, MQTT, Philips Hue and more (for the SHAC/NAC/AC2/NAC2)

Log into your controller and we will install some scripts
First up is the Resident Script

  • Scripting → Resident → Add new script
    • Script Name: MQTT send receive
    • Sleep: 0
    • Active: Yes
    • Category: blank
    • Description: What ever you want
  • Click the Editor icon against the script
    • On the project on Github click into the MQTT send receive script, copy it and paste it into the script on your controller
    • Edit the first few lines under change to suit environment
      • IP is the IP of your HASS instance
      • Username and password is what we used before for the user we setup
      • The other items you should be able to leave if your setup is standard
    • Save & close
      Now the event script
  • Scripting → Event-based → Add new script
  • Check your firmware version and take note of the version number - bottom left, it will look like “Version: 1.xx.x”
  • If you are on v1.15 or above go into MQTT final, otherwise MQTT
    • Copy and paste like last time, no changes needed

Setup your object(s)
All your lights will be auto discovered in HA once setup

  • Navigate to Objects and you should see all your lights
  • Click on the name of the first device you want to setup
  • Under Keywords enter
    MQTT, light, pn=, img=mdi:lightbulb,
    For example
    MQTT, light, pn=Bathroom Lights, img=mdi:lightbulb,
  • Hit Save

Head over to Home Assistant

  • Settings → Devices → MQTT → x Devices
  • You should now see your light in here as your named it. If you don’t reload MQTT

Now setup all your objects :slight_smile: the format is pretty simple
MQTT - Tells the script to include this object, so anything you don’t want in HA just don’t update
light - what sort of object it will appear in HA as
pn - name
img - the icon HA will use, you can ignore this or change it in HA

Now that you are done, head over here and donate to autoSteve to say thanks

There is also a lot more you can do with these scripts, including non-light devices, google integration and hue support. Check out Steve’s documentation for that.