Home

Awesome

CCU-Jack to HomeAssistant

This script is providing two functions to connect HomeMatic CCU to HomeAssistant by CCU-Jack MQTT functionality. Other Add-Ons, HACS Integrations are not necessary.

Functions of hass_discovery_ccu.py:

Supported HomeMatic Devices

DeviceTypeIntegration status
HM-Sec-SCoOptischer Tür-/Fenster SensorFull
HM-WDS10-TH-OAußenthermometerFull
HmIP-BROLLRollladen AktorShow status, partly control due to different control channels on CCU side
HmIP-BSMUnterputz LichtschalterFull
HmIP-PSMZwischensteckerFull
HmIP-RFUSBCCU Zentrale
HmIP-SMIBewegungsmelderFull
HmIP-SRHTür-/Fenster Drehgriff SensorFull

Pre-Requirements

Configuration

HomeAssistant subscribes topics with auto-discovery data (published by hass_discovery_ccu.py) from "homeassistant".

CCU-Jack publishes CCU states (subscribed by HomeAssistant's auto-discovery information) to "ccu-jack/device/status".

CCU-Jack subscribes control data (published by HomeAssistant) from "ccu-jack/device/set", e.g. to switch a light.

MQTT-Explorer

CCU-Jack

In my case I use MQTT broker EMQX that is already connected to HomeAssistant. CCU-Jack publishes to MQTT broker for HomeAssistant (Outgoing) and subscribes topics to control CCU (Incoming) by using CCU-Jack's MQTT-Bridge functionally.

"Bridge": {
  "Enable": true,
  "Address": "<IP-Address of MQTT broker>",
  "Port": <Port of MQTT broker>,
  "BufferSize": 0,
  "UseTLS": false,
  "CACertFile": "",
  "Insecure": false,
  "Username": "<user>",
  "Password": "<password>",
  "ClientID": "<client>",
  "CleanSession": true,
  "Incoming": [
    {
      "Pattern": "device/set/#",
      "LocalPrefix": "",
      "RemotePrefix": "ccu-jack/",
      "QoS": 1
    }
  ],
  "Outgoing": [
    {
      "Pattern": "device/status/#",
      "LocalPrefix": "",
      "RemotePrefix": "ccu-jack/",
      "QoS": 1
    }
  ]
}

hass_discovery_ccu.py

Before using the script to publish the auto-discovery to MQTT broker, connection details and other data needs to be set in configuration file "hass_discovery_ccu.json"

"config": {
   "hass_mqtt_host": "<IP-Address of MQTT broker>",
   "hass_mqtt_port": "<Port of MQTT broker>",
   "hass_mqtt_user": "<user>",
   "hass_mqtt_pass": "<password>",
   "hass_mqtt_qos": 1,
   "hass_mqtt_retain": true,
   "hass_mqtt_topic_prefix": "homeassistant",
   "ccu_mqtt_topic_prefix": "ccu-jack/device",
   "url_ccu_jack": "http://<IP-Address of CCU-Jack>:<Port of CCU-Jack>",
   "use_ccu_device_title": true,
   "use_ccu_channel_title": false
},

Usage:

user@host:~$ python3 hass_discovery_ccu.py
usage: hass_discovery_ccu.py [-h] [-d] [-a]

options:
  -h, --help       show this help message and exit
  -d, --discovery  send HomeAssistant auto-discovery data to MQTT broker
  -a, --all        send all CCU channels/states to MQTT broker

HomeAssistant

When auto-discovery data are pushed to topic "homeassistant", HomeAssistant creates the devices and entities immediately.

HomeMatic Device List in HomeAssistant: Device list

HomeMatic Device type "HmIP-BSM" details with entities: Device details