Show me your Home Assistant CBUS+MQTT .yaml files

Discussion in 'C-Bus Toolkit and C-Gate Software' started by theboyg, Nov 21, 2021.

  1. theboyg

    theboyg

    Joined:
    Apr 3, 2005
    Messages:
    210
    Likes Received:
    9
    I'm continuing on my journey to move to Home Assistant and MQTT, but I've not yet worked out how to control dimming. I'm using HA on a Pi 4, and cgate with cgateweb on another Pi. Toolkit can talk to cgate fine.

    I can read and write regular on off switches, or even a dim channel as if it was a switch
    I can detect changes to a dimmer
    I cannot write changes out to a dimmer
    On a dimmer, I can try to turn it off in HA, but then within a second or so it turns itself off

    What are folks here using for their .yaml config for dimming? Here's mine, and I'm using MQTT explorer to track changes.

    This works. I can detect changes, and I can write out changes.
    Code:
      - platform: mqtt
        name: 'MQ EnSuite Light'
        state_topic: 'cbus/read/254/56/2/state'
        command_topic: 'cbus/write/254/56/2/switch'
        payload_on: 'ON'
        payload_off: 'OFF'
        unique_id: mq_ensuite_ceilinglight
    This does not work as described above. I've also tried adding payload_on: 'ON'
    Code:
      - platform: mqtt
        name: 'mq Den Lights'
        state_topic: 'cbus/read/254/56/0/state'
        command_topic: 'cbus/write/254/56/0/switch'
        brightness_state_topic: 'cbus/read/254/56/0/level'
        brightness_command_topic: 'cbus/write/254/56/0/ramp'
        payload_off: 'OFF'
        on_command_type: 'brightness'
        unique_id: mq_den_ceiling
     
    theboyg, Nov 21, 2021
    #1
  2. theboyg

    theboyg

    Joined:
    Apr 3, 2005
    Messages:
    210
    Likes Received:
    9
    Found the solution, all working. It needed brightness_scale to work.

    Code:
      - platform: mqtt
        name: "mq Den Lights"
        state_topic: "cbus/read/254/56/0/state"
        command_topic: "cbus/write/254/56/0/switch"
        brightness_state_topic: "cbus/read/254/56/0/level"
        brightness_command_topic: "cbus/write/254/56/0/ramp"
        payload_off: "OFF"
        on_command_type: "brightness"
        unique_id: mq_den_ceiling
        brightness_scale: "100" 
     
    theboyg, Nov 21, 2021
    #2
    Ian likes this.
  3. theboyg

    theboyg

    Joined:
    Apr 3, 2005
    Messages:
    210
    Likes Received:
    9
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.