- type: custom:layout-card
  layout_type: custom:horizontal-layout
  layout:
    max_cols: 2
  cards:
    - type: custom:decluttering-card
      template: coloured-vertical-stack
      variables:
        - color: "#786fa7"
        - cards:
          - type: custom:decluttering-card
            template: v3_title
            variables:
              - title: 🛏️ Bedroom
          - type: horizontal-stack
            cards:
              - type: custom:button-card
                template: v3_chip
                entity: sensor.bedroom_weather_temperature
              - type: custom:button-card
                template: v3_chip
                entity: sensor.bedroom_weather_humidity
              - type: custom:button-card
                template: v3_chip
                entity: sensor.purifier_air_quality
                state_display: "[[[return entity.state.split(' ')[0] + ' pm2.5']]]"
          - type: horizontal-stack
            cards:
              - type: custom:button-card
                template: v3_chip_name
                entity: binary_sensor.bedroom_left_window_contact
                name: Left window
              - type: custom:button-card
                template: v3_chip_name
                entity: binary_sensor.bedroom_right_window_contact
                name: Right window
              - type: custom:button-card
                template: v3_chip_name
                entity: binary_sensor.bedroom_door_contact
                name: Door

          - type: custom:decluttering-card
            template: v3_section_title
            variables:
              - title: Scenes
          - type: custom:decluttering-card
            template: v3_horizontal_stack_card
            variables:
              - cards:
                - type: custom:button-card
                  template: v3_scene
                  entity: scene.bedroom_neon
                  name: Neon
                  variables:
                    scene_color_1: rgb(255, 0, 190)
                    scene_color_2: rgb(0, 255, 190)
                - type: custom:button-card
                  template: v3_scene
                  entity: scene.bedroom_ambient_neon
                  name: Ambient neon
                  variables:
                    scene_color_1: rgb(255, 0, 190)
                    scene_color_2: rgb(0, 255, 190)
                - type: custom:button-card
                  template: v3_scene
                  entity: scene.bedroom_default
                  name: Regular
                  variables:
                    scene_color_1: rgb(254, 255, 209)
                - type: custom:button-card
                  template: v3_scene
                  entity: scene.bedroom_ambient_default
                  name: Ambient regular
                  variables:
                    scene_color_1: rgb(254, 255, 209)
                - type: custom:button-card
                  template: v3_scene
                  entity: scene.bedroom_pink
                  name: Pink
                  variables:
                    scene_color_1: rgb(255, 92, 38)
                    scene_color_2: rgb(255, 0, 190)
                - type: custom:button-card
                  template: v3_scene
                  entity: scene.bedroom_ambient_pink
                  name: Ambient pink
                  variables:
                    scene_color_1: rgb(255, 92, 38)
                    scene_color_2: rgb(255, 0, 190)

          - type: custom:decluttering-card
            template: v3_section_title
            variables:
              - title: Lights
          - type: horizontal-stack
            cards:
              - type: custom:button-card
                template: v3_button_light
                entity: light.master_bedroom
                name: All
              - type: custom:button-card
                template: v3_button_light
                entity: light.master_bedroom_main
                name: Main
              - type: custom:button-card
                template: v3_button_light
                entity: light.bedside
                name: Bedside

    - type: custom:decluttering-card
      template: coloured-vertical-stack
      variables:
        - color: "#786fa7"
        - cards:
          - type: custom:decluttering-card
            template: v3_section_title
            variables:
              - title: Devices
          - type: horizontal-stack
            cards:
              - type: custom:button-card
                template: v3_button
                entity: media_player.master_bedroom
                name: Sonos
                hold_action:
                  action: call-service
                  service: media_player.media_play_pause
                  service_data:
                    entity_id: media_player.master_bedroom
              - type: custom:button-card
                template: v3_button_purifier
                entity: fan.philips_airpurifier
                name: Air Purifier
              - type: custom:button-card
                template: v3_button_radiator
                entity: climate.bedroom_radiator_mode
                name: Radiator
          - type: horizontal-stack
            cards:
              - type: custom:button-card
                template: v3_button
                entity: input_select.bedroom_mode
                name: Mode
                tap_action:
                  action: call-service
                  service: script.toggle_bedroom_mode

          - type: vertical-stack
            cards:
              - type: custom:decluttering-card
                template: v3_section_title
                variables:
                  - title: Camera
              - type: picture-glance
                camera_image: camera.bedroom_hd
                entities:
                  - switch.tapo_bedroom

    - !include ../popup_cards.yaml
