  - type: sections
    max_columns: 3
    icon: mdi:cog
    path: admin
    sections:
      - type: grid
        cards:
          - type: vertical-stack
            cards:
              - type: custom:bubble-card
                card_type: pop-up
                hash: '#remote'
                button_type: name
                show_name: true
                show_icon: true
                icon: mdi:remote-desktop
                sub_button: []
                card_layout: large
                show_last_changed: false
                show_state: true
                name: Remote Control
                margin_top_mobile: 31vh
                show_header: true
                margin_top_desktop: 14vh
                bg_color: var(--secondary-background-color)
                entity: input_select.misc
                styles: |-
                  .bubble-background: {
                    background-color: var(--secondary-background-color) !important;
                    opacity: 1;
                  }
                bg_opacity: '100'
                bg_blur: '55'
              - type: custom:layout-card
                layout_type: custom:grid-layout
                cards:
                  - type: custom:bubble-card
                    card_type: button
                    button_type: slider
                    show_name: true
                    card_layout: normal
                    entity: input_number.volumeslider
                    force_icon: true
                    scrolling_effect: true
                    show_state: false
                    tap_action:
                      action: call-service
                      service: button.press
                      target:
                        entity_id: button.lucy_pc_mute
                    show_icon: true
                    show_attribute: true
                    name: Volume
                    sub_button:
                      - icon: mdi:monitor-speaker
                        entity: sensor.default_audio_device_short_name
                        tap_action:
                          action: call-service
                          service: script.toggle_playback
                          target: {}
                        show_background: false
                    styles: >
                      .bubble-sub-button-icon {
                        --mdc-icon-size: inherit !important;
                      }
                        .bubble-sub-button {
                         # height: 46px !important;
                          #width: 46px !important;
                        }  
                      .bubble-sub-button-1 {
                        background: var(--card-background-color) !important;
                        opacity: 1 !important;
                        filter: brightness(0.7) !important;
                      }

                      .bubble-icon {
                        color: ${hass.states['sensor.lucy_pc_audio_default_device_muted_2'].state === 'True' ? 'rgba(130, 0, 0, 0.51)' : ''} !important;
                        opacity: 1 !important;
                        filter: brightness(0.7) !important;
                        
                      }

                      .bubble-range-fill { 
                        background: ${hass.states['sensor.lucy_pc_audio_default_device_muted_2'].state === 'True'  ? 'rgba(90, 0, 0, 0.53)' : ''} !important;
                        opacity: 1 !important;
                        filter: brightness(0.5) !important;
                      } 

                      .bubble-button-card-container {
                        background: var(--primary-background-color) !important;;
                        opacity: 1 !important;
                        filter: brightness(1.5) !important;
                      }       

                      ${hass.states['sensor.lucy_pc_audio_default_device_muted_2'].state
                      ===

                      'True' 
                        ? card.querySelector('.bubble-state').innerText = 'Muted'
                        : card.querySelector('.bubble-state').innerText = Math.round(hass.states['input_number.volumeslider'].state/65553*100) + "%"} ;

                            

                      ${icon.setAttribute("icon",

                      hass.states['sensor.lucy_pc_audio_default_device_muted_2'].state
                      ===

                      'True' ? 'mdi:volume-variant-off' : 'mdi:volume-source')};





                      ${subButtonIcon[0].setAttribute("icon",
                      hass.states['sensor.default_audio_device_short_name'].state
                      === 'Speakers' 

                      ? 'mdi:television-speaker' 

                      : 'mdi:headset')};

                      .bubble-icon {
                        color: 'white' !important;
                        opacity: 1 !important;
                        }
                  - type: custom:bubble-card
                    card_type: button
                    sub_button:
                      - entity: button.lucy_pc_screensleep
                        show_name: false
                        show_state: false
                        tap_action:
                          action: toggle
                        icon: mdi:monitor-off
                      - entity: button.lucy_pc_screenwake
                        show_name: false
                        show_state: false
                        tap_action:
                          action: toggle
                        icon: mdi:monitor-shimmer
                      - entity: button.lucy_pc_shutdown
                        show_name: false
                        show_state: false
                        tap_action:
                          action: toggle
                        icon: mdi:power-standby
                      - entity: button.lucy_pc_restart
                        show_name: false
                        show_state: false
                        tap_action:
                          action: toggle
                        icon: mdi:restart
                      - entity: button.lucy_pc_hibernate
                        show_name: false
                        show_state: false
                        tap_action:
                          action: toggle
                        icon: mdi:sleep
                      - entity: button.lucy_pc_standby
                        show_name: false
                        show_state: false
                        tap_action:
                          action: toggle
                          service: script.standby_wake_pc
                        icon: mdi:power-sleep
                    card_layout: normal
                    name: System
                    show_icon: false
                    show_state: false
                    show_name: false
                    scrolling_effect: true
                    styles: |-


                      .card-content {
                        width: 100%;
                        margin: 0 !important;
                      }
                      .bubble-sub-button {
                        height: 48px !important;
                        width: 48px !important;
                        #background: var(--secodary-background-color) !important;
                        background-color:  var(--card-background-color) !important;

                      }
                      .bubble-sub-button-icon {
                        --mdc-icon-size: 2.3em !important;
                        
                      }

                      .bubble-icon {
                        color: 'white' !important;
                        opacity: 1 !important;
                      } 


                      .bubble-sub-button-container {
                        #background: teal !important;
                        width: 100%;
                        justify-content: space-between !important;   
                        margin: 0 !important;
                      }
                      .bubble-name-container {
                        margin-right: 0px !important;
                      }
                          .bubble-button-card-container {
                            background: none;
                          }
                    button_type: name
                    icon: mdi:desktop-tower
                  - type: custom:bubble-card
                    card_type: media-player
                    entity: media_player.spotify_lucy_foxx
                  - type: custom:bubble-card
                    card_type: media-player
                    entity: media_player.fuchscast
                  - type: custom:bubble-card
                    card_type: media-player
                    entity: media_player.vlc_telnet
                layout:
                  margin: '-10px -10px -10px -10px'
          - type: vertical-stack
            cards:
              - type: custom:bubble-card
                card_type: pop-up
                hash: '#kitchen-timer'
                button_type: name
                show_name: true
                show_icon: true
                icon: mdi:timer
                sub_button: []
                card_layout: large
                show_last_changed: false
                show_state: true
                name: Timer
                margin_top_mobile: 17vh
                show_header: true
                margin_top_desktop: 15vh
                bg_color: var(--secondary-background-color)
                entity: input_select.misc
                styles: |-
                  .bubble-background: {
                    background-color: var(--secondary-background-color) !important;
                    opacity: 1;
                  }
              - type: custom:layout-card
                layout_type: custom:grid-layout
                layout:
                  grid-template-columns: auto auto auto
                  grid-template-rows: auto
                  margin: 0px 0px 0px 0px
                  padding: 0 0 0 0
                cards:
                  - type: custom:numberbox-card
                    border: false
                    entity: input_number.timer_hours
                    unit: h
                    speed: 100
                    icon: false
                    name: false
                    picture: false
                    delay: 0
                  - type: custom:numberbox-card
                    border: false
                    entity: input_number.timer_minutes
                    speed: 100
                    name: false
                    picture: false
                    unit: min
                    icon: false
                    delay: 0
                  - type: custom:numberbox-card
                    border: false
                    entity: input_number.timer_seconds
                    unit: sec
                    delay: 1000
                    name: false
                    picture: false
                    icon: false
                    speed: 200
              - type: custom:bubble-card
                card_type: button
                sub_button:
                  - name: Cancel
                    show_name: false
                    icon: mdi:close
                    tap_action:
                      action: perform-action
                      perform_action: timer.cancel
                      target:
                        entity_id: timer.kitchen_timer
                    visibility:
                      - condition: or
                        conditions:
                          - condition: state
                            entity: timer.kitchen_timer
                            state: active
                          - condition: state
                            entity: timer.kitchen_timer
                            state: paused
                  - icon: mdi:timer-plus
                    name: Start
                    show_name: false
                    tap_action:
                      perform_action: script.timer
                      action: call-service
                      target: {}
                      service: script.timer
                    visibility:
                      - condition: state
                        entity: timer.kitchen_timer
                        state: idle
                  - icon: mdi:timer-pause
                    tap_action:
                      action: perform-action
                      perform_action: timer.pause
                      target:
                        entity_id: timer.kitchen_timer
                    visibility:
                      - condition: state
                        entity: timer.kitchen_timer
                        state: active
                  - icon: mdi:timer-play
                    tap_action:
                      action: perform-action
                      perform_action: timer.start
                      target:
                        entity_id: timer.kitchen_timer
                    visibility:
                      - condition: state
                        entity: timer.kitchen_timer
                        state: paused
                card_layout: large
                styles: |-
                  .bubble-line {
                    background: none !important;
                  }

                  .bubble-sub-button-1 {
                    
                    background: rgb(170,0,0) !important;
                  }
                  .bubble-sub-button-2 {
                    
                    background: teal !important;
                  }
                  .bubble-sub-button-3 {
                    
                    background: var(--deep-orange-color) !important;
                  }
                  .bubble-sub-button-4 {
                    
                    background: rgba(100,100,100,0.65) !important;
                  }
                entity: timer.reminder
                show_name: false
                show_attribute: true
                attribute: duration
                icon: mdi:timer
                show_icon: false
                button_type: name
              - type: conditional
                conditions:
                  - condition: state
                    entity: timer.kitchen_timer
                    state_not: idle
                card:
                  type: custom:circular-timer-card
                  entity: timer.kitchen_timer
                  bins: 20
                  color:
                    - '#6000c0'
                    - '#9000d0'
                    - '#Af00af'
                  layout: minimal
                  color_state: true
                  secondary_info: timer
                  card_mod:
                    style:
                      ha-markdown $: |
                        h1 img {
                          vertical-align: center;
                        }
                      .: |

                        ha-card {
                          background-color: transparent !important;

                        }  
          - type: tile
            entity: button.playback_device_toggle
          - type: tile
            entity: button.standby_resume
          - type: custom:apexcharts-card
            graph_span: 2h
            header:
              show: true
              title: ApexCharts-Card
              show_states: true
              colorize_states: true
            series:
              - entity: sensor.pmg_autocatcher_stats
                attribute: catched
              - entity: sensor.pmg_autocatcher_stats
                attribute: items
              - entity: sensor.pmg_autocatcher_stats
                attribute: fled
      - type: grid
        cards:
          - type: custom:bubble-card
            card_type: button
            name: Scenes
            button_type: name
            card_layout: large
            styles: |-
              .bubble-name {
                color: var(--white-color) !important;
                opacity: 1 !important;                  
              }

              .bubble-button-background {
                background-color: var(--card-background-color) !important;
                opacity: 1 !important;                  
              }
                          .bubble-sub-button-icon {
                            --mdc-icon-size: inherit !important;
                          }
                          .bubble-name-container {
                            margin-right: 0px !important;
                          }
                          .bubble-sub-button-container {
                            width: 100%;
                            margin: -6px !important;
                            justify-content: space-evenly !important;
                          }  
                          .bubble-sub-button {
                            height: 42px !important;
                            width: 20% !important;
                            background: var(--secondary-background-color) !important;
                          }   
                          .card-content {
                            width: 100%;
                            margin: 0 !important;
                          }
              .bubble-sub-button-icon {  
                --mdc-icon-size: 24px !important;
              }        
              .bubble-sub-button-1{
                  background-color: ${hass.states['input_boolean.scene_minimal'].state==='on' ? 'var(--primary-color)' : ''} !important;
              }                 
              .bubble-sub-button-2{
                  background-color: ${hass.states['input_boolean.scene_musicfx'].state==='on' ? 'var(--primary-color)' : ''} !important;
              } 
              .bubble-sub-button-3{
                 background-color: ${hass.states['input_boolean.scene_uv_only'].state==='on' ? 'var(--primary-color)' : ''} !important;
              }   
              .bubble-sub-button-4{
                 background-color: ${hass.states['input_boolean.scene_tv_bar'].state==='on' ? 'var(--primary-color)' : ''} !important;
              }
              .bubble-sub-button-5{
                 background-color: var(--deep-orange-color) !important;
              } 
            show_name: false
            icon: mdi:auto-fix
            sub_button:
              - entity: input_boolean.scene_minimal
                show_state: false
                show_name: false
                name: Desk
                tap_action:
                  action: call-service
                  service: script.scenes_control
                  data:
                    scene: minimal
                  target: {}
              - entity: input_boolean.scene_musicfx
                show_state: false
                show_name: false
                name: MusicFX
                tap_action:
                  action: call-service
                  service: script.scenes_control
                  data:
                    scene: musicfx
                  target: {}
                icon: mdi:equalizer
              - entity: input_boolean.scene_uv_only
                tap_action:
                  action: call-service
                  service: script.scenes_control
                  data:
                    scene: uv_only
                  target: {}
              - entity: input_boolean.scene_tv_bar
                tap_action:
                  action: call-service
                  service: script.scenes_control
                  data:
                    scene: tv_bar
                  target: {}
              - entity: script.state_restore
                tap_action:
                  action: call-service
                  service: script.state_restore
                  data:
                    sensor: sensor.scene_default_2
                  target: {}
            tap_action:
              action: call-service
              service: script.state_restore
              data:
                sensor: sensor.scene_default_2
              target: {}
            show_icon: false
          - type: entities
            entities:
              - type: custom:bubble-card
                card_type: separator
                name: Package Tracking
                button_type: name
                show_icon: true
                card_layout: large
                sub_button: []
                styles: |-
                  .bubble-name {
                    font-size: large !important;
                    font-style: bold !important;
                    color: var(--white-color) !important;
                    opacity: 1 !important;       
                  } .bubble-icon {
                    #--mdc-icon-size: 32px    
                  }
                show_name: true
                icon: mdi:package-variant
              - type: custom:layout-card
                layout_type: custom:grid-layout
                layout: null
                cards:
                  - type: conditional
                    conditions:
                      - condition: numeric_state
                        entity: sensor.17track_in_transit
                        above: 0
                    card:
                      type: markdown
                      content: >2-

                          {% if states.sensor['17track_in_transit'].attributes.packages | length > 0 %}
                          ### In Transit:


                          {% for package in states.sensor['17track_in_transit'].attributes.packages %}
                         **{{ package.friendly_name or 'Unknown' }}:** **`{{ package.tracking_number }}`** 
                         {{ package.info_text }} 
                         *({{ as_timestamp(package.timestamp) |
                          timestamp_custom('%d. %B %Y, %H:%M') }})*
                        [***`{{ "More info"
                        }}`***](https://www.17track.net/en/track?nums={{
                        package.tracking_number }})  
                          {% endfor %} {% endif %}
                  - type: conditional
                    conditions:
                      - condition: numeric_state
                        entity: sensor.17track_ready_to_be_picked_up
                        above: 0
                    card:
                      type: markdown
                      content: >2-

                          {% if states.sensor['17track_ready_to_be_picked_up'].attributes.packages | length > 0 %}
                          ### In Transit:


                          {% for package in states.sensor['17track_ready_to_be_picked_up'].attributes.packages %}
                         **{{ package.friendly_name or 'Unknown' }}:** **`{{ package.tracking_number }}`** 
                         {{ package.info_text }} 
                         *({{ as_timestamp(package.timestamp) |
                          timestamp_custom('%d. %B %Y, %H:%M') }})*
                        [***`{{ "More info"
                        }}`***](https://www.17track.net/en/track?nums={{
                        package.tracking_number }})  
                          {% endfor %} {% endif %}
                  - type: conditional
                    conditions:
                      - condition: numeric_state
                        entity: sensor.17track_undelivered
                        above: 0
                    card:
                      type: markdown
                      content: >2-

                          {% if states.sensor['17track_undelivered'].attributes.packages | length > 0 %}
                          ### In Transit:


                          {% for package in states.sensor['17track_undelivered'].attributes.packages %}
                         **{{ package.friendly_name or 'Unknown' }}:** **`{{ package.tracking_number }}`** 
                         {{ package.info_text }} 
                         *({{ as_timestamp(package.timestamp) |
                          timestamp_custom('%d. %B %Y, %H:%M') }})*
                        [***`{{ "More info"
                        }}`***](https://www.17track.net/en/track?nums={{
                        package.tracking_number }})  
                          {% endfor %} {% endif %}
                  - type: conditional
                    conditions:
                      - condition: numeric_state
                        entity: sensor.17track_delivered
                        above: 0
                    card:
                      type: markdown
                      content: >
                        {% if
                        states.sensor['17track_delivered'].attributes.packages |
                        length > 0 %}

                        ### Delivered:
                         
                          
                          
                        {% for package in
                        states.sensor['17track_delivered'].attributes.packages
                        %}
                         
                        **{{ package.friendly_name or 'Unknown' }}:**  **`{{
                        package.tracking_number }}`**  

                        {{ package.info_text }}    *({{
                        as_timestamp(package.timestamp) | timestamp_custom('%d.
                        %B %Y, %H:%M') }})*  

                        [***`More
                        info`***](https://www.17track.net/en/track?nums={{
                        package.tracking_number }})   [***`Copy Tracking
                        Number`***](#)  

                         
                        {%- endfor %} {% endif %}
                      tap_action:
                        action: call-service
                        service: input_text.set_value
                        service_data:
                          entity_id: input_text.tracking_number
                          value: '{{ package.tracking_number }}'
                  - type: custom:stack-in-card
                    mode: horizontal
                    cards:
                      - entity: input_text.tracking_number
                        type: custom:text-input-row
                      - type: custom:bubble-card
                        card_type: button
                        button_type: name
                        card_layout: large
                        show_name: false
                        show_icon: false
                        button_action:
                          tap_action:
                            action: url
                            url_path: https://buyer.17track.net/de/myshipment?ob=1
                        sub_button:
                          - tap_action:
                              action: call-service
                              service: script.archive_package
                            icon: mdi:archive-check-outline
                            name: Archive
                            show_name: true
                          - icon: mdi:package-variant-closed-plus
                            name: Add
                            show_name: true
                            tap_action:
                              action: url
                              url_path: https://buyer.17track.net/de/myshipment?ob=1
                        styles: |-
                          .bubble-button-background{
                            background-color: var(--card-background-color) !important;
                            opacity: 0 !important;
                          }       .bubble-sub-button-icon {
                            --mdc-icon-size: inherit !important;
                           # color: var(--disabled-color);
                          } .bubble-name-container {
                            margin-right: 0px !important;
                          } .bubble-sub-button-container {
                            width: 100%;
                            justify-content: space-evenly !important;
                          }   .bubble-button-background {
                            #background-color: var(--card-background-color) !important;
                          } .bubble-sub-button {
                            width: 50% !important;
                            height: 50px !important;
                            #background: var(--secondary-background-color) !important;
                          }            .bubble-sub-button-1 {
                            opacity: 1 !important;
                            background: var(--card-background-color) !important;
                          }  .bubble-sub-button-2 {
                            opacity: 1 !important;
                            background: rgba(33,103,103,0.52) !important;
                          }             .card-content {
                            width: 100%;
                            margin: 0 !important;
                          }
                    card_mod:
                      style: |
                        ha-card {
                          background: none !important;
                        }
                card_mod:
                  style:
                    ha-markdown $: |
                      h1 img {
                        vertical-align: center;
                      }
                    .: |
                      ha-card {
                        background-color: transparent !important;
                        box-shadow: none !important;
                        margin-bottom: -15px;
                        margin-top: -15px;
                        text-align: start;
                      }
            visibility:
              - condition: user
                users:
                  - dd8da2ed051341f086805992caab5ee3
          - type: tile
            entity: light.bathroom
          - type: tile
            entity: light.bathroom_ceiling
          - type: tile
            entity: light.bathroom_mirror
      - type: grid
        cards:
          - type: tile
            features_position: bottom
            vertical: false
            name: Nessie
            entity: binary_sensor.pmg_stats_nessie
            hide_state: false
            icon: mdi:alpha-n-circle
            icon_tap_action:
              action: perform-action
              perform_action: variable.toggle_binary_sensor
              target:
                entity_id: binary_sensor.pmg_stats_nessie
              data:
                replace_attributes: false
            color: pink
          - type: tile
            features_position: bottom
            vertical: false
            name: Lucy
            entity: binary_sensor.pmg_stats_lucy
            hide_state: false
            icon: mdi:alpha-l-circle
            icon_tap_action:
              action: perform-action
              perform_action: variable.toggle_binary_sensor
              target:
                entity_id: binary_sensor.pmg_stats_lucy
              data:
                replace_attributes: false
            color: primary
          - type: custom:more-info-card
            entity: binary_sensor.pmg_stats_nessie
            grid_options:
              columns: 6
              rows: auto
          - type: custom:more-info-card
            entity: binary_sensor.pmg_stats_lucy
            grid_options:
              columns: 6
              rows: auto
    visible:
      - user: a50b22c1dd2248a9aa671a0bdd1c8e70
    cards: []
