decluttering_templates:
  title_template:
    card:
      type: custom:vertical-stack-in-card
      cards:
        - type: custom:mushroom-title-card
          title: '[[title]]'
          card_mod:
            style: |
              ha-card {
                margin-top: 24px !important;
                margin-bottom: 0px !important;
                padding-top: 0px !important;
                padding-bottom: 0px !important;
                font-style: italic;
                --title-color: skyblue !important;
              }
              h1 {
                margin: 0 !important;
                line-height: 1.2 !important;
              }
        - type: entities
          entities:
            - type: divider
              style:
                background-color: skyblue
                height: 1px
          card_mod:
            style: |
              ha-card {
                height: 30px !important;
                margin-top: -10px;
                border: none;
                padding-top: 0px !important;
                padding-bottom: 0px !important;
                background-color: transparent !important;
              } 
  title_mit_link_template:
    card:
      type: vertical-stack
      cards:
        - type: horizontal-stack
          cards:
            - type: custom:mushroom-title-card
              title: '[[title]]'
              card_mod:
                style: |
                  ha-card {
                    margin-top: 24px !important;
                    margin-bottom: 0px !important;
                    padding-top: 0px !important;
                    padding-bottom: 0px !important;
                    font-style: italic;
                    --title-color: skyblue !important;
                  }
                  h1 {
                    margin: 0 !important;
                    line-height: 1.2 !important;
                  }
            - type: heading
              icon: none
              heading_style: title
              heading: ''
              badges:
                - type: custom:mushroom-template-badge
                  content: ''
                  icon: '[[link_icon]]'
                  color: skyblue
                  tap_action:
                    action: navigate
                    navigation_path: '[[link]]'
                  hold_action:
                    action: none
                  double_tap_action:
                    action: none
        - type: entities
          entities:
            - type: divider
              style:
                background-color: skyblue
                height: 1px
          card_mod:
            style: |
              ha-card {
                height: 30px !important;
                margin-top: -10px;
                border: none;
                padding-top: 0px !important;
                padding-bottom: 0px !important;
                background-color: transparent !important;
              } 
  subtitle_template:
    card:
      type: vertical-stack
      cards:
        - type: heading
          heading: '[[subtitle]]'
          icon: '[[icon]]'
          badges:
            - type: entity
              show_state: true
              show_icon: true
              entity: '[[feuchtigkeitssensor]]'
              color: blue
              tap_action:
                action: more-info
            - type: entity
              show_state: true
              show_icon: true
              entity: '[[temperatursensor]]'
              color: red
              tap_action:
                action: more-info
          card_mod:
            style: |
              ha-card {
                background-color: #474856 !important;
              }
              .title >p {
                font-weight: bold !important;
              }
  subtitle_ohne_badges_template:
    card:
      type: vertical-stack
      cards:
        - type: heading
          heading: '[[subtitle]]'
          icon: '[[icon]]'
          badges: []
          card_mod:
            style: |
              ha-card {
                background-color: #474856 !important;
              }
  licht_template:
    card:
      type: custom:mushroom-template-card
      entity: '[[entity]]'
      primary: '[[name]]'
      icon: '[[icon]]'
      icon_color: |
        {% if is_state('[[entity]]', 'on') %}
          yellow
        {% else %}
          grey
        {% endif %}
      secondary: |
        {{state_translated('[[entity]]') }}
      tap_action:
        action: toggle
      hold_action:
        action: more-info
      card_mod:
        style:
          .: |
            ha-card {
              border: none;
              padding: 0px !important;
             }
  schalter_template:
    card:
      type: custom:mushroom-template-card
      entity: '[[entity]]'
      primary: '[[name]]'
      icon: '[[icon]]'
      icon_color: |
        {% if is_state('[[entity]]', 'on') %}
          green
        {% else %}
          grey
        {% endif %}
      secondary: |
        {{state_translated('[[entity]]') }}
      tap_action:
        action: toggle
      hold_action:
        action: more-info
      card_mod:
        style:
          .: |
            ha-card {
              border: none;
              padding: 0px !important;
            }
  rollladen_template:
    card:
      type: custom:mushroom-template-card
      entity: '[[entity]]'
      primary: '[[name]]'
      icon: >
        {% set position = state_attr('[[entity]]', 'current_position') | int %}
        {% set state = states('[[entity]]') %} {% if state == 'opening' %}
          mdi:arrow-up-bold
        {% elif state == 'closing' %}
          mdi:arrow-down-bold
        {% elif position == 100 %}
          mdi:window-shutter-open
        {% elif position == 0 %}
          mdi:window-shutter
        {% else %}
          mdi:window-shutter-alert
        {% endif %}
      icon_color: |
        {% set position = state_attr('[[entity]]', 'current_position') | int %}
        {% if position == 100 %}
          grey
        {% else %}
          blue
        {% endif %}
      secondary: |
        {% set position = state_attr('[[entity]]', 'current_position') | int %}

        {% set state = states('[[entity]]') %}
        {% if state == 'open' and position != 100 %} 
          {{ position }}% 
        {% endif %}
        {{ state_translated('[[entity]]') }}
      tap_action:
        action: toggle
      hold_action:
        action: more-info
      card_mod:
        style:
          .: |
            ha-card {
              border: none;
              padding: 0px !important;
            }
  climate_template:
    card:
      type: custom:mushroom-template-card
      entity: '[[entity]]'
      primary: '[[name]]'
      icon: mdi:thermometer
      icon_color: >
        {% set current_temperature = state_attr('[[entity]]',
        'current_temperature') %}

        {% set temperature = state_attr('[[entity]]', 'temperature') %}

        {% set mode_alt = states('[[entity]]') %} {% set mode =
        state_attr('[[entity]]', 'hvac_action') %}

        {% if mode == 'heat' %}
          {% if current_temperature < temperature %}
            red
          {% else %}
            grey
          {% endif %}
        {% elif mode == 'cool' %}
          {% if current_temperature > temperature %}
            blue
          {% else %}
            grey
          {% endif %}
        {% else %}
          grey
        {% endif %}
      secondary: >
        {{ state_attr('[[entity]]', 'current_temperature') | int }}?°C (soll: {{
        state_attr('[[entity]]', 'temperature') | int }}?°C)
      tap_action:
        action: more-info
      hold_action:
        action: more-info
      card_mod:
        style:
          .: |
            ha-card {
              border: none;
              padding: 0px !important;
            }
  leerfeld_template:
    card:
      type: heading
      icon: null
      heading: null
  warning_template:
    card:
      type: heading
      heading: '[[warning]]'
      icon: mdi:alert
      badges: []
      card_mod:
        style: |
          ha-card {
            background-color: red !important;
          }
          .title >p {
            font-weight: bold !important;
          }
  test_template:
    card:
      type: custom:mushroom-template-card
      entity: '[[entity]]'
      primary: '[[name]]'
      icon: '[[icon]]'
      secondary: |
        {{state_translated('[[entity]]') }}
      tap_action:
        action: toggle
      hold_action:
        action: more-info
      card_mod:
        style:
          mushroom-shape-icon$: |
            .shape {
               background: darkorange !important;
               box-shadow: 0px 1px 0px 0px rgb(0,0,0), 
               0px 7px 10px 0px rgb(10,10,10), 
               inset 0px 1px 3px 0px rgba(250, 250, 250, .5),  
               inset 0px -5px 5px 0px rgba(0, 0, 0, .6) !important; 

               }
          .: |
            ha-card {
              background: grey !important;
              --icon-symbol-size: 20px;
              border: none;
             }
              
