CBUS to MQTT using cmqttd Home Assistant add-on developed by Samsonite

Discussion in 'Third-Party Solutions' started by Adrian2073, Jan 14, 2025.

  1. Adrian2073

    Adrian2073

    Joined:
    Jan 14, 2025
    Messages:
    1
    Likes Received:
    0
    Location:
    Sydney Australia
    Hi all,

    I have recently installed CBUS to MQTT using cmqttd now available as a Home Assistant add-on developed by Samsonite
    See Here: https://github.com/MtSamsonite/ha-cbus2mqtt

    I have installed the cmqttd add-on & Mosquito Mqtt connected via a PCI (5500PC) serial to USB cable into the pc hosting HAOS. All my cbus lights have been discovered and they turn on and off on the HA web interface (dashboard) i.e. you switch a light entity on the the bulb turns yellow and the boolean says “ON” and conversely the opposite when I turn it off, but the lights in the house don’t physically change state, nor is their actual status showing on the dashboard. I have confirmed that my serial to USB cable is ok as I can turn lights on and off using the cbus toolkit directly.

    See video here:
    https://youtube.com/shorts/njzHSc_QndA?feature=share

    I’m at a loss as to what to do next, does anyone have any suggestions?

    Log File from cmqttd:
    Importing the add-on configuration options as script variables

    Completed importing addon configuration options

    The following variable values were passed through via the Home Assistant add on configuration options

    MQTT_USER = mqtt-user

    MQTT_PASSWORD = NOT DISPLAYED IN LOG FILE

    MQTT_SERVER = core-mosquitto

    TCP_OR_SERIAL = Use a serial connection to CBUS

    CBUS_CONNECTION = /dev/ttyS0

    MQTT_USE_TLS = null

    MQTT_PORT = null

    CMQTTD_CA_CERT_PATH = null

    CMQTTD_CLIENT_CERT_PATH = null

    CMQTTD_CLIENT_KEY_PATH = null

    CMQTTD_PROJECT_FILE = /share/HOME24-Mar-2012.cbz

    CBUS_TIMESYNC = null

    CBUS_CLOCK = null

    CMQTTD_LOG_LEVEL = null

    Creating file /etc/cmqttd/auth

    Using serial PCI at /dev/ttyS0

    Disabling TLS support.

    Using MQTT login details in /etc/cmqttd/auth

    Using C-Bus Toolkit project backup file /share/HOME24-Mar-2012.cbz

    Local time zone: Australia/Sydney

    Current time: Sat, 11 Jan 2025 17:02:23 +1100

    Running cmqttd with flags: --broker-address core-mosquitto --timesync 300 --serial /dev/ttyS0 --broker-disable-tls --broker-auth /etc/cmqttd/auth --project-file /share/HOME24-Mar-2012.cbz

    2025-01-11 17:02:23,435 Transport security disabled!

    2025-01-11 17:02:23,440 Connected to MQTT broker
     
    Adrian2073, Jan 14, 2025
    #1
  2. Adrian2073

    paul.parisi

    Joined:
    Sep 28, 2005
    Messages:
    15
    Likes Received:
    0
    Location:
    Melbourne
    I've been running this automation for a few months now, this behaviour happens if the interface disconnects (and there isn't any obvious indication that its disconnected). You would have to restart the integration but otherwise its fairly stable day to day.

    I recently had to edit the logic in the container as I discovered the code does not properly issue the ramp command (it sends an ON command with a ramp to OFF) but otherwise its functional.

    Happy to help trouble shoot if your didn't get it working.

    I was thinking about branching the code, the original author isn't active anymore and there is a few things to fix up such as committing the container changes back to the original container (my changes are just local), adding a watch dog to actually auto-restart and report the disconnection, and dealing with new HA requirements on color. I also have seen on rare occasion it can't handle some types of messages so making the recovery code a bit better was in my mind, plus a better naming of the entities.

    BTW given you did get the entities generated then I'm pretty confident you got a connection through, otherwise there is no way HA could have mapped the entities in the first place.
     
    Last edited: Jul 18, 2025
    paul.parisi, Jul 18, 2025
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.