- type: custom:layout-card
  layout_type: custom:horizontal-layout
  layout:
    max_cols: 2
  cards:
    - type: custom:decluttering-card
      template: coloured-vertical-stack
      variables:
        - color: "#404040"
        - cards:
          - type: custom:decluttering-card
            template: v3_title
            variables:
              - title: ⚙️ Preferences
          - type: horizontal-stack
            cards:
              - type: custom:button-card
                template: v3_chip_name
                entity: binary_sensor.someone_home
                name: Someone home
              - type: custom:button-card
                template: v3_chip_name
                entity: binary_sensor.someone_sleeping
                name: Sleeping
              - type: custom:button-card
                template: v3_chip
                entity: sensor.house_mode
                icon: mdi:home

          - type: custom:decluttering-card
            template: v3_section_title
            variables:
              - title: Toggles
          - type: horizontal-stack
            cards:
              - type: custom:button-card
                template: [v3_button, with_state_indicator]
                entity: input_boolean.alarm_enabled
                state_display: >-
                  [[[
                    if (entity.state === 'off') { return 'Off'; }
                    const time = states['input_datetime.alarm_time'].state;
                    return time.split(':').slice(0, -1).join(':');
                  ]]]
                name: Alarm
                variables:
                  state_indicator_id: automation.alarm_set_time
              - type: custom:button-card
                template: v3_button
                entity: input_boolean.speech_notifications
                name: Speech
              - type: custom:button-card
                template: v3_button
                entity: input_boolean.simulation_mode
                name: Simulation

          - type: horizontal-stack
            cards:
              - type: custom:button-card
                template: v3_button
                name: Guests
                entity: input_boolean.guest_mode
              - type: custom:button-card
                template: v3_button
                entity: input_boolean.guest_bedroom
                name: G. Bedroom Occupied
              - type: custom:button-card
                template: v3_button
                entity: switch.mercury_home_mode
                name: Mercury Home mode

          - type: horizontal-stack
            cards:
              - type: custom:button-card
                template: v3_button
                entity: binary_sensor.pi_hole_enabled
                name: Pi-Hole
                icon: mdi:pi-hole

          - type: custom:decluttering-card
            template: v3_section_title
            variables:
              - title: Lighting
          - type: entities
            entities:
              - input_number.global_light_temp
              - input_number.guest_bedroom_light_temp
              - automation.tv_plex_setup_house_for_plex
              - automation.tv_plex_restore_house_after_plex

    - type: custom:decluttering-card
      template: coloured-vertical-stack
      variables:
        - color: "#6A737A"
        - cards:
          - type: custom:decluttering-card
            template: v3_section_title
            variables:
              - title: Media
          - type: horizontal-stack
            cards:
              - type: custom:button-card
                template: v3_button
                entity: input_boolean.coming_home_play_music
                name: Coming home music
              - type: custom:button-card
                template: v3_button
                entity: light.browser_hallway
                name: Hallway Dashboard
              - type: custom:button-card
                template: v3_button
                entity: light.browser_kitchen
                name: Kitchen Dashboard
          - type: entities
            entities:
              - type: divider
              - input_text.wake_up_spotify_playlist
              - input_number.wake_up_volume
              - input_number.bathroom_high_volume
              - input_text.bedroom_2_playlist

          - type: custom:decluttering-card
            template: v3_section_title
            variables:
              - title: Climate
          - type: horizontal-stack
            cards:
              - type: custom:button-card
                template: v3_button
                entity: input_boolean.heating_enabled
                name: Central Heating
              - type: custom:button-card
                template: v3_button
                entity: input_boolean.ac_heating
                name: AC Heating
              - type: custom:button-card
                template: v3_button
                entity: script.turn_on_all_radiators
                name: Turn on all radiators
                show_state: false

          - type: entities
            show_header_toggle: false
            entities:
              - input_number.radiators_temperature
              - type: divider
              - input_number.toshiba_heat_temp
              - input_number.toshiba_cool_temp
              - input_number.toshiba_trigger_temp


    - !include ../popup_cards.yaml
