Making MQTT even harder to understand after upgrade

So since the upgrade to 84.2 I now have a botched MQTT service…Having read through the breaking changes I see you now have to add more code to yaml to make MQTT work ( Mqtt light refactor #18227)…I have absolutely no idea what this change implies…it was hard enough before to understand as it is but made even harder by the implementation of shema templates and json…Where the hell do I start…and code writers if you are upgrading please have a thought for those not on your level…it’s very hard to understand…things should get easier nor harder with new versions…!!
Can you have schema template and json as one entry or are they separated how does this equate in this script.

light:
# MQTT RGB STRIP
  - platform: mqtt
    name: "MagicHome RGB Strip"
    state_topic: "stat/MagicHome/POWER"
    state_value_template: "{{ value }}"
    command_topic: "cmnd/MagicHome/POWER"
    brightness_state_topic: "stat/MagicHome/DIMMER"
    brightness_command_topic: "cmnd/MagicHome/Dimmer"
    brightness_value_template: "{{ value_json.Dimmer }}"
    brightness_scale: 100
    rgb_state_topic: "stat/MagicHome/COLOR"
    rgb_command_topic: "cmnd/MagicHome/Color2"
    rgb_value_template: "{{(value_json.Channel[0]*2.55)|int}},{{(value_json.Channel[1]*2.55)|int}},{{(value_json.Channel[2]*2.55)|int}}"
    effect_command_topic: "cmnd/MagicHome/Scheme"
    effect_state_topic: "stat/MagicHome/SCHEME"
    effect_value_template: "{{ value.Scheme }}"
    effect_list:
      - 0
      - 1
      - 2
      - 3
      - 4
    retain: true
    qos: 1
    payload_on: "ON"
    payload_off: "OFF"

  #MQTT RGBW LED STRIP
      - platform: mqtt
        name: "RGBW LED STRIP"
        state_topic: "stat/RGBWSTRIP/RESULT"
        command_topic: "cmnd/RGBWSTRIP/POWER"
        state_value_template: "{{ value_json.POWER }}"
        brightness_state_topic: "stat/RGBWSTRIP/RESULT"
        brightness_command_topic: "cmnd/RGBWSTRIP/Dimmer"
        brightness_scale: 100
        brightness_value_template: "{{ value_json.Dimmer }}"
        white_value_state_topic: "stat/RGBWSTRIP/RESULT"
        white_value_command_topic: "cmnd/RGBWSTRIP/Channel4"
        white_value_scale: 100
        white_value_template: "{{ value_json.Channel[3] }}"
        rgb_command_topic: "cmnd/RGBWSTRIP/Color"
        rgb_command_template: "{{ '%02x%02x%02x' | format(red, green, blue)}}"
        rgb_state_topic: "stat/RGBWSTRIP/RESULT"
        rgb_value_template: "{{(value_json.Channel[0]*2.55)|int}},{{(value_json.Channel[1]*2.55)|int}},{{(value_json.Channel[2]*2.55)|int}}"
        effect_state_topic: "stat/RGBWSTRIP/RESULT"
        effect_command_topic: "cmnd/RGBWSTRIP/Scheme"
        effect_list:
          - 0
          - 1
          - 2
          - 3
          - 4
        retain: true
        qos: 1
        payload_on: "ON"
        payload_off: "OFF"

# RGB intelligent Strip
  - platform: mqtt_json
    name: "RGB Intelligent Strip"
    state_topic: "brins/rgbstrip"
    command_topic: "brins/rgbstrip/set"
    effect: true
    effect_list:
      - bpm
      - candy cane
      - Christmas Day
      - confetti
      - cyclon rainbow
      - dots
      - Easter Sunday
      - fire
      - glitter
      - Halloween
      - juggle
      - lightning
      - noise
      - police all
      - police one
      - rainbow
      - rainbow with glitter
      - Red, White, Blue
      - ripple
      - sinelon
      - solid
      - St. Patricks Day
      - Star Wars
      - Thanksgiving
      - twinkle
      - Valentines Day
    brightness: true
    flash: true
    rgb: true
    optimistic: false
    qos: 0

Hello,

I thing you have to change to configuration to the example in this thread:

2 Likes

Thanks @w2cker I had gone through the breaking changes again and did the very same thing…The first two mqtt entities I left as is…and all seems to work again…thanks for the help…!!

1 Like