Giter Club home page Giter Club logo

5500shac-cbus2mqtt's Introduction

5500SHAC-Cbus2MQTT

Push and pull Cbus events from a 5500SHAC to MQTT.

I use this to integrate my Cbus installation with Home Assistant.

Based on cgateweb by the1laz.

Similar projects:

  • acMqtt from autoSteve. Includes Home Assistant auto-discovery by using Cbus tags. Very cool!
  • cbus from micolous.

Install:

  1. Log into your 5500SHAC, navigate to the "Scripting" section and install the two resident scripts and the event based script into their relevant sections.
  2. Update your MQTT server hostname, username and password details in the resident scripts.
  3. Activate the scripts.
  4. Tag all the objects with the "All" keyword to events are pushed to the cbus2mqtt script. You can use this script to easily do this
for i = 0,255 do
  grp.addtags('0/56/'..i, 'All')
end 

Examples

In these examples, #1, #2 and #3 represent the Cbus network number, application number, and the group number.

Updates get published on these topics:

  • cbus/read/#1/#2/#3/state - ON/OFF gets published to these topics if the group is turned ON/OFF.

  • cbus/read/#1/#2/#3/level - The level of the group gets published to these topics. 0-255

Publish to these topics to control a group address:

  • cbus/write/#1/#2/#3/switch - Publish ON/OFF to these topics to turn lights on/off

  • cbus/write/#1/#2/#3/ramp - Publish a CBus level (0-255) to ramp to. Optionally add a comma then a time in seconds (e.g. 50,4 or 128,2).

  • cbus/write/#1/#2/#3/measurement - Publish a measurement value (i.e. temperature) to a Cbus measurement application. Values are divided by 10 so a MQTT value of 301 becomes 30.1 when published to Cbus.

This requests an update from all addresses:

  • cbus/write/#1/#2//getall - Current values get published on the cbus/read topics. This is handy to periodically "re-sync" your MQTT subscribers on reboot or if they miss an update.

Home Assistant MQTT config

Your Home Assistant MQTT light, switch, fan or cover entities should look like this:

mqtt:
  switch:
    # Switch
    - name: Bathroom
      state_topic: 'cbus/read/254/56/1/state'
      command_topic: 'cbus/write/254/56/1/switch'
      payload_on: 'ON'
      payload_off: 'OFF'
      unique_id: mqtt_1

    # Dimmer
    - name: Bedroom
      state_topic: 'cbus/read/254/56/2/state'
      command_topic: 'cbus/write/254/56/2/switch'
      brightness_state_topic: 'cbus/read/254/56/2/level'
      brightness_command_topic: 'cbus/write/254/56/2/ramp'
      payload_on: 'ON'
      payload_off: 'OFF'
      on_command_type: 'brightness'
      unique_id: mqtt_2
  fan:
    # Fan
    - name: Bedroom fan
      state_topic: 'cbus/read/254/56/3/state'
      command_topic: 'cbus/write/254/56/3/switch'
      percentage_state_topic: 'cbus/read/254/56/3/level'
      percentage_command_topic: 'cbus/write/254/56/3/ramp'
      speed_range_max: 255
      payload_on: 'ON'
      payload_off: 'OFF'
      optimistic: true
      unique_id: mqtt_3
  cover:
    # Cover
    - name: Outdoor blind - south
      position_topic: 'cbus/read/254/56/4/level'
      set_position_topic: 'cbus/write/254/56/4/ramp'
      position_open: 255
      position_closed: 0
      payload_open: 255
      payload_close: 0
      state_open: 255
      state_closed: 0
      device_class: blind
      command_topic: 'cbus/write/254/56/4/ramp'
      unique_id: mqtt_4

5500shac-cbus2mqtt's People

Contributors

nick-adams-au avatar atomic10 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.