SMA Home Manager auslesen

Ich habe keine extra Sensoren “gebastelt”, außer Autarkie & Eigenverbrauch in Prozent. Die SMA-Integration gibt bei mir alle benötigten Werte aus. Die Zuordnung ist nicht so einfach, habe ich mittels App und Sunny Portal zusammengetragen.

Guck mal hier: Template Sensor für PV Eigenverbrauch - #12 von RobertoCravallo

Das ist der Code für die 8 Rundanzeigen.

type: horizontal-stack
cards:
  - type: custom:flex-horseshoe-card
    fill_container: true
    show:
      scale_tickmarks: true
      horseshoe_style: lineargradient
    entities:
      - entity: sensor.sunny_boy_metering_power_absorbed
        decimals: 0
        name: Netzbezug
        area: Strom
    layout:
      states:
        - id: 0
          entity_index: 0
          xpos: 50
          ypos: 55
          styles:
            - font-size: 4.5em;
      names:
        - id: 0
          entity_index: 0
          xpos: 50
          ypos: 94
          styles:
            - font-size: 1.6em;
            - text-transform: capitalize;
      areas:
        - id: 0
          entity_index: 0
          xpos: 50
          ypos: 74
          styles:
            - font-size: 1.4em;
    horseshoe_state:
      color: '#db4437'
    horseshoe_scale:
      min: 0
      max: 5000
      color: '#990000'
      width: 2
    color_stops:
      '0': '#db4437'
      '1000': '#db4437'
  - type: custom:flex-horseshoe-card
    fill_container: true
    show:
      scale_tickmarks: true
      horseshoe_style: lineargradient
    entities:
      - entity: sensor.sunny_boy_metering_current_consumption
        decimals: 0
        name: Verbrauch
        area: Strom
    layout:
      states:
        - id: 0
          entity_index: 0
          xpos: 50
          ypos: 55
          styles:
            - font-size: 4.5em;
      names:
        - id: 0
          entity_index: 0
          xpos: 50
          ypos: 94
          styles:
            - font-size: 1.6em;
            - text-transform: capitalize;
      areas:
        - id: 0
          entity_index: 0
          xpos: 50
          ypos: 74
          styles:
            - font-size: 1.4em;
    horseshoe_state:
      color: '#db4437'
    horseshoe_scale:
      min: 0
      max: 5000
      color: '#990000'
      width: 2
    color_stops:
      '0': '#db4437'
      '1000': '#db4437'
  - type: custom:flex-horseshoe-card
    fill_container: true
    show:
      scale_tickmarks: true
      horseshoe_style: lineargradient
    entities:
      - entity: sensor.sunny_boy_grid_power
        decimals: 0
        name: Erzeugung
        area: Solarstrom
    layout:
      states:
        - id: 0
          entity_index: 0
          xpos: 50
          ypos: 55
          styles:
            - font-size: 4.5em;
      names:
        - id: 0
          entity_index: 0
          xpos: 50
          ypos: 94
          styles:
            - font-size: 1.6em;
            - text-transform: capitalize;
      areas:
        - id: 0
          entity_index: 0
          xpos: 50
          ypos: 74
          styles:
            - font-size: 1.4em;
    horseshoe_state:
      color: '#43a047'
    horseshoe_scale:
      min: 0
      max: 4900
      color: '#2e7031'
      width: 2
    color_stops:
      '1000': '#43a047'
      '2000': '#32CD32'
      '3100': '#ADFF2F'
  - type: custom:flex-horseshoe-card
    fill_container: true
    show:
      scale_tickmarks: true
      horseshoe_style: lineargradient
    entities:
      - entity: sensor.sunny_boy_metering_power_supplied
        decimals: 0
        name: Überschuss
        area: Solarstrom
    layout:
      states:
        - id: 0
          entity_index: 0
          xpos: 50
          ypos: 55
          styles:
            - font-size: 4.5em;
      names:
        - id: 0
          entity_index: 0
          xpos: 50
          ypos: 94
          styles:
            - font-size: 1.6em;
            - text-transform: capitalize;
      areas:
        - id: 0
          entity_index: 0
          xpos: 50
          ypos: 74
          styles:
            - font-size: 1.4em;
    horseshoe_state:
      color: '#43a047'
    horseshoe_scale:
      min: 0
      max: 4900
      color: '#2e7031'
      width: 2
    color_stops:
      '1000': '#43a047'
      '2000': '#32CD32'
      '3100': '#ADFF2F'

