views:
  - theme: Backend-selected
    title: Ventilatie
    path: ventilatie
    icon: mdi:fan
    type: custom:vertical-layout
    badges: []
    cards:
      - type: entities
        entities:
          - entity: sensor.sensor_dantherm_current_unit_mode_labels
            name: Modus
            icon: mdi:power-settings
          - entity: sensor.sensor_dantherm_bypass_state_labels
            name: Bypassmodus
            icon: mdi:swap-horizontal-bold
        title: Dantherm Ventilatie
      - type: conditional
        conditions:
          - entity: input_boolean.dantherm_alarm_active
            state: 'on'
        card:
          type: entities
          entities:
            - entity: sensor.sensor_dantherm_active_alarm_labels
              name: ' '
              icon: mdi:fan-alert
              secondary_info: last-updated
              tap_action:
                action: null
            - type: button
              name: Reset foutmelding
              icon: mdi:alert-remove
              tap_action:
                action: call-service
                confirmation:
                  text: Ben je zeker dat je deze fout wil resetten?
                service: script.dantherm_alarm_reset
          title: Systeemfout
          show_header_toggle: false
          card_mod:
            style: |
              ha-card {
                background: #ff000020;
              }
      - type: custom:vertical-stack-in-card
        cards:
          - square: true
            columns: 4
            type: grid
            cards:
              - show_name: false
                show_icon: true
                type: button
                tap_action:
                  action: call-service
                  service: script.dantherm_manual_mode
                  data: {}
                  target: {}
                entity: input_boolean.dantherm_manual_mode
                show_state: false
                hold_action:
                  action: none
              - show_name: false
                show_icon: true
                type: button
                tap_action:
                  action: call-service
                  service: script.dantherm_demand_mode
                  data: {}
                  target: {}
                entity: input_boolean.dantherm_demand_mode
                hold_action:
                  action: none
              - show_name: false
                show_icon: true
                type: button
                tap_action:
                  action: call-service
                  service: script.dantherm_week_program_mode
                  data: {}
                  target: {}
                entity: input_boolean.dantherm_week_program_mode
                hold_action:
                  action: none
                icon: ''
                show_state: false
              - show_name: false
                show_icon: true
                type: button
                tap_action:
                  action: toggle
                entity: input_boolean.dantherm_manual_bypass
                hold_action:
                  action: none
                show_state: false
      - type: custom:vertical-stack-in-card
        cards:
          - square: true
            columns: 4
            type: grid
            cards:
              - show_name: false
                show_icon: true
                type: button
                tap_action:
                  action: toggle
                entity: input_boolean.dantherm_night_mode
                hold_action:
                  action: none
                icon: ''
                show_state: false
              - show_name: false
                show_icon: true
                type: button
                tap_action:
                  action: toggle
                entity: input_boolean.dantherm_fireplace_mode
                show_state: false
                hold_action:
                  action: none
              - show_name: false
                show_icon: true
                type: button
                tap_action:
                  action: toggle
                entity: input_boolean.dantherm_summer_mode
                hold_action:
                  action: none
              - show_name: false
                show_icon: true
                type: button
                tap_action:
                  action: toggle
                entity: input_boolean.dantherm_away_mode
                hold_action:
                  action: none
      - type: custom:vertical-stack-in-card
        cards:
          - square: true
            columns: 4
            type: grid
            cards:
              - show_name: false
                type: button
                tap_action:
                  action: call-service
                  service: script.dantherm_fan_speed_1
                  data: {}
                  target: {}
                entity: input_boolean.dantherm_fan_speed_1
                hold_action:
                  action: none
              - show_name: false
                type: button
                tap_action:
                  action: call-service
                  service: script.dantherm_fan_speed_2
                  data: {}
                  target: {}
                entity: input_boolean.dantherm_fan_speed_2
                hold_action:
                  action: none
              - show_name: false
                type: button
                tap_action:
                  action: call-service
                  service: script.dantherm_fan_speed_3
                  data: {}
                  target: {}
                entity: input_boolean.dantherm_fan_speed_3
                hold_action:
                  action: none
              - show_name: false
                type: button
                tap_action:
                  action: call-service
                  service: script.dantherm_fan_speed_4
                  data: {}
                  target: {}
                entity: input_boolean.dantherm_fan_speed_4
                hold_action:
                  action: none
      - type: entities
        entities:
          - entity: sensor.dantherm_fan1_rpm
            name: Ventilator 1 (extractie)
          - entity: sensor.dantherm_fan2_rpm
            name: Ventilator 2 (toevoer)
          - type: section
          - entity: sensor.dantherm_extract_temperature
            name: Extractie Temperatuur
          - entity: sensor.dantherm_supply_temperature
            name: Aanlever Temperatuur
          - entity: sensor.dantherm_exhaust_temperature
            name: Uitlaat Temperatuur
          - entity: sensor.dantherm_outdoor_temperature
            name: Buiten Temperatuur
          - entity: sensor.dantherm_rh_sensor
            name: Luchtvochtigheid
          - type: section
            label: Filter
          - entity: sensor.dantherm_remaining_filter_lifetime
            name: Levensduur
          - entity: script.dantherm_reset_filter_lifetime
            name: Reset Filter
          - type: section
            label: Nachtmodus
          - entity: input_datetime.dantherm_night_mode_start
            name: Start
          - entity: input_datetime.dantherm_night_mode_end
            name: Stop
      - type: custom:apexcharts-card
        header:
          show: true
          show_states: false
        series:
          - entity: sensor.dantherm_extract_temperature
            name: Extractie
            stroke_width: 2
            fill_raw: last
            float_precision: 1
            curve: smooth
            group_by:
              func: avg
              duration: 30m
              fill: last
          - entity: sensor.dantherm_supply_temperature
            name: Aanlever
            stroke_width: 2
            fill_raw: last
            float_precision: 1
            curve: smooth
            group_by:
              func: avg
              duration: 30m
              fill: last
          - entity: sensor.dantherm_exhaust_temperature
            name: Uitlaat
            stroke_width: 2
            fill_raw: last
            float_precision: 1
            curve: smooth
            group_by:
              func: avg
              duration: 30m
              fill: last
          - entity: sensor.dantherm_outdoor_temperature
            name: Buiten
            stroke_width: 2
            fill_raw: last
            float_precision: 1
            curve: smooth
            group_by:
              func: avg
              duration: 30m
              fill: last
        yaxis:
          - decimals: 0
            apex_config:
              tickAmount: 4