New mqtt yaml change issue

Hey
im preparing my setup for the upcoming changes ("- platform: mqtt" to mqtt: // sensor:)
But im strugeling for setups like this.
Isn’t it possible anymore to store this together?

New version doesn’t work with the template sensor under the mqtt Tag…what can I do?

Greetings

///OLD

##################
### openWB ######
##################
  - platform: mqtt
    name: grid Tages Verbrauch
    state_topic: "openWB/evu/DailyYieldImportKwh"
    unit_of_measurement: kWh
    device_class: energy
    state_class: total_increasing
    icon: mdi:transmission-tower
  - platform: mqtt
    state_topic: "openWB/global/DailyYieldHausverbrauchKwh"
    name: OpenWB daily_yield_house
    unit_of_measurement: kWh
    device_class: energy
    state_class: total_increasing

  - platform: mqtt
    state_topic: "openWB/evu/W"
    name: OpenWB EVU Watt
  - platform: mqtt
    state_topic: "openWB/pv/W"
    name: OpenWB PV Watt
  - platform: mqtt
    state_topic: "openWB/global/ChargeMode"
    name: OpenWB Lademodus
  - platform: mqtt
    state_topic: "openWB/lp/1/%Soc"
    name: OpenWB SoC LP1
  - platform: mqtt
    state_topic: "openWB/lp/1/W"
    name: OpenWB Loading LP1 Watt
  - platform: mqtt
    state_topic: "openWB/lp/1/kWhActualCharged"
    name: OpenWB Loaded kWh
  - platform: mqtt
    state_topic: "openWB/global/WHouseConsumption"
    name: Energieverbrauch
  - platform: template
    sensors:
      openwb_status:
        friendly_name: "OpenWB Status"
        value_template: >-
          {% if states('sensor.openwb_lademodus') == '0' %}
            Sofort Laden
          {% elif states('sensor.openwb_lademodus') == '1' %}
            Min und PV
          {% elif states('sensor.openwb_lademodus') == '2' %}
            Nur PV
          {% elif states('sensor.openwb_lademodus') == '3' %}
            Stop
          {% elif states('sensor.openwb_lademodus') == '4' %}
            Standby
          {% else %}
            Unknown
            {% endif %}

NEW

##################
### openWB ######
##################
mqtt:
  sensor:

    - name: grid Tages Verbrauch
      state_topic: "openWB/evu/DailyYieldImportKwh"
      unit_of_measurement: kWh
      device_class: energy
      state_class: total_increasing
      icon: mdi:transmission-tower
    - name: OpenWB daily_yield_house
      state_topic: "openWB/global/DailyYieldHausverbrauchKwh"
      unit_of_measurement: kWh
      device_class: energy
      state_class: total_increasing

    - name: OpenWB EVU Watt
      state_topic: "openWB/evu/W"
    - name: OpenWB PV Watt
      state_topic: "openWB/pv/W"
    - name: OpenWB Lademodus
      state_topic: "openWB/global/ChargeMode"
      
    - name: OpenWB SoC LP1
      state_topic: "openWB/lp/1/%Soc"
      
    - name: OpenWB Loading LP1 Watt
      state_topic: "openWB/lp/1/W"
      
    - name: OpenWB Loaded kWh
      state_topic: "openWB/lp/1/kWhActualCharged"
      
    - name: Energieverbrauch
      state_topic: "openWB/global/WHouseConsumption"
      
    - platform: template
      sensors:
        openwb_status:
          friendly_name: "OpenWB Status"
          value_template: >-
            {% if states('sensor.openwb_lademodus') == '0' %}
              Sofort Laden
            {% elif states('sensor.openwb_lademodus') == '1' %}
              Min und PV
            {% elif states('sensor.openwb_lademodus') == '2' %}
              Nur PV
            {% elif states('sensor.openwb_lademodus') == '3' %}
              Stop
            {% elif states('sensor.openwb_lademodus') == '4' %}
              Standby
            {% else %}
              Unknown
              {% endif %}

NEW NEW:

##################
### openWB ######
##################
mqtt:
  sensor:

    - name: grid Tages Verbrauch
      state_topic: "openWB/evu/DailyYieldImportKwh"
      unit_of_measurement: kWh
      device_class: energy
      state_class: total_increasing
      icon: mdi:transmission-tower
    - name: OpenWB daily_yield_house
      state_topic: "openWB/global/DailyYieldHausverbrauchKwh"
      unit_of_measurement: kWh
      device_class: energy
      state_class: total_increasing

    - name: OpenWB EVU Watt
      state_topic: "openWB/evu/W"
    - name: OpenWB PV Watt
      state_topic: "openWB/pv/W"
    - name: OpenWB Lademodus
      state_topic: "openWB/global/ChargeMode"
      
    - name: OpenWB SoC LP1
      state_topic: "openWB/lp/1/%Soc"
      
    - name: OpenWB Loading LP1 Watt
      state_topic: "openWB/lp/1/W"
      
    - name: OpenWB Loaded kWh
      state_topic: "openWB/lp/1/kWhActualCharged"
      
    - name: Energieverbrauch
      state_topic: "openWB/global/WHouseConsumption"

sensor:                          ## <- put the template (or other) sensors here      
    - platform: template
      sensors:
        openwb_status:
          friendly_name: "OpenWB Status"
          value_template: >-
            {% if states('sensor.openwb_lademodus') == '0' %}
              Sofort Laden
            {% elif states('sensor.openwb_lademodus') == '1' %}
              Min und PV
            {% elif states('sensor.openwb_lademodus') == '2' %}
              Nur PV
            {% elif states('sensor.openwb_lademodus') == '3' %}
              Stop
            {% elif states('sensor.openwb_lademodus') == '4' %}
              Standby
            {% else %}
              Unknown
              {% endif %}
1 Like