type: horizontal-stack
cards:
  - type: custom:flex-horseshoe-card
    fill_container: true
    show:
      scale_tickmarks: true
      horseshoe_style: lineargradient
    entities:
      - entity: sensor.sunny_boy_daily_yield
        decimals: 1
        name: Heute
        area: Solarstrom
    layout:
      states:
        - id: 0
          entity_index: 0
          xpos: 50
          ypos: 55
          styles:
            - font-size: 4.5em;
      names:
        - id: 0
          entity_index: 0
          xpos: 50
          ypos: 94
          styles:
            - font-size: 1.6em;
            - text-transform: capitalize;
      areas:
        - id: 0
          entity_index: 0
          xpos: 50
          ypos: 74
          styles:
            - font-size: 1.4em;
    horseshoe_state:
      color: '#43a047'
    horseshoe_scale:
      min: 0
      max: 50
      color: '#2e7031'
      width: 2
    color_stops:
      '1000': '#43a047'
      '2000': '#32CD32'
      '3100': '#ADFF2F'
  - type: custom:flex-horseshoe-card
    fill_container: true
    show:
      scale_tickmarks: true
      horseshoe_style: lineargradient
    entities:
      - entity: sensor.sunny_boy_total_yield
        decimals: 0
        name: Gesamt
        area: Solarstrom
        unit: MWh
    layout:
      states:
        - id: 0
          entity_index: 0
          xpos: 50
          ypos: 55
          styles:
            - font-size: 4.5em;
      names:
        - id: 0
          entity_index: 0
          xpos: 50
          ypos: 94
          styles:
            - font-size: 1.6em;
            - text-transform: capitalize;
      areas:
        - id: 0
          entity_index: 0
          xpos: 50
          ypos: 74
          styles:
            - font-size: 1.4em;
    horseshoe_state:
      color: '#43a047'
    horseshoe_scale:
      min: 0
      max: 40
      color: '#2e7031'
      width: 2
    color_stops:
      '1': '#43a047'
      '20': '#32CD32'
      '45': '#ADFF2F'
  - type: custom:flex-horseshoe-card
    fill_container: true
    show:
      scale_tickmarks: true
      horseshoe_style: lineargradient
    entities:
      - entity: sensor.sma_strom_eigenverbrauch_prozent
        decimals: 0
        name: Verbrauch
        area: Solarstrom
    layout:
      states:
        - id: 0
          entity_index: 0
          xpos: 50
          ypos: 55
          styles:
            - font-size: 4.5em;
      names:
        - id: 0
          entity_index: 0
          xpos: 50
          ypos: 94
          styles:
            - font-size: 1.6em;
            - text-transform: capitalize;
      areas:
        - id: 0
          entity_index: 0
          xpos: 50
          ypos: 74
          styles:
            - font-size: 1.4em;
    horseshoe_state:
      color: '#43a047'
    horseshoe_scale:
      min: 0
      max: 100
      color: '#2e7031'
      width: 2
    color_stops:
      '1000': '#43a047'
      '2000': '#32CD32'
      '3100': '#ADFF2F'
  - type: custom:flex-horseshoe-card
    fill_container: true
    show:
      scale_tickmarks: true
      horseshoe_style: lineargradient
    entities:
      - entity: sensor.sma_strom_autarkie_prozent
        decimals: 0
        name: Derzeitige Autarkie
        area: Solarstrom
    layout:
      states:
        - id: 0
          entity_index: 0
          xpos: 50
          ypos: 55
          styles:
            - font-size: 4.5em;
      names:
        - id: 0
          entity_index: 0
          xpos: 50
          ypos: 94
          styles:
            - font-size: 1.6em;
            - text-transform: capitalize;
      areas:
        - id: 0
          entity_index: 0
          xpos: 50
          ypos: 74
          styles:
            - font-size: 1.4em;
    horseshoe_state:
      color: '#43a047'
    horseshoe_scale:
      min: 0
      max: 100
      color: '#2e7031'
      width: 2
    color_stops:
      '1000': '#43a047'
      '2000': '#32CD32'
      '3100': '#ADFF2F'

Und das für die beiden eckigen in der Mitte.

type: horizontal-stack
cards:
  - type: custom:mushroom-template-card
    primary: >-
      Bezug:  {% set grid_feed =
      states('sensor.sunny_boy_metering_power_absorbed') | int %}

      {% if grid_feed > 0 %} 
        {{ "{0:,.0f}".format(grid_feed) | replace(',', '.',1) }} W
      {% else %}
        0 W
      {% endif %}
    card_mod:
      style: |
        ha-card {
        background:
          {% if states.sensor.sunny_boy_metering_power_supplied.state | float <= 0 %}
            #990000
          {% else %}

          {% endif %};
        }
    secondary: ''
    icon: mdi:transmission-tower-export
    tap_action:
      action: none
    hold_action:
      action: none
    double_tap_action:
      action: none
    icon_color: white
    badge_icon: null
    badge_color: null
  - type: custom:mushroom-template-card
    primary: >-
      Abgabe:   {% set grid_feed =
      states('sensor.sunny_boy_metering_power_supplied') | int %}

      {% if grid_feed > 0 %} 
        {{ "{0:,.0f}".format(grid_feed) | replace(',', '.',1) }} W
      {% else %}
        0 W
      {% endif %}
    card_mod:
      style: |
        ha-card {
          background:
          {% if states.sensor.sunny_boy_metering_power_supplied.state | float > 0 %}
            green
          {% else %}

          {% endif %};
        }
    secondary: null
    icon: mdi:transmission-tower-import
    fill_container: false
    tap_action:
      action: none
    hold_action:
      action: none
    double_tap_action:
      action: none
    icon_color: white
    badge_color: null
    badge_icon: null

Vielleicht hilft es ja weiter…