###################################################################### # @CCOSTAN - Follow Me on X # For more info visit https://www.vcloudinfo.com/click-here # Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig # ------------------------------------------------------------------- # Infrastructure Partial - Docker containers sections # Related Issue: 1560, 1584 # Sections layout for the Docker containers view. # ------------------------------------------------------------------- # Notes: Auto-discovers Portainer container entities from `switch.*_container`. # Notes: Keeps cards visible when Portainer telemetry is unavailable (degraded mode). # Notes: Includes stack-level status tiles from Portainer `*_stack_status` entities. ###################################################################### - type: grid column_span: 4 columns: 3 square: false cards: - type: custom:button-card template: bearstone_infra_kpi entity: sensor.garage_ups_load name: UPS Load icon: mdi:battery-charging-60 - type: custom:button-card template: bearstone_infra_kpi entity: sensor.carlo_nvr_volume_1_volume_used name: NVR Used icon: mdi:harddisk - type: custom:button-card template: bearstone_infra_kpi entity: sensor.carlo_nas01_volume_1_volume_used name: NAS Used icon: mdi:nas - type: grid column_span: 4 columns: 4 square: false cards: - type: custom:bubble-card card_type: button button_type: state entity: sensor.docker_10_apt_status name: docker_10 icon: mdi:server show_state: true show_last_changed: true card_layout: large tap_action: action: navigate navigation_path: '#infra-docker-10' button_action: tap_action: action: navigate navigation_path: '#infra-docker-10' - type: custom:bubble-card card_type: button button_type: state entity: sensor.docker_17_apt_status name: docker_17 icon: mdi:server show_state: true show_last_changed: true card_layout: large tap_action: action: navigate navigation_path: '#infra-docker-17' button_action: tap_action: action: navigate navigation_path: '#infra-docker-17' - type: custom:bubble-card card_type: button button_type: state entity: sensor.docker_69_apt_status name: docker_69 icon: mdi:server show_state: true show_last_changed: true card_layout: large tap_action: action: navigate navigation_path: '#infra-docker-69' button_action: tap_action: action: navigate navigation_path: '#infra-docker-69' - type: custom:bubble-card card_type: button button_type: state entity: sensor.docker_14_apt_status name: docker_14 icon: mdi:server show_state: true show_last_changed: true card_layout: large tap_action: action: navigate navigation_path: '#infra-docker-14' button_action: tap_action: action: navigate navigation_path: '#infra-docker-14' - type: grid column_span: 4 columns: 4 square: false cards: - type: custom:button-card template: bearstone_infra_apt_prune_tile name: docker_10 entity: sensor.docker_10_apt_status variables: last_update_sensor: sensor.docker_10_apt_last_update prune_button: button.carlo_hass_prune_unused_images name: docker_10 - type: custom:button-card template: bearstone_infra_apt_prune_tile name: docker_17 entity: sensor.docker_17_apt_status variables: last_update_sensor: sensor.docker_17_apt_last_update prune_button: button.docker17_prune_unused_images name: docker_17 - type: custom:button-card template: bearstone_infra_apt_prune_tile name: docker_69 entity: sensor.docker_69_apt_status variables: last_update_sensor: sensor.docker_69_apt_last_update prune_button: button.docker69_prune_unused_images name: docker_69 - type: custom:button-card template: bearstone_infra_apt_prune_tile name: docker_14 entity: sensor.docker_14_apt_status variables: last_update_sensor: sensor.docker_14_apt_last_update prune_button: button.docker2_prune_unused_images name: docker_14 - type: grid column_span: 4 columns: 1 square: false cards: - type: custom:vertical-stack-in-card grid_options: columns: full card_mod: style: !include /config/dashboards/infrastructure/card_mod/infra_panel.yaml cards: - type: custom:button-card template: bearstone_infra_panel_header name: Docker Stacks - type: custom:auto-entities show_empty: true card: type: custom:layout-card layout_type: custom:grid-layout layout: grid-template-columns: repeat(2, minmax(0, 1fr)) grid-auto-flow: row grid-auto-rows: min-content grid-gap: 12px margin: 0 mediaquery: "(max-width: 900px)": grid-template-columns: repeat(1, minmax(0, 1fr)) card_param: cards filter: include: - entity_id: binary_sensor.*_stack_status options: type: custom:button-card template: bearstone_infra_list_row_running icon: mdi:package-variant state_display: > [[[ const base = entity.entity_id.replace('binary_sensor.', '').replace('_stack_status', ''); const count = states[`sensor.${base}_stack_containers_count`]?.state ?? 'n/a'; const type = String(states[`sensor.${base}_stack_type`]?.state ?? 'n/a').toUpperCase(); const status = entity.state === 'on' ? 'RUNNING' : 'DOWN'; return `${status} | ${count} ctrs | ${type}`; ]]] sort: method: name - type: grid column_span: 4 columns: 1 square: false cards: - type: custom:vertical-stack-in-card grid_options: columns: full card_mod: style: !include /config/dashboards/infrastructure/card_mod/infra_panel.yaml cards: - type: custom:button-card template: bearstone_infra_alert_row entity: binary_sensor.docker_container_telemetry_degraded name: Docker telemetry degraded icon: mdi:lan-disconnect variables: alert_kind: binary_on state_display: >- [[[ const unavailable = states['sensor.docker_monitored_unavailable_count']?.state ?? '0'; const total = states['sensor.docker_monitored_container_count']?.state ?? '0'; return `${unavailable}/${total} unavailable`; ]]] - type: custom:auto-entities show_empty: true grid_options: columns: full card: type: custom:layout-card layout_type: custom:grid-layout layout: grid-template-columns: repeat(4, minmax(0, 1fr)) grid-auto-flow: row grid-auto-rows: min-content grid-gap: 12px margin: 0 mediaquery: "(max-width: 900px)": grid-template-columns: repeat(2, minmax(0, 1fr)) card_param: cards filter: include: - group: group.docker_monitored_containers options: type: custom:button-card template: bearstone_infra_container_row icon: mdi:docker sort: method: name - !include /config/dashboards/infrastructure/popups/docker_10_maintenance.yaml - !include /config/dashboards/infrastructure/popups/docker_17_maintenance.yaml - !include /config/dashboards/infrastructure/popups/docker_69_maintenance.yaml - !include /config/dashboards/infrastructure/popups/docker_14_maintenance.yaml