###################################################################### # @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 operations # Host health, updates, volumes, active exceptions, and inventory drill-down. # ------------------------------------------------------------------- # Notes: Healthy stacks and containers live in the hidden Docker Inventory subview. # Notes: Host maintenance controls remain in the existing confirmed popups. ###################################################################### # ------------------------------------------------------------------- # Docker health strip (mandatory first full-width wrapper) # ------------------------------------------------------------------- - type: grid column_span: 4 columns: 1 square: false cards: - type: custom:layout-card grid_options: columns: full layout_type: custom:grid-layout layout: grid-template-columns: repeat(5, 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)) cards: - type: custom:button-card template: bearstone_infra_kpi entity: sensor.docker_monitored_container_count name: Monitored icon: mdi:docker state_display: > [[[ const ids = states['sensor.docker_monitored_switch_inventory']?.attributes?.entity_id; const unique = Array.isArray(ids) ? ids.filter(id => !String(id).endsWith('_container_2')).length : entity.state; return `${unique} workloads`; ]]] - type: custom:button-card template: bearstone_infra_status_kpi entity: sensor.docker_monitored_unavailable_count name: Unavailable icon: mdi:alert-circle-outline variables: ok_state: '0' healthy_text: NONE raw_suffix: UNAVAILABLE - type: custom:button-card template: bearstone_infra_status_kpi entity: binary_sensor.docker_container_telemetry_degraded name: Telemetry icon: mdi:lan-check variables: ok_state: 'off' - 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 # ------------------------------------------------------------------- # Host maintenance signals and volume telemetry # ------------------------------------------------------------------- - type: grid column_span: 4 columns: 1 square: false cards: - type: custom:layout-card grid_options: columns: full 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)) cards: - type: custom:vertical-stack-in-card card_mod: style: !include /config/dashboards/infrastructure/card_mod/infra_panel.yaml cards: - type: custom:button-card template: bearstone_infra_panel_header name: Host Updates - type: custom:button-card template: bearstone_infra_update_row entity: sensor.docker_10_apt_status name: docker_10 tap_action: action: navigate navigation_path: '#infra-docker-10' - type: custom:button-card template: bearstone_infra_update_row entity: sensor.docker_17_apt_status name: docker_17 tap_action: action: navigate navigation_path: '#infra-docker-17' - type: custom:button-card template: bearstone_infra_update_row entity: sensor.docker_69_apt_status name: docker_69 tap_action: action: navigate navigation_path: '#infra-docker-69' - type: custom:button-card template: bearstone_infra_update_row entity: sensor.docker_14_apt_status name: docker_14 tap_action: action: navigate navigation_path: '#infra-docker-14' - type: custom:vertical-stack-in-card card_mod: style: !include /config/dashboards/infrastructure/card_mod/infra_panel.yaml cards: - type: custom:button-card template: bearstone_infra_panel_header name: Docker Volumes - type: custom:button-card template: bearstone_infra_docker_volume_row entity: sensor.carlo_hass_volume_disk_usage_total_size name: docker_10 variables: total_entity: sensor.carlo_hass_volume_disk_usage_total_size - type: custom:button-card template: bearstone_infra_docker_volume_row entity: button.docker2_prune_unused_volumes name: docker_14 variables: not_instrumented: true - type: custom:button-card template: bearstone_infra_docker_volume_row entity: button.docker17_prune_unused_volumes name: docker_17 variables: volume_entities: - sensor.17214906eee4a16eed521e2904730a8272958bb32209c8b204fef3914a85006f_volume_size - sensor.17e04b7a1a6902f3192bd825b497c5a7a920c64c88a216968cf1700da94d10f0_volume_size - sensor.31a30aacc34d2988cbedbd8aa82d29066a7630ad8e51ce3d55ea0d785c5e8dbc_volume_size - sensor.8c8b88aa16230a391d2e61e75fcc62a57ee569416d7c55ab4e8cd7487813b5dd_volume_size - sensor.9bfb74e2a728618f9c3c1a363d2ccb3bba6e0580a14b3ca6f32afa4dea827b25_volume_size - sensor.a5f10bca01c2cdda3915951e27eef9fcd39a7eae695e3e9b21850550d7d91e29_volume_size - sensor.a5f10bca01c2cdda3915951e27eef9fcd39a7eae695e3e9b21850550d7d91e29c_volume_size - sensor.a6fd445f48ed6892eb26e97814cb7720758588101a441e6b3ffe117cb55f612c_volume_size - sensor.dc429dc8845534e799ea6170bb3a9fb79db3dbb08db6ed198a396f2aadaa1a85_volume_size - sensor.de3d33e1a75cb2d24f5f7f27f4d9bb1f814d72ef9229000a2bf9372e421dfaaf_volume_size - sensor.deaf7fea946c0cd1a40d161ab66367fddc1f99c2a5aae7bf4ad99b47fe25283c_volume_size - sensor.openrecord_local_openrecord_next_cache_volume_size - sensor.openrecord_local_openrecord_scrapers_node_modules_volume_size - sensor.openrecord_local_openrecord_web_node_modules_volume_size - type: custom:button-card template: bearstone_infra_docker_volume_row entity: sensor.docker69_volume_disk_usage_total_size name: docker_69 variables: total_entity: sensor.docker69_volume_disk_usage_total_size # ------------------------------------------------------------------- # Exceptions only; full inventory is a hidden subview # ------------------------------------------------------------------- - 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: Workload Exceptions - 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 ids = states['sensor.docker_monitored_switch_inventory']?.attributes?.entity_id; const total = Array.isArray(ids) ? ids.filter(id => !String(id).endsWith('_container_2')).length : (states['sensor.docker_monitored_container_count']?.state ?? '0'); return `${unavailable}/${total} unavailable`; ]]] - type: custom:auto-entities show_empty: false 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 state: 'off' options: type: custom:button-card template: bearstone_infra_list_row_running icon: mdi:package-variant-closed-remove state_display: '[[[ return "STACK DOWN"; ]]]' sort: method: name - type: custom:auto-entities show_empty: false 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: template: | [{% for entity_id in state_attr('sensor.docker_monitored_switch_inventory', 'entity_id') or [] %} {% if not entity_id.endswith('_container_2') and states(entity_id) == 'off' %} {'entity': '{{ entity_id }}', 'type': 'custom:button-card', 'template': 'bearstone_infra_container_row', 'icon': 'mdi:docker'}, {% endif %} {% endfor %}] sort: method: name - type: custom:button-card template: bearstone_infra_list_row entity: sensor.docker_monitored_container_count name: Open Full Docker Inventory icon: mdi:format-list-bulleted-square state_display: > [[[ const ids = states['sensor.docker_monitored_switch_inventory']?.attributes?.entity_id; const unique = Array.isArray(ids) ? ids.filter(id => !String(id).endsWith('_container_2')).length : entity.state; return `${unique} monitored workloads`; ]]] tap_action: action: navigate navigation_path: /dashboard-infrastructure/docker-inventory # Existing confirmed host maintenance popups are intentionally reused. - type: grid column_span: 4 columns: 1 square: false cards: - !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