views:
  - title: Info
    badges:
      - type: custom:mushroom-template-badge
        content: Behälter Luftentfeuchter voll
        icon: mdi:exclamation-thick
        color: red
        entity: switch.buro_kg_steckdose_entfeuchter
        visibility:
          - condition: state
            entity: binary_sensor.buro_kg_behalter_luftentfeuchter_voll
            state: 'on'
      - type: entity
        show_name: true
        show_state: true
        show_icon: true
        entity: sensor.weishaupt_fehler_numerisch
        color: red
        icon: mdi:alert-circle
        name: Fehlercode
        visibility:
          - condition: numeric_state
            entity: sensor.weishaupt_stoerungsfrei
            below: 1
          - condition: numeric_state
            entity: sensor.weishaupt_fehler_numerisch
            below: 65535
        tap_action:
          action: navigate
          navigation_path: /dashboard-warmepumpe
      - type: entity
        show_name: true
        show_state: true
        show_icon: true
        entity: sensor.weishaupt_warnung_numerisch
        color: amber
        name: Warnungscode
        icon: mdi:alert-circle
        visibility:
          - condition: numeric_state
            entity: sensor.weishaupt_stoerungsfrei
            below: 1
          - condition: numeric_state
            entity: sensor.weishaupt_warnung_numerisch
            below: 65535
        tap_action:
          action: navigate
          navigation_path: /dashboard-warmepumpe
      - type: custom:mushroom-template-badge
        content: Waschmaschine läuft
        icon: mdi:washing-machine
        color: blue
        entity: input_boolean.waschmaschine_lauft
        visibility:
          - condition: state
            entity: input_boolean.waschmaschine_lauft
            state: 'on'
        label: ''
        tap_action:
          action: more-info
      - type: custom:mushroom-template-badge
        content: Wäschetrockner läuft
        icon: mdi:tumble-dryer
        color: blue
        entity: input_boolean.waschetrockner_lauft
        visibility:
          - condition: state
            entity: input_boolean.waschetrockner_lauft
            state: 'on'
        label: ''
        tap_action:
          action: more-info
      - type: custom:mushroom-template-badge
        content: Wasseralarm Drainage
        icon: mdi:alarm-light
        color: red
        entity: binary_sensor.wasserwarnung_drainagesumpf_alarm_1
        visibility:
          - condition: state
            entity: binary_sensor.wasserwarnung_drainagesumpf_alarm_1
            state: 'on'
      - type: custom:mushroom-template-badge
        content: Wärmepumpe offline
        icon: mdi:alarm-light
        color: red
        entity: binary_sensor.weishaupt_online
        visibility:
          - condition: state
            entity: binary_sensor.weishaupt_online
            state: 'off'
      - type: custom:mushroom-template-badge
        content: PV-Anlage offline
        icon: mdi:alarm-light
        color: red
        entity: binary_sensor.kostal_online
        visibility:
          - condition: state
            entity: binary_sensor.pv_online
            state: 'off'
    sections:
      - type: grid
        cards:
          - type: markdown
            content: >-
              <h1>{{ states('sensor.time') }}</h1><h1>{{
              states('sensor.datum_kurz')}}</h1>
            card_mod:
              style:
                .: |
                  ha-card
                  {
                    height: 123px !important;
                    background-color: transparent !important;
                    backdrop-filter: none !important;
                    -webkit-backdrop-filter: none !important;
                    border: 0px !important;
                  }
                ha-markdown:
                  $: |
                    h1:first-of-type
                    {
                      text-align: center;
                      margin-right: 10px;
                      font-size: 60px;
                      font-weight: 500;
                    }
                    h1:nth-of-type(2)
                    {
                      text-align: center;
                      margin-top: -40px;
                      margin-right: 0px;
                      font-size: 18px;
                      font-weight: normal;
                    }
          - type: custom:vertical-stack-in-card
            cards:
              - type: custom:decluttering-card
                template: title_mit_link_template
                variables:
                  - title: Vorhersage
                  - link_icon: mdi:clouds
                  - link: '#wetterradar'
              - type: weather-forecast
                show_current: true
                show_forecast: true
                entity: weather.aachen_dwd
                forecast_type: daily
                name: '     '
                card_mod:
                  style: |
                    ha-card {
                      border: none;
                    }
          - type: custom:stack-in-card
            cards:
              - type: custom:decluttering-card
                template: title_template
                variables:
                  - title: Wetterstation
              - type: grid
                columns: 2
                square: false
                cards:
                  - type: tile
                    entity: sensor.wetterstation_temperatur
                    name: Temperatur
                    color: red
                    card_mod:
                      style: |
                        ha-card {
                          border: none;
                        }
                  - type: tile
                    entity: sensor.wetterstation_luftfeuchtigkeit
                    name: Feuchtigkeit
                    color: blue
                    card_mod:
                      style: |
                        ha-card {
                          border: none;
                        }
                  - type: tile
                    entity: sensor.wetterstation_beleuchtungsstarke
                    name: Helligkeit
                    color: accent
                    card_mod:
                      style: |
                        ha-card {
                          border: none;
                        }
                  - type: tile
                    entity: sensor.wetterstation_sonnenscheindauer_heute
                    name: Sonnenstunden
                    color: accent
                    card_mod:
                      style: |
                        ha-card {
                          border: none;
                        }
                  - type: tile
                    entity: sensor.wetterstation_windgeschwindigkeit
                    name: Wind
                    color: cyan
                    card_mod:
                      style: |
                        ha-card {
                          border: none;
                        }
          - type: custom:mushroom-cover-card
      - type: grid
        cards:
          - type: custom:vertical-stack-in-card
            cards:
              - type: custom:decluttering-card
                template: title_template
                variables:
                  - title: Erdgeschoß
              - type: custom:decluttering-card
                template: subtitle_template
                variables:
                  - subtitle: Wohnzimmer
                  - icon: mdi:sofa
                  - feuchtigkeitssensor: sensor.heizung_wohnzimmer_int0000007_luftfeuchtigkeit
                  - temperatursensor: sensor.heizung_wohnzimmer_int0000007_temperatur
              - type: custom:layout-card
                layout_type: custom:grid-layout
                layout:
                  grid-template-columns: 1fr 1fr
                  grid-template-rows: 1fr
                  margin: 0px 0px 0px 0px
                cards:
                  - type: custom:decluttering-card
                    template: licht_template
                    variables:
                      - name: Ambientlicht
                      - icon: mdi:lamps
                      - entity: switch.wohnzimmer_ambientlicht
                  - type: custom:decluttering-card
                    template: licht_template
                    variables:
                      - name: Lichterkette
                      - icon: mdi:string-lights
                      - entity: switch.steckdose_7
                  - type: custom:decluttering-card
                    template: rollladen_template
                    variables:
                      - name: Rollladen
                      - entity: cover.wohnzimmer_rollladen
                  - type: custom:decluttering-card
                    template: climate_template
                    variables:
                      - name: Thermostat
                      - entity: climate.heizung_wohnzimmer_int0000007
                card_mod:
                  style: |
                    :host {
                      --grid-card-gap: 4px !important;
                    }
              - type: custom:decluttering-card
                template: subtitle_template
                variables:
                  - subtitle: Küche
                  - icon: mdi:stove
                  - feuchtigkeitssensor: sensor.heizung_kuche_int0000008_luftfeuchtigkeit
                  - temperatursensor: sensor.heizung_kuche_int0000008_temperatur
              - type: grid
                columns: 2
                square: false
                cards:
                  - type: custom:decluttering-card
                    template: rollladen_template
                    variables:
                      - name: Rollladen
                      - entity: cover.kuche_rollladen
                  - type: custom:decluttering-card
                    template: climate_template
                    variables:
                      - name: Thermostat
                      - entity: climate.heizung_kuche_int0000008
                card_mod:
                  style: |
                    :host {
                      --grid-card-gap: 4px !important;
                    }
              - type: custom:decluttering-card
                template: subtitle_template
                variables:
                  - subtitle: Flur
                  - icon: mdi:coat-rack
                  - feuchtigkeitssensor: sensor.heizung_flur_int0000006_luftfeuchtigkeit
                  - temperatursensor: sensor.heizung_flur_int0000006_temperatur
              - type: grid
                columns: 2
                square: false
                cards:
                  - type: custom:decluttering-card
                    template: leerfeld_template
                  - type: custom:decluttering-card
                    template: climate_template
                    variables:
                      - name: Thermostat
                      - entity: climate.heizung_flur_int0000006
                card_mod:
                  style: |
                    :host {
                      --grid-card-gap: 4px !important;
                    }
              - type: custom:decluttering-card
                template: subtitle_template
                variables:
                  - subtitle: Treppenhaus
                  - icon: mdi:stairs
                  - feuchtigkeitssensor: sensor.buro_kg_thermostat_luftfeuchtigkeit
                  - temperatursensor: sensor.buro_kg_thermostat_temperatur
              - type: grid
                columns: 2
                square: false
                cards:
                  - type: custom:decluttering-card
                    template: licht_template
                    variables:
                      - name: Lampignons
                      - icon: mdi:string-lights
                      - entity: switch.steckdose_8
                  - type: custom:decluttering-card
                    template: rollladen_template
                    variables:
                      - name: Rollladen
                      - entity: cover.treppenhaus_rollladen
                card_mod:
                  style: |
                    :host {
                      --grid-card-gap: 4px !important;
                    }
          - type: horizontal-stack
            cards:
              - type: custom:stack-in-card
                cards:
                  - type: custom:decluttering-card
                    template: title_template
                    variables:
                      - title: Draußen
                  - type: grid
                    columns: 2
                    square: false
                    cards:
                      - type: custom:decluttering-card
                        template: licht_template
                        variables:
                          - name: Lichterk. vorne
                          - icon: mdi:string-lights
                          - entity: switch.lichterketten_vorne
                      - type: custom:decluttering-card
                        template: licht_template
                        variables:
                          - name: Licht Eingang
                          - icon: mdi:outdoor-lamp
                          - entity: switch.eingang_schalter_ausenlicht
                    card_mod:
                      style: |
                        :host {
                          --grid-card-gap: 4px !important;
                        }
      - type: grid
        cards:
          - type: horizontal-stack
            cards:
              - type: custom:vertical-stack-in-card
                cards:
                  - type: custom:decluttering-card
                    template: title_template
                    variables:
                      - title: Obergeschoß
                  - type: custom:decluttering-card
                    template: subtitle_template
                    variables:
                      - subtitle: Büro OG
                      - icon: mdi:desktop-classic
                      - feuchtigkeitssensor: sensor.heizung_buro_og_int0000002_luftfeuchtigkeit
                      - temperatursensor: sensor.heizung_buro_og_int0000002_temperatur
                  - type: grid
                    columns: 2
                    square: false
                    cards:
                      - type: custom:decluttering-card
                        template: licht_template
                        variables:
                          - name: Lampe Fenster
                          - icon: mdi:lamp
                          - entity: switch.steckdose_4
                      - type: custom:decluttering-card
                        template: climate_template
                        variables:
                          - name: Thermostat
                          - entity: climate.heizung_buro_og_int0000002
                      - type: custom:decluttering-card
                        template: rollladen_template
                        variables:
                          - name: Rollladen Türe
                          - entity: cover.buro_og_rollladen_ture
                      - type: custom:decluttering-card
                        template: rollladen_template
                        variables:
                          - name: Rollladen Fenster
                          - entity: cover.buro_og_rollladen_fenster
                    card_mod:
                      style: |
                        :host {
                          --grid-card-gap: 4px !important;
                        }
                  - type: custom:decluttering-card
                    template: subtitle_template
                    variables:
                      - subtitle: Gästezimmer
                      - icon: mdi:bed
                      - feuchtigkeitssensor: sensor.heizung_gastezimmer_int0000001_luftfeuchtigkeit
                      - temperatursensor: sensor.heizung_gastezimmer_int0000001_temperatur
                  - type: grid
                    columns: 2
                    square: false
                    cards:
                      - type: custom:decluttering-card
                        template: licht_template
                        variables:
                          - name: Licht Puppenhaus
                          - icon: mdi:home-lightbulb-outline
                          - entity: switch.steckdose_m6
                      - type: custom:decluttering-card
                        template: leerfeld_template
                      - type: custom:decluttering-card
                        template: rollladen_template
                        variables:
                          - name: Rollladen
                          - entity: cover.gastezimmer_rollladen
                      - type: custom:decluttering-card
                        template: climate_template
                        variables:
                          - name: Thermostat
                          - entity: climate.heizung_gastezimmer_int0000001
                    card_mod:
                      style: |
                        :host {
                          --grid-card-gap: 4px !important;
                        }
                  - type: custom:decluttering-card
                    template: subtitle_template
                    variables:
                      - subtitle: Duschbad
                      - icon: mdi:shower-head
                      - feuchtigkeitssensor: sensor.heizung_duschbad_int0000004_luftfeuchtigkeit
                      - temperatursensor: sensor.heizung_duschbad_int0000004_temperatur
                  - type: grid
                    columns: 2
                    square: false
                    cards:
                      - type: custom:decluttering-card
                        template: leerfeld_template
                      - type: custom:decluttering-card
                        template: climate_template
                        variables:
                          - name: Thermostat
                          - entity: climate.heizung_duschbad_int0000004
                    card_mod:
                      style: |
                        :host {
                          --grid-card-gap: 4px !important;
                        }
                  - type: custom:decluttering-card
                    template: subtitle_template
                    variables:
                      - subtitle: Bad
                      - icon: mdi:bathtub
                      - feuchtigkeitssensor: sensor.heizung_bad_int0000005_luftfeuchtigkeit
                      - temperatursensor: sensor.heizung_bad_int0000005_temperatur
                  - type: grid
                    columns: 2
                    square: false
                    cards:
                      - type: custom:decluttering-card
                        template: rollladen_template
                        variables:
                          - name: Rollladen
                          - entity: cover.bad_rollladen
                      - type: custom:decluttering-card
                        template: climate_template
                        variables:
                          - name: Thermostat
                          - entity: climate.heizung_bad_int0000005
                    card_mod:
                      style: |
                        :host {
                          --grid-card-gap: 4px !important;
                        }
                  - type: custom:decluttering-card
                    template: subtitle_template
                    variables:
                      - subtitle: Schlafzimmer
                      - icon: mdi:bed-king
                      - feuchtigkeitssensor: sensor.heizug_schlafzimmer_int0000003_luftfeuchtigkeit
                      - temperatursensor: sensor.heizug_schlafzimmer_int0000003_temperatur
                  - type: grid
                    columns: 2
                    square: false
                    cards:
                      - type: custom:decluttering-card
                        template: rollladen_template
                        variables:
                          - name: Rollladen
                          - entity: cover.schlafzimmer_rollladen
                      - type: custom:decluttering-card
                        template: climate_template
                        variables:
                          - name: Thermostat
                          - entity: climate.heizug_schlafzimmer_int0000003
                    card_mod:
                      style: |
                        :host {
                          --grid-card-gap: 4px !important;
                        }
          - type: custom:stack-in-card
            cards:
              - type: custom:decluttering-card
                template: title_template
                variables:
                  - title: Büro KG
              - type: grid
                columns: 2
                square: false
                cards:
                  - type: custom:decluttering-card
                    template: schalter_template
                    variables:
                      - name: Entfeuchter
                      - icon: mdi:power
                      - entity: switch.steckdose_m3
                  - type: custom:decluttering-card
                    template: climate_template
                    variables:
                      - name: Thermostat
                      - entity: climate.buro_kg_thermostat
                card_mod:
                  style: |
                    :host {
                      --grid-card-gap: 4px !important;
                    }
              - type: heading
                icon: none
                heading: ''
                badges:
                  - type: entity
                    show_state: true
                    show_icon: true
                    entity: sensor.steckdose_m3_leistung
                    color: orange
                    tap_action:
                      action: more-info
                  - type: entity
                    show_state: true
                    show_icon: true
                    entity: sensor.buro_kg_thermostat_luftfeuchtigkeit
                    color: blue
                    tap_action:
                      action: more-info
                  - type: entity
                    show_state: true
                    show_icon: true
                    entity: sensor.buro_kg_thermostat_temperatur
                    color: red
                    tap_action:
                      action: more-info
      - type: grid
        cards:
          - type: custom:stack-in-card
            cards:
              - type: custom:decluttering-card
                template: title_mit_link_template
                variables:
                  - title: Energie
                  - link_icon: mdi:chevron-right
                  - link: /energy
              - type: vertical-stack
                cards:
                  - type: custom:power-flow-card-plus
                    entities:
                      battery:
                        entity: sensor.kostal_sum_battery_charge_discharge_dc
                        state_of_charge: sensor.kostal_system_state_of_charge
                        display_zero_tolerance: 50
                        display_state: one_way
                        color_icon: true
                        color_value: false
                        color:
                          production:
                            - 0
                            - 160
                            - 0
                          consumption:
                            - 0
                            - 160
                            - 0
                      grid:
                        entity: sensor.kostal_grid_power_total
                        display_zero_tolerance: 50
                        use_metadata: false
                        color_value: false
                        display_state: one_way
                        color:
                          production:
                            - 0
                            - 160
                            - 0
                          consumption:
                            - 180
                            - 40
                            - 40
                        secondary_info: {}
                        color_icon: true
                      solar:
                        entity: sensor.kostal_sum_pv_power_inverter_dc
                        display_zero_tolerance: 50
                        display_zero_state: true
                        secondary_info: {}
                        color_icon: true
                      home:
                        secondary_info: {}
                        entity: sensor.kostal_home_consumption
                        display_zero_tolerance: 50
                        circle_animation: true
                        subtract_individual: false
                        color_icon: true
                      individual:
                        - entity: >-
                            sensor.stromaufnahme_weishaupt_warmepumpe_total_active_power
                          secondary_info: {}
                          name: Wärmepumpe
                          color_icon: true
                          display_zero_state: true
                          display_zero: false
                          show_direction: true
                          display_zero_tolerance: 50
                          icon: mdi:heat-wave
                          color:
                            - 255
                            - 55
                            - 55
                          unit_white_space: true
                        - entity: sensor.weishaupt_e_heizung_total_active_power
                          secondary_info: {}
                          name: E-Heizung
                          color_icon: true
                          display_zero_state: true
                          icon: mdi:lightning-bolt
                          display_zero_tolerance: 50
                          display_zero: false
                          inverted_animation: false
                          show_direction: true
                          unit_white_space: true
                        - entity: sensor.stromaufnahme_ladestation_total_active_power
                          secondary_info: {}
                          name: Ladestation
                          display_zero_state: true
                          show_direction: true
                          color_icon: true
                          icon: mdi:ev-station
                          display_zero: false
                          unit_white_space: true
                          display_zero_tolerance: 50
                        - entity: sensor.stromaufnahme_e_herd_total_active_power
                          secondary_info: {}
                          name: E-Herd
                          icon: mdi:stove
                          color_icon: true
                          display_zero: false
                          display_zero_tolerance: 50
                          display_zero_state: true
                          show_direction: true
                          unit_white_space: true
                        - entity: sensor.steckdose_m1_leistung
                          secondary_info: {}
                          name: Waschmaschine
                          icon: mdi:washing-machine
                          color_icon: true
                          display_zero: false
                          display_zero_tolerance: 50
                          display_zero_state: true
                          show_direction: true
                          unit_white_space: true
                        - entity: sensor.steckdose_m2_leistung
                          secondary_info: {}
                          name: Wäschetrockner
                          icon: mdi:tumble-dryer
                          color_icon: true
                          display_zero: false
                          display_zero_tolerance: 50
                          display_zero_state: true
                          show_direction: true
                          unit_white_space: true
                        - entity: sensor.steckdose_m3_leistung
                          secondary_info: {}
                          name: Luftentfeuchter
                          icon: mdi:air-filter
                          color_icon: true
                          display_zero: false
                          display_zero_tolerance: 50
                          display_zero_state: true
                          show_direction: true
                          unit_white_space: true
                        - entity: sensor.steckdose_m4_leistung
                          secondary_info: {}
                          name: Gefrierschrank
                          icon: mdi:fridge-industrial
                          color_icon: true
                          display_zero: false
                          display_zero_tolerance: 50
                          display_zero_state: true
                          show_direction: true
                          unit_white_space: true
                        - entity: sensor.steckdose_m5_leistung
                          secondary_info: {}
                          name: PC Büro OG
                          icon: mdi:desktop-tower-monitor
                          color_icon: true
                          display_zero: false
                          display_zero_tolerance: 50
                          display_zero_state: true
                          show_direction: true
                          unit_white_space: true
                    display_zero_lines:
                      mode: show
                      transparency: 50
                      grey_color:
                        - 189
                        - 189
                        - 189
                    use_new_flow_rate_model: true
                    w_decimals: 0
                    kw_decimals: 1
                    clickable_entities: true
                    min_flow_rate: 0.75
                    max_flow_rate: 6
                    max_expected_power: 5000
                    min_expected_power: 0.01
                    watt_threshold: 1000
                    transparency_zero_lines: 0
                    card_mod:
                      style: |
                        ha-card {
                          border: none;
                        }
              - type: conditional
                conditions:
                  - condition: state
                    entity: binary_sensor.pv_online
                    state: 'off'
                card:
                  type: custom:decluttering-card
                  template: warning_template
                  variables:
                    - warning: PV-Anlage offline
          - type: custom:stack-in-card
            cards:
              - type: custom:decluttering-card
                template: title_mit_link_template
                variables:
                  - title: Wärmepumpe
                  - link_icon: mdi:chevron-right
                  - link: /lovelace/warmepumpe
              - type: custom:config-template-card
                entities:
                  - sensor.weishaupt_betriebsstatus_text_neu
                  - sensor.weishaupt_fehlerstatus
                  - sensor.weishaupt_leistungsanforderung
                card:
                  type: entities
                  entities:
                    - type: custom:template-entity-row
                      entity: sensor.weishaupt_betriebsstatus_text_neu
                      name: Betriebsmodus
                    - type: custom:template-entity-row
                      entity: sensor.weishaupt_fehlerstatus
                      secondary_info: none
                      name: Status
                      icon: >-
                        {% if states('sensor.weishaupt_stoerungsfrei') | int ==
                        1 %}
                          mdi:check-circle
                        {% else %}
                          mdi:alert-circle
                        {% endif %}
                      color: >-
                        {% if states('sensor.weishaupt_stoerungsfrei') |
                        default('0') | int == 1 %}
                          green
                        {% else %}
                          red
                        {% endif %}
                    - type: custom:template-entity-row
                      entity: sensor.weishaupt_leistungsanforderung
                      secondary_info: none
                      name: Leistungsanforderung
                      state: >-
                        {{ states('sensor.weishaupt_leistungsanforderung') }} {{
                        state_attr('sensor.weishaupt_leistungsanforderung',
                        'unit_of_measurement') }}        
                      icon: mdi:fire
                      color: >-
                        {% if states('sensor.weishaupt_leistungsanforderung') |
                        int > 0 %}
                          #CD5C5C
                        {% endif %}
                    - type: custom:template-entity-row
                      entity: sensor.weishaupt_warmwassertemperatur
                      secondary_info: none
                      name: Warmwasser
                      state: >-
                        {{ states('sensor.weishaupt_warmwassertemperatur') }} {{
                        state_attr('sensor.weishaupt_warmwassertemperatur',
                        'unit_of_measurement') }}        
                      color: >-
                        {% if states('sensor.weishaupt_betriebsstatus_text_neu')
                        | default(' ') == "WARMWASSERBETRIEB" %}
                          red
                        {% endif %}
              - type: conditional
                conditions:
                  - condition: state
                    entity: binary_sensor.weishaupt_online
                    state: 'off'
                card:
                  type: custom:decluttering-card
                  template: warning_template
                  variables:
                    - warning: Wärmepumpe offline
              - type: conditional
                conditions:
                  - condition: numeric_state
                    entity: sensor.weishaupt_stoerungsfrei
                    below: 1
                  - condition: numeric_state
                    entity: sensor.weishaupt_fehler_numerisch
                    below: 65535
                card:
                  type: custom:template-entity-row
                  entity: sensor.weishaupt_fehler_numerisch
                  name: Fehlercode
                  icon: mdi:alert
                  color: red
              - type: conditional
                conditions:
                  - condition: numeric_state
                    entity: sensor.weishaupt_stoerungsfrei
                    below: 1
                  - condition: numeric_state
                    entity: sensor.weishaupt_warnung_numerisch
                    below: 65535
                card:
                  type: custom:template-entity-row
                  entity: sensor.weishaupt_warnung_numerisch
                  name: Fehlercode
                  icon: mdi:alert
                  color: yellow
      - type: grid
        cards:
          - type: vertical-stack
            cards:
              - type: custom:bubble-card
                card_type: pop-up
                hash: '#wetterradar'
                name: Wetterradar
                icon: mdi:clouds
                show_header: true
                show_icon: true
                force_icon: false
                styles: |
                  .bubble-icon {
                    color: 
                      ${'lightblue'} !important}
                button_action: none
                width_desktop: 600px
              - type: iframe
                url: >-
                  https://radar.wo-cloud.com/mobile/embedded?wrx=50.783,6.083&wrm=8&wry=50.783,6.083
                aspect_ratio: 100%
                grid_options:
                  columns: full
                  rows: 7
            title: Wetterradar
    type: sections
    max_columns: 4
    cards: []
  - type: sections
    title: Szenarien
    path: szenen
    icon: mdi:mace
    sections:
      - type: grid
        cards:
          - type: custom:vertical-stack-in-card
            cards:
              - type: custom:decluttering-card
                template: title_template
                variables:
                  - title: Urlaubsmodus aktivieren
              - type: vertical-stack
                cards:
                  - type: custom:mushroom-template-card
                    primary: ''
                    multiline_secondary: true
                    secondary: >-
                      Im Urlaubsmodus werden alle Heizungsthermostate auf die
                      vorgegebene Solltemperatur eingestellt.
                    card_mod:
                      style: |
                        ha-card {
                          border: none;
                        }
                  - type: custom:mushroom-template-card
                    entity: input_boolean.urlaubsmodus_aktiv
                    primary: |-
                      {% set active_state=states(entity) %}
                      {% if active_state=='on'%}
                        Jetzt ist Urlaub !
                      {% else %}
                        Leider kein Urlaub
                      {% endif %}
                    icon: |-
                      {% set active_state=states(entity) %}
                      {% if active_state=='on'%}
                        mdi:emoticon-cool
                      {% else %}
                        mdi:emoticon-sad
                      {% endif %} 
                    tap_action:
                      action: toggle
                    icon_color: |-
                      {% set active_state=states(entity) %}
                      {% if active_state=='on'%}
                      yellow
                      {% endif %}
                    secondary: ''
                    card_mod:
                      style: |
                        ha-card {
                          --card-primary-color: {% if is_state(config.entity, 'on') %} yellow {% else %} white {% endif %};
                          --card-secondary-color: {% if is_state(config.entity, 'on') %} yellow {% else %} white {% endif %};
                          border: none;
                        }
                  - type: custom:mushroom-number-card
                    entity: input_number.raumtemperaturen_im_urlaub
                    name: Solltemperatur
                    layout: horizontal
                    icon_type: entity-picture
                    grid_options:
                      columns: 6
                      rows: 1
                    primary_info: name
                    secondary_info: state
                    display_mode: buttons
                    icon_color: 205,92,92
                    card_mod:
                      style: |
                        ha-card {
                          border: none;
                        }
              - type: heading
                icon: none
                heading: ''
                badges: []
      - type: grid
        cards:
          - type: custom:vertical-stack-in-card
            cards:
              - type: custom:decluttering-card
                template: title_template
                variables:
                  - title: Szenarien aktivieren
              - type: vertical-stack
                cards:
                  - type: custom:mushroom-template-card
                    primary: Rollläden nachts schließen
                    icon: mdi:window-shutter-auto
                    entity: input_boolean.rollladen_im_winter_nachts_schliessen
                    tap_action:
                      action: toggle
                    icon_color: |-
                      {% set active_state=states(entity) %}
                      {% if active_state=='on'%}
                      cyan
                      {% endif %}
                    secondary: |-
                      {% set active_state=states(entity) %}
                      {% if active_state=='on'%}
                      aktiv
                      {% else %}
                      nicht aktiviert
                      {% endif %}
                    card_mod:
                      style: |
                        ha-card {
                          border: none;
                          --card-primary-color: {% if is_state(config.entity, 'on') %} cyan {% else %} white {% endif %};
                          --card-secondary-color: {% if is_state(config.entity, 'on') %} cyan {% else %} white {% endif %};
                        }
                  - type: custom:mushroom-template-card
                    primary: Sonnenschutz Treppenhaus
                    icon: mdi:window-shutter-auto
                    entity: input_boolean.sonnenschutz_treppenhaus_aktivieren
                    tap_action:
                      action: toggle
                    icon_color: |-
                      {% set active_state=states(entity) %}
                      {% if active_state=='on'%}
                      yellow
                      {% endif %}
                    secondary: |-
                      {% set active_state=states(entity) %}
                      {% if active_state=='on'%}
                      aktiv
                      {% else %}
                      nicht aktiviert
                      {% endif %}
                    card_mod:
                      style: |
                        ha-card {
                          border: none;
                          --card-primary-color: {% if is_state(config.entity, 'on') %} yellow {% else %} white {% endif %};
                          --card-secondary-color: {% if is_state(config.entity, 'on') %} yellow {% else %} white {% endif %};
                        }
                  - type: custom:mushroom-template-card
                    primary: Sonnenschutz hinten oben
                    icon: mdi:window-shutter-auto
                    entity: input_boolean.sonnenschutz_hinten_oben_aktivieren
                    tap_action:
                      action: toggle
                    icon_color: |-
                      {% set active_state=states(entity) %}
                      {% if active_state=='on'%}
                      yellow
                      {% endif %}
                    secondary: |-
                      {% set active_state=states(entity) %}
                      {% if active_state=='on'%}
                      aktiv
                      {% else %}
                      nicht aktiviert
                      {% endif %}
                    card_mod:
                      style: |
                        ha-card {
                          border: none;
                          --card-primary-color: {% if is_state(config.entity, 'on') %} yellow {% else %} white {% endif %};
                          --card-secondary-color: {% if is_state(config.entity, 'on') %} yellow {% else %} white {% endif %};
                        }
                  - type: custom:mushroom-template-card
                    primary: Lampe Eingang
                    icon: mdi:outdoor-lamp
                    entity: input_boolean.lampe_eingang_aktivieren
                    tap_action:
                      action: toggle
                    icon_color: |-
                      {% set active_state=states(entity) %}
                      {% if active_state=='on'%}
                      orange
                      {% endif %}
                    secondary: |-
                      {% set active_state=states(entity) %}
                      {% if active_state=='on'%}
                      aktiv
                      {% else %}
                      nicht aktiviert
                      {% endif %}
                    card_mod:
                      style: |
                        ha-card {
                          border: none;
                          --card-primary-color: {% if is_state(config.entity, 'on') %} orange {% else %} white {% endif %};
                          --card-secondary-color: {% if is_state(config.entity, 'on') %} orange {% else %} white {% endif %};
                        }
                  - type: custom:mushroom-template-card
                    primary: Lichterketten vorne
                    icon: mdi:string-lights
                    entity: input_boolean.lichterketten_vorne_aktivieren
                    tap_action:
                      action: toggle
                    icon_color: |-
                      {% set active_state=states(entity) %}
                      {% if active_state=='on'%}
                      orange
                      {% endif %}
                    secondary: |-
                      {% set active_state=states(entity) %}
                      {% if active_state=='on'%}
                      aktiv
                      {% else %}
                      nicht aktiviert
                      {% endif %}
                    card_mod:
                      style: |
                        ha-card {
                          border: none;
                          --card-primary-color: {% if is_state(config.entity, 'on') %} orange {% else %} white {% endif %};
                          --card-secondary-color: {% if is_state(config.entity, 'on') %} orange {% else %} white {% endif %};
                        }
                  - type: custom:mushroom-template-card
                    primary: Fensterlampe im Büro OG
                    icon: mdi:lamp
                    entity: input_boolean.buro_og_lampe_fenster_aktivieren
                    tap_action:
                      action: toggle
                    icon_color: |-
                      {% set active_state=states(entity) %}
                      {% if active_state=='on'%}
                      orange
                      {% endif %}
                    secondary: |-
                      {% set active_state=states(entity) %}
                      {% if active_state=='on'%}
                      aktiv
                      {% else %}
                      nicht aktiviert
                      {% endif %}
                    card_mod:
                      style: |
                        ha-card {
                          border: none;
                          --card-primary-color: {% if is_state(config.entity, 'on') %} orange {% else %} white {% endif %};
                          --card-secondary-color: {% if is_state(config.entity, 'on') %} orange {% else %} white {% endif %};
                        }
                  - type: custom:mushroom-template-card
                    primary: Ambiantlicht abends
                    icon: mdi:lamps
                    entity: input_boolean.ambientlich_abends_einschalten
                    tap_action:
                      action: toggle
                    icon_color: |-
                      {% set active_state=states(entity) %}
                      {% if active_state=='on'%}
                      orange
                      {% endif %}
                    secondary: |-
                      {% set active_state=states(entity) %}
                      {% if active_state=='on'%}
                      aktiv
                      {% else %}
                      nicht aktiviert
                      {% endif %}
                    card_mod:
                      style: |
                        ha-card {
                          border: none;
                          --card-primary-color: {% if is_state(config.entity, 'on') %} orange {% else %} white {% endif %};
                          --card-secondary-color: {% if is_state(config.entity, 'on') %} orange {% else %} white {% endif %};
                        }
                  - type: custom:mushroom-template-card
                    primary: Lampignons Treppenhaus
                    icon: mdi:string-lights
                    entity: input_boolean.treppenhaus_lampignons_aktivieren
                    tap_action:
                      action: toggle
                    icon_color: |-
                      {% set active_state=states(entity) %}
                      {% if active_state=='on'%}
                      orange
                      {% endif %}
                    secondary: |-
                      {% set active_state=states(entity) %}
                      {% if active_state=='on'%}
                      aktiv
                      {% else %}
                      nicht aktiviert
                      {% endif %}
                    card_mod:
                      style: |
                        ha-card {
                          border: none;
                          --card-primary-color: {% if is_state(config.entity, 'on') %} orange {% else %} white {% endif %};
                          --card-secondary-color: {% if is_state(config.entity, 'on') %} orange {% else %} white {% endif %};
                        }
                  - type: custom:mushroom-template-card
                    primary: Gästezimmer heizen
                    icon: mdi:thermometer
                    entity: input_boolean.gastezimmer_heizen
                    tap_action:
                      action: toggle
                    icon_color: |-
                      {% set active_state=states(entity) %}
                      {% if active_state=='on'%}
                      205,92,92
                      {% endif %}
                    secondary: |-
                      {% set active_state=states(entity) %}
                      {% if active_state=='on'%}
                      aktiv
                      {% else %}
                      nicht aktiviert
                      {% endif %}
                    card_mod:
                      style: |
                        ha-card {
                          border: none;
                          --card-primary-color: {% if is_state(config.entity, 'on') %} #cd5c5c {% else %} white {% endif %};
                          --card-secondary-color: {% if is_state(config.entity, 'on') %} #cd5c5c {% else %} white {% endif %};
                        }
              - type: heading
                icon: none
                heading: ''
                badges: []
      - type: grid
        cards: []
      - type: grid
        cards: []
    cards: []
    max_columns: 4
  - type: sections
    max_columns: 4
    title: Geräte
    path: gerate
    icon: mdi:form-select
    sections:
      - type: grid
        cards:
          - type: heading
            icon: ''
            heading_style: title
          - type: custom:local-conditional-card
            id: lichter_1
            default: show
            card:
              type: custom:stack-in-card
              cards:
                - type: custom:decluttering-card
                  template: title_template
                  variables:
                    - title: Alle Lichter einzeln schalten
                - type: custom:auto-entities
                  card:
                    type: entities
                    title: ''
                    show_header_toggle: false
                    state_color: true
                  filter:
                    template: >-
                      {% set tokens = ['licht', 'lampe'] %} {% set
                      matching_labels = labels() | select('search', tokens |
                      join('|')) | list %} {% set devices = matching_labels |
                      map('label_devices') | sum(start=[]) | list %} {% set
                      entities = devices | map('device_entities') |
                      sum(start=[]) | list %} {% set filtered_entities =
                      entities | select('match', '^switch\.(?!.*_vch[0-9]+).*')
                      | list %}

                      [{% for entity in filtered_entities %} {"entity": "{{
                      entity }}", "name": "{{
                      label_name(labels(device_id(entity))[0]) }}"}{% if not
                      loop.last %}, {% endif %}    {% endfor %}]
              visibility:
                - condition: state
                  entity: input_select.dashboardauswahl
                  state: Licht
            persist_state: false
          - type: custom:local-conditional-card
            id: rollladen_1
            default: hide
            card:
              type: custom:stack-in-card
              cards:
                - type: custom:decluttering-card
                  template: title_template
                  variables:
                    - title: Alle Rollläden einzeln bedienen
                - type: custom:auto-entities
                  card:
                    type: entities
                    title: ''
                    show_header_toggle: false
                    state_color: true
                  filter:
                    template: >-
                      {% set tokens = ['rollladen'] %} {% set matching_labels =
                      labels() | select('search', tokens | join('|')) | list %}
                      {% set devices = matching_labels | map('label_devices') |
                      sum(start=[]) | list %} {% set entities = devices |
                      map('device_entities') | sum(start=[]) | list %} {% set
                      filtered_entities = entities | select('match',
                      '^cover\.(?!.*_vch[0-9]+).*') | list %}

                      [{% for entity in filtered_entities %} {"entity": "{{
                      entity }}", "name": "{{
                      label_name(labels(device_id(entity))[0]) }}"}{% if not
                      loop.last %}, {% endif %}    {% endfor %}]
              visibility:
                - condition: state
                  entity: input_select.dashboardauswahl
                  state: Rollläden
          - type: custom:local-conditional-card
            id: klima_1
            default: hide
            card:
              type: custom:stack-in-card
              cards:
                - type: custom:decluttering-card
                  template: title_template
                  variables:
                    - title: Wetterstation
                - type: grid
                  columns: 2
                  square: false
                  cards:
                    - type: tile
                      entity: sensor.wetterstation_temperatur
                      name: Temperatur
                      color: red
                      card_mod:
                        style: |
                          ha-card {
                            border: none;
                          }
                    - type: tile
                      entity: sensor.wetterstation_luftfeuchtigkeit
                      name: Feuchtigkeit
                      color: blue
                      card_mod:
                        style: |
                          ha-card {
                            border: none;
                          }
                    - type: tile
                      entity: sensor.wetterstation_beleuchtungsstarke
                      name: Helligkeit
                      color: accent
                      card_mod:
                        style: |
                          ha-card {
                            border: none;
                          }
                    - type: tile
                      entity: sensor.wetterstation_sonnenscheindauer_heute
                      name: Sonnenstunden
                      color: accent
                      card_mod:
                        style: |
                          ha-card {
                            border: none;
                          }
                    - type: tile
                      entity: sensor.wetterstation_windgeschwindigkeit
                      name: Wind
                      color: cyan
                      card_mod:
                        style: |
                          ha-card {
                            border: none;
                          }
                - type: heading
                  icon: none
                  heading: ''
                  badges: []
              visibility:
                - condition: state
                  entity: input_select.dashboardauswahl
                  state: Klima
      - type: grid
        cards:
          - type: heading
            icon: ''
            heading_style: title
          - type: custom:local-conditional-card
            id: lichter_2
            default: show
            card:
              type: custom:stack-in-card
              cards:
                - type: custom:decluttering-card
                  template: title_template
                  variables:
                    - title: Zeitplaner Beleuchtung
                - type: custom:scheduler-card
                  include:
                    - input_boolean
                    - switch
                  exclude: []
                  grid_options:
                    columns: 12
                    rows: auto
                  title: ''
                  sort_by:
                    - title
                  display_options:
                    primary_info: default
                    secondary_info:
                      - time
                    icon: entity
                  discover_existing: false
              visibility:
                - condition: state
                  entity: input_select.dashboardauswahl
                  state: Licht
            persist_state: false
          - type: custom:local-conditional-card
            id: rollladen_2
            default: hide
            card:
              type: custom:stack-in-card
              cards:
                - type: custom:decluttering-card
                  template: title_template
                  variables:
                    - title: Zeitplaner Rollläden
                - type: custom:scheduler-card
                  include:
                    - cover
                    - input_boolean
                  exclude: []
                  title: ''
                  sort_by:
                    - title
                  display_options:
                    primary_info: default
                    secondary_info:
                      - time
                    icon: action
                  discover_existing: false
              visibility:
                - condition: state
                  entity: input_select.dashboardauswahl
                  state: Rollläden
          - type: custom:local-conditional-card
            id: klima_2
            default: hide
            card:
              type: custom:stack-in-card
              cards:
                - type: custom:decluttering-card
                  template: title_template
                  variables:
                    - title: Thermostateinstellungen
                - type: custom:decluttering-card
                  template: subtitle_ohne_badges__template
                  variables:
                    - subtitle: Erdgeschoß
                    - icon: mdi:sofa
                - type: grid
                  columns: 2
                  square: false
                  cards:
                    - type: custom:decluttering-card
                      template: climate_template
                      variables:
                        - name: Wohnzimmer
                        - entity: climate.heizung_wohnzimmer_int0000007
                    - type: custom:decluttering-card
                      template: climate_template
                      variables:
                        - name: Küche
                        - entity: climate.heizung_kuche_int0000008
                    - type: custom:decluttering-card
                      template: climate_template
                      variables:
                        - name: Flur
                        - entity: climate.heizung_duschbad_int0000004
                  card_mod:
                    style: |
                      :host {
                        --grid-card-gap: 4px !important;
                      }
                - type: custom:decluttering-card
                  template: subtitle_ohne_badges__template
                  variables:
                    - subtitle: Obergeschoß
                    - icon: mdi:sofa
                - type: grid
                  columns: 2
                  square: false
                  cards:
                    - type: custom:decluttering-card
                      template: climate_template
                      variables:
                        - name: Büro OG
                        - entity: climate.heizung_buro_og_int0000002
                    - type: custom:decluttering-card
                      template: climate_template
                      variables:
                        - name: Gästezimmer
                        - entity: climate.heizung_gastezimmer_int0000001
                    - type: custom:decluttering-card
                      template: climate_template
                      variables:
                        - name: Duschbad
                        - entity: climate.heizung_duschbad_int0000004
                    - type: custom:decluttering-card
                      template: climate_template
                      variables:
                        - name: Bad
                        - entity: climate.heizung_bad_int0000005
                    - type: custom:decluttering-card
                      template: climate_template
                      variables:
                        - name: Schlafzimmer
                        - entity: climate.heizug_schlafzimmer_int0000003
                - type: heading
                  icon: none
                  heading: ''
                  badges: []
              visibility:
                - condition: state
                  entity: input_select.dashboardauswahl
                  state: Klima
      - type: grid
        cards:
          - type: heading
            icon: ''
            heading_style: title
          - type: custom:local-conditional-card
            id: klima_3
            default: hide
            card:
              type: custom:stack-in-card
              cards:
                - type: custom:decluttering-card
                  template: title_template
                  variables:
                    - title: Zeitplaner Raumtemperaturen
                - type: custom:scheduler-card
                  include:
                    - climate
                    - input_boolean
                  exclude: []
                  title: ''
                  sort_by:
                    - title
                  display_options:
                    primary_info: default
                    secondary_info:
                      - time
                    icon: action
                  discover_existing: false
              visibility:
                - condition: state
                  entity: input_select.dashboardauswahl
                  state: Klima
      - type: grid
        cards:
          - type: heading
            icon: ''
            heading_style: title
    cards: []
    subview: false
    badges:
      - type: custom:mushroom-template-badge
        content: Lichter
        icon: mdi:home-lightbulb-outline
        color: yellow
        label: ''
        entity: input_select.dashboardauswahl
        tap_action:
          action: fire-dom-event
          local_conditional_card:
            action: set
            ids:
              - lichter_1: show
              - lichter_2: show
              - rollladen_1: hide
              - rollladen_2: hide
              - klima_1: hide
              - klima_2: hide
              - klima_3: hide
        hold_action:
          action: none
        double_tap_action:
          action: none
      - type: custom:mushroom-template-badge
        content: Rollläden
        icon: mdi:window-shutter
        color: cyan
        tap_action:
          action: fire-dom-event
          local_conditional_card:
            action: set
            ids:
              - lichter_1: hide
              - lichter_2: hide
              - rollladen_1: show
              - rollladen_2: show
              - klima_1: hide
              - klima_2: hide
              - klima_3: hide
        hold_action:
          action: none
        double_tap_action:
          action: none
      - type: custom:mushroom-template-badge
        content: Klima
        icon: mdi:home-thermometer
        color: red
        tap_action:
          action: fire-dom-event
          local_conditional_card:
            action: set
            ids:
              - lichter_1: hide
              - lichter_2: hide
              - rollladen_1: hide
              - rollladen_2: hide
              - klima_1: show
              - klima_2: show
              - klima_3: show
        hold_action:
          action: none
        double_tap_action:
          action: none
    header:
      card:
        type: markdown
        text_only: true
        content: |
          # Bitte den Bereich auswählen
  - type: sections
    max_columns: 4
    title: Check
    path: check
    icon: mdi:home-search-outline
    sections:
      - type: grid
        cards:
          - type: custom:stack-in-card
            cards:
              - type: custom:decluttering-card
                template: title_mit_link_template
                variables:
                  - title: Batteriestatus
                  - link_icon: mdi:chevron-right
                  - link: '#suche_gerate_mit_batterie'
              - type: custom:battery-state-card
                secondary_info: '{attributes.battery_type_and_quantity}'
                round: 0
                collapse: 5
                entities:
                  - entity: binary_sensor.kuche_schalter_rollladen_battery_plus_low
                    name: Küche Schalter Rollladen
                    tap_action:
                      action: navigate
                      navigation_path: '#kuche_schalter_rollladen_batterie'
                  - entity: binary_sensor.buro_kg_thermostat_battery_plus_low
                    name: Büro KG Thermostat
                    tap_action:
                      action: navigate
                      navigation_path: '#buro_kg_thermostat_batterie'
                  - entity: binary_sensor.wetterstation_battery_plus_low
                    name: Wetterstation
                    tap_action:
                      action: navigate
                      navigation_path: '#wetterstation_batterie'
                filter:
                  include:
                    - name: entity_id
                      value: '*_battery_plus'
                    - name: entity_id
                      value: '*_battery_plus_low'
                  exclude: []
                sort:
                  by: state
                  desc: false
                state_map:
                  - from: 'off'
                    to: 80
                  - from: 'on'
                    to: 10
                bulk_rename:
                  - from: ' Akku fast leer'
                  - from: ' Batterie'
                  - from: ' Battery'
                  - from: ' level'
                colors:
                  steps:
                    - '#ff0000'
                    - '#ffff00'
                    - '#00ff00'
                  gradient: true
              - type: heading
                icon: none
                heading: ''
                badges:
                  - type: custom:mushroom-template-badge
                    content: Suche
                    icon: mdi:magnify
                    tap_action:
                      action: navigate
                      navigation_path: '#suche_gerate_mit_batterie'
                    hold_action:
                      action: none
                    double_tap_action:
                      action: none
          - type: custom:vertical-stack-in-card
            cards:
              - type: custom:decluttering-card
                template: title_template
                variables:
                  - title: Energieverbraucher
              - type: entities
                entities:
                  - entity: sensor.leistungsaufnahme_weishaupt_warmepumpe
                    name: Wärmepumpe
                  - entity: sensor.leistungsaufnahme_weishaupt_e_heizung
                    name: E-Heizung
                  - entity: sensor.leistungsaufnahme_ladestation
                    name: Ladestation
                  - entity: sensor.leistungsaufnahme_e_herd
                    name: E-Herd
                  - entity: sensor.steckdose_m1_leistung
                    name: Waschmaschine
                  - entity: sensor.steckdose_m2_leistung
                    name: Wäschetrockner
                  - entity: sensor.steckdose_m3_leistung
                    name: Luftentfeuchter
                  - entity: sensor.steckdose_m4_leistung
                    name: Gefrierschrank
                  - entity: sensor.steckdose_m5_leistung
                    name: PC Büro OG
      - type: grid
        cards:
          - type: custom:vertical-stack-in-card
            cards:
              - type: custom:decluttering-card
                template: title_template
                variables:
                  - title: Rollladenbewegungen in 4 Tagen
              - type: custom:auto-entities
                card:
                  type: entities
                filter:
                  include:
                    - entity_id: sensor.*rollladen_position*
                      options:
                        type: custom:mini-graph-card
                        smoothing: false
                        line_width: 2
                        hour24: true
                        points_per_hour: 5
                        hours_to_show: 96
                        height: 50
                        show:
                          icon: null
                          state: false
                          graph: true
                          show_points: false
                        entities:
                          - this.entity_id
      - type: grid
        cards:
          - type: custom:vertical-stack-in-card
            cards:
              - type: custom:decluttering-card
                template: title_template
                variables:
                  - title: Lichter in 4 Tagen
              - type: history-graph
                title: Wohnzimmer
                hours_to_show: 96
                entities:
                  - entity: switch.steckdose_7
                    name: Lichterkette
                  - entity: switch.wohnzimmer_ambientlicht
                    name: Ambiente
              - type: history-graph
                title: Büro OG
                hours_to_show: 96
                entities:
                  - entity: switch.steckdose_4
                    name: Lampe Fenster
              - type: history-graph
                title: Draußen
                hours_to_show: 96
                entities:
                  - entity: switch.lichterketten_vorne
                    name: Lichterketten vorne
                  - entity: switch.eingang_schalter_ausenlicht
                    name: Licht Eingang
              - type: heading
                icon: none
                heading: ''
                badges: []
      - type: grid
        cards:
          - type: custom:vertical-stack-in-card
            cards:
              - type: custom:decluttering-card
                template: title_template
                variables:
                  - title: Beobachtungen in 2 Tagen
              - type: history-graph
                title: Waschmaschine
                entities:
                  - entity: input_boolean.waschmaschine_lauft
                    name: Läuft
                hours_to_show: 48
              - type: history-graph
                title: Trockner
                hours_to_show: 48
                entities:
                  - entity: input_boolean.waschetrockner_lauft
                    name: Läuft
              - type: history-graph
                title: Luftentfeuchter
                hours_to_show: 48
                entities:
                  - entity: switch.steckdose_m3
                    name: Läuft
                  - entity: binary_sensor.buro_kg_behalter_luftentfeuchter_voll
                    name: Behälter voll
              - type: heading
                icon: none
                heading: ''
                badges: []
      - type: grid
        cards:
          - type: vertical-stack
            cards:
              - type: custom:bubble-card
                card_type: pop-up
                hash: '#suche_gerate_mit_batterie'
                name: Gefundene Geräte mit Batterien
                icon: mdi:battery-70
                show_header: true
                show_icon: true
                force_icon: false
                styles: |
                  .bubble-icon {
                    color: 
                      ${'darkorange'} !important}
                button_action:
                  tap_action:
                    action: navigate
                    navigation_path: >-
                      /config/devices/dashboard?historyBack=1&domain=battery_notes
              - type: custom:stack-in-card
                cards:
                  - type: custom:auto-entities
                    card:
                      type: entities
                      title: ''
                      show_header_toggle: false
                      state_color: true
                    filter:
                      template: >-
                        {{ state_attr('sensor.battery_devices', 'entities')
                        }}          
                      exclude: []
                    sort:
                      method: state
                      numeric: true
              - type: custom:stack-in-card
                cards:
                  - type: custom:mushroom-template-card
                    primary: ''
                    multiline_secondary: true
                    secondary: >-
                      Um neue Geräte im Dashboard anzuzeigen, müssen diese in
                      Battery Notes hinzugefügt werden.
                    card_mod:
                      style: |
                        ha-card {
                          border: none;
                        }
                  - type: heading
                    icon: none
                    heading_style: title
                    heading: ''
                    badges:
                      - type: custom:mushroom-template-badge
                        content: Hinzufügen
                        icon: mdi:chevron-right
                        color: white
                        tap_action:
                          action: navigate
                          navigation_path: >-
                            /config/devices/dashboard?historyBack=1&domain=battery_notes
                        hold_action:
                          action: none
                        double_tap_action:
                          action: none
            title: Suche Geräte mit Batterie
          - type: vertical-stack
            cards:
              - type: custom:bubble-card
                card_type: pop-up
                hash: '#kuche_schalter_rollladen_batterie'
                name: Batterieinfo
                icon: mdi:battery-70
                show_header: true
                show_icon: true
                force_icon: false
                styles: |
                  .bubble-icon {
                    color: 
                      ${'darkorange'} !important}
              - type: custom:stack-in-card
                cards:
                  - type: vertical-stack
                    cards:
                      - type: tile
                        entity: >-
                          binary_sensor.kuche_schalter_rollladen_battery_plus_low
                        card_mod:
                          style: |
                            ha-card {
                              border: none;
                            }
                      - type: tile
                        entity: binary_sensor.kuche_schalter_rollladen_batterie
                        card_mod:
                          style: |
                            ha-card {
                              border: none;
                            }
                      - type: tile
                        entity: sensor.kuche_schalter_rollladen_battery_last_replaced
                        card_mod:
                          style: |
                            ha-card {
                              border: none;
                            }
                      - type: tile
                        entity: sensor.kuche_schalter_rollladen_battery_type
                        card_mod:
                          style: |
                            ha-card {
                              border: none;
                            }
                      - type: tile
                        entity: sensor.kuche_schalter_rollladen_betriebsspannung
                        tap_action:
                          action: more-info
                        hold_action:
                          action: more-info
                        card_mod:
                          style: |
                            ha-card {
                              border: none;
                            }
            title: ''
          - type: vertical-stack
            cards:
              - type: custom:bubble-card
                card_type: pop-up
                hash: '#buro_kg_thermostat_batterie'
                name: Batterieinfo
                icon: mdi:battery-70
                show_header: true
                show_icon: true
                force_icon: false
                styles: |
                  .bubble-icon {
                    color: 
                      ${'darkorange'} !important}
              - type: custom:stack-in-card
                cards:
                  - type: vertical-stack
                    cards:
                      - type: tile
                        entity: binary_sensor.buro_kg_thermostat_battery_plus_low
                        card_mod:
                          style: |
                            ha-card {
                              border: none;
                            }
                      - type: tile
                        entity: binary_sensor.buro_kg_thermostat_batterie
                        card_mod:
                          style: |
                            ha-card {
                              border: none;
                            }
                      - type: tile
                        entity: sensor.buro_kg_thermostat_battery_last_replaced
                        card_mod:
                          style: |
                            ha-card {
                              border: none;
                            }
                      - type: tile
                        entity: sensor.buro_kg_thermostat_battery_type
                        card_mod:
                          style: |
                            ha-card {
                              border: none;
                            }
                      - type: tile
                        entity: lock.buro_kg_thermostat_bediensperre
                        tap_action:
                          action: toggle
                        hold_action:
                          action: more-info
                        card_mod:
                          style: |
                            ha-card {
                              border: none;
                            }
                      - type: tile
                        entity: select.buro_kg_thermostat_betriebsmodus_ch1
                        tap_action:
                          action: more-info
                        hold_action:
                          action: more-info
                        card_mod:
                          style: |
                            ha-card {
                              border: none;
                            }
                      - type: tile
                        entity: sensor.buro_kg_thermostat_betriebsspannung
                        tap_action:
                          action: more-info
                        hold_action:
                          action: more-info
                        card_mod:
                          style: |
                            ha-card {
                              border: none;
                            }
            title: ''
          - type: vertical-stack
            cards:
              - type: custom:bubble-card
                card_type: pop-up
                hash: '#wetterstation_batterie'
                name: Batterieinfo
                icon: mdi:battery-70
                show_header: true
                show_icon: true
                force_icon: false
                styles: |
                  .bubble-icon {
                    color: 
                      ${'darkorange'} !important}
              - type: custom:stack-in-card
                cards:
                  - type: vertical-stack
                    cards:
                      - type: tile
                        entity: binary_sensor.wetterstation_battery_plus_low
                        card_mod:
                          style: |
                            ha-card {
                              border: none;
                            }
                      - type: tile
                        entity: binary_sensor.wetterstation_batterie
                        card_mod:
                          style: |
                            ha-card {
                              border: none;
                            }
                      - type: tile
                        entity: sensor.wetterstation_battery_last_replaced
                        card_mod:
                          style: |
                            ha-card {
                              border: none;
                            }
                      - type: tile
                        entity: sensor.wetterstation_battery_type
                        card_mod:
                          style: |
                            ha-card {
                              border: none;
                            }
            title: ''
    cards: []
  - type: sections
    max_columns: 4
    title: Wärmepumpe
    path: warmepumpe
    icon: mdi:heat-wave
    sections:
      - type: grid
        cards:
          - type: conditional
            conditions:
              - condition: state
                entity: binary_sensor.weishaupt_online
                state: 'off'
            card:
              type: custom:decluttering-card
              template: warning_template
              variables:
                - warning: Wärmepumpe offline
          - type: custom:vertical-stack-in-card
            cards:
              - type: custom:decluttering-card
                template: title_template
                variables:
                  - title: Einstellungen
              - type: grid
                columns: 1
                square: false
                cards:
                  - type: custom:mushroom-select-card
                    entity: input_select.weishaupt_system_betriebsart
                    name: System-Betriebsart
                    grid_options:
                      columns: full
                    secondary_info: none
                    layout: horizontal
                    card_mod:
                      style: |
                        ha-card {
                          border: none;
                          margin-right: 10px !important;
                        }
                  - type: custom:mushroom-climate-card
                    entity: climate.weishaupt_warmwasser_solltemperatur
                    collapsible_controls: true
                    layout: horizontal
                    show_temperature_control: true
                    hvac_modes: []
                    secondary_info: none
                    name: WW Solltemperatur
                    icon: mdi:thermometer
                    icon_color: red
                    tap_action:
                      action: more-info
                    card_mod:
                      style: |
                        ha-card {
                          border: none;
                          margin-right: 10px !important;
                        }
          - type: custom:vertical-stack-in-card
            cards:
              - type: custom:decluttering-card
                template: title_template
                variables:
                  - title: Betriebsmodus
              - type: custom:config-template-card
                entities:
                  - sensor.weishaupt_betriebsstatus_text_neu
                  - sensor.weishaupt_fehlerstatus
                  - sensor.weishaupt_leistungsanforderung
                card:
                  type: entities
                  entities:
                    - type: custom:template-entity-row
                      entity: sensor.weishaupt_betriebsstatus_text_neu
                      name: Betriebsmodus
                    - type: custom:template-entity-row
                      entity: sensor.weishaupt_fehlerstatus
                      secondary_info: none
                      name: Status
                      icon: >-
                        {% if states('sensor.weishaupt_stoerungsfrei') | int ==
                        1 %}
                          mdi:check-circle
                        {% else %}
                          mdi:alert-circle
                        {% endif %}
                      color: >-
                        {% if states('sensor.weishaupt_stoerungsfrei') |
                        default('0') | int == 1 %}
                          green
                        {% else %}
                          red
                        {% endif %}
                    - type: custom:template-entity-row
                      entity: sensor.weishaupt_leistungsanforderung
                      secondary_info: none
                      name: Leistungsanforderung
                      state: >-
                        {{ states('sensor.weishaupt_leistungsanforderung') }} {{
                        state_attr('sensor.weishaupt_leistungsanforderung',
                        'unit_of_measurement') }}        
                      icon: mdi:fire
                      color: >-
                        {% if states('sensor.weishaupt_leistungsanforderung') |
                        int > 0 %}
                          #CD5C5C
                        {% endif %}
                    - type: custom:template-entity-row
                      entity: sensor.weishaupt_warmwassertemperatur
                      secondary_info: none
                      name: Warmwasser
                      state: >-
                        {{ states('sensor.weishaupt_warmwassertemperatur') }} {{
                        state_attr('sensor.weishaupt_warmwassertemperatur',
                        'unit_of_measurement') }}        
                      color: >-
                        {% if states('sensor.weishaupt_betriebsstatus_text_neu')
                        | default(' ') | int == "WARMWASSERBETRIEB" %}
                          red
                        {% else %}
                          white
                        {% endif %}
              - type: conditional
                conditions:
                  - condition: numeric_state
                    entity: sensor.weishaupt_stoerungsfrei
                    below: 1
                  - condition: numeric_state
                    entity: sensor.weishaupt_fehler_numerisch
                    below: 65535
                card:
                  type: custom:template-entity-row
                  entity: sensor.weishaupt_fehler_numerisch
                  name: Fehlercode
                  icon: mdi:alert
                  color: red
              - type: conditional
                conditions:
                  - condition: numeric_state
                    entity: sensor.weishaupt_stoerungsfrei
                    below: 1
                  - condition: numeric_state
                    entity: sensor.weishaupt_warnung_numerisch
                    below: 65535
                card:
                  type: custom:template-entity-row
                  entity: sensor.weishaupt_warnung_numerisch
                  name: Fehlercode
                  icon: mdi:alert
                  color: yellow
      - type: grid
        cards:
          - type: custom:vertical-stack-in-card
            cards:
              - type: custom:decluttering-card
                template: title_template
                variables:
                  - title: Betriebsdaten
              - type: entities
                entities:
                  - entity: sensor.weishaupt_aussentemperatur
                    name: Außentemperatur
                  - entity: sensor.weishaupt_warmwassertemperatur
                    name: Warmwasser
                  - entity: sensor.weishaupt_vorlauftemperatur
                    name: Vorlauf
                  - entity: sensor.weishaupt_ruecklauftemperatur
                    name: Rücklauf
                  - entity: sensor.weishaupt_leistungsanforderung
                    name: Leistungsanforderung
                    icon: mdi:fire
                  - entity: sensor.leistungsaufnahme_weishaupt_warmepumpe
                    name: El. Leistung gesamt
      - type: grid
        cards:
          - type: custom:vertical-stack-in-card
            cards:
              - type: custom:decluttering-card
                template: title_template
                variables:
                  - title: Energien (Tag)
              - type: entities
                entities:
                  - entity: sensor.weishaupt_energie_gesamt_heute
                    name: therm. Energie gesamt Tag
                  - entity: sensor.weishaupt_energie_heizen_heute
                    name: therm. Energie Heizen Tag
                  - entity: sensor.weishaupt_energie_wasser_heute
                    name: therm. Energie Wasser Tag
                  - entity: sensor.weishaupt_elektrische_energie_gesamt_heute
                    name: el. Energie gesamt Tag
          - type: custom:vertical-stack-in-card
            cards:
              - type: custom:decluttering-card
                template: title_template
                variables:
                  - title: Energien (Monat)
              - type: entities
                entities:
                  - entity: sensor.weishaupt_energie_gesamt_monat
                    name: therm. Energie gesamt Monat
                  - entity: sensor.weishaupt_energie_heizen_monat
                    name: therm. Energie Heizen Monat
                  - entity: sensor.weishaupt_energie_wasser_monat
                    name: therm. Energie Wasser Monat
                  - entity: sensor.weishaupt_elektrische_energie_gesamt_monat
                    name: el. Energie gesamt Monat
          - type: custom:vertical-stack-in-card
            cards:
              - type: custom:decluttering-card
                template: title_template
                variables:
                  - title: Energien (Jahr)
              - type: entities
                entities:
                  - entity: sensor.weishaupt_energie_gesamt_jahr
                    name: therm. Energie gesamt Jahr
                  - entity: sensor.weishaupt_energie_heizen_jahr
                    name: therm. Energie Heizen Jahr
                  - entity: sensor.weishaupt_energie_wasser_jahr
                    name: therm. Energie Wasser Jahr
                  - entity: sensor.weishaupt_elektrische_energie_gesamt_jahr
                    name: el. Energie gesamt Jahr
      - type: grid
        cards:
          - type: history-graph
            entities:
              - entity: sensor.weishaupt_betriebsstatus_text_neu
                name: ' '
            title: Betriebsmodus 24h
            hours_to_show: 24
          - type: history-graph
            entities:
              - entity: sensor.weishaupt_betriebsstatus_text_neu
                name: ' '
            title: Betriebsmodus 4h
            hours_to_show: 4
          - type: history-graph
            entities:
              - entity: sensor.leistungsaufnahme_weishaupt_warmepumpe
                name: ' '
            title: Leistungsaufnahme 4h
            hours_to_show: 4
            max_y_axis: 3
            fit_y_data: true
            grid_options:
              columns: 12
              rows: 4
    badges:
      - type: entity
        show_name: true
        show_state: true
        show_icon: true
        entity: sensor.weishaupt_aussentemperatur
        color: ''
      - type: entity
        show_name: true
        show_state: true
        show_icon: true
        entity: sensor.weishaupt_betriebsstatus_text_neu
        color: ''
        name: Modus
        icon: mdi:heat-wave
      - type: entity
        show_name: true
        show_state: true
        show_icon: true
        entity: sensor.weishaupt_warmwassertemperatur
        color: purple
        name: Warmwasser
        icon: mdi:thermometer-water
      - type: entity
        show_name: true
        show_state: true
        show_icon: true
        entity: sensor.weishaupt_fehler_numerisch
        color: red
        icon: mdi:alert-circle
        name: Fehlercode
        visibility:
          - condition: numeric_state
            entity: sensor.weishaupt_stoerungsfrei
            below: 1
          - condition: numeric_state
            entity: sensor.weishaupt_fehler_numerisch
            below: 65535
      - type: entity
        show_name: true
        show_state: true
        show_icon: true
        entity: sensor.weishaupt_warnung_numerisch
        color: amber
        name: Warnungscode
        icon: mdi:alert-circle
        visibility:
          - condition: numeric_state
            entity: sensor.weishaupt_stoerungsfrei
            below: 1
          - condition: numeric_state
            entity: sensor.weishaupt_warnung_numerisch
            below: 65535
      - type: custom:mushroom-template-badge
        content: Wärmepumpe offline
        icon: mdi:alarm-light
        color: red
        entity: binary_sensor.weishaupt_online
        visibility:
          - condition: state
            entity: binary_sensor.weishaupt_online
            state: 'off'
    cards: []
