You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

304 lines
10 KiB

######################################################################
# @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, NAS capacity, 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.
# Notes: Synology NAS/NVR temperatures stay with their storage telemetry, not household temperature cards.
# Notes: Storage Health includes the persisted nightly Duplicati verification result and last successful backup time.
######################################################################
# -------------------------------------------------------------------
# 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: >
[[[ return `${entity.state} workloads`; ]]]
tap_action:
action: navigate
navigation_path: /dashboard-infrastructure/docker-inventory
- 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 durable NAS capacity history
# -------------------------------------------------------------------
- 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: Storage Health
- type: grid
columns: 2
square: false
cards:
- type: custom:button-card
template: bearstone_infra_list_row
entity: sensor.carlo_nas01_temperature
name: NAS Temperature
icon: mdi:nas
- type: custom:button-card
template: bearstone_infra_list_row
entity: sensor.carlo_nvr_temperature
name: NVR Temperature
icon: mdi:video-box
- type: custom:button-card
template: bearstone_infra_status_kpi
entity: input_text.infra_duplicati_backup_verification_status
name: Docker Config Backup
icon: mdi:backup-restore
variables:
ok_state: verified
state_display: >
[[[
const status = String(entity?.state ?? 'unverified').toLowerCase();
const raw = String(states['input_datetime.infra_duplicati_backup_last_success']?.state ?? '');
const parsed = raw ? new Date(raw.replace(' ', 'T')) : null;
const when = parsed instanceof Date && !Number.isNaN(parsed.getTime())
? parsed.toLocaleString('en-US', {
month: 'short',
day: 'numeric',
hour: 'numeric',
minute: '2-digit'
}).toUpperCase()
: 'NO SUCCESS TIME';
if (status === 'verified') return `SUCCESS · ${when}`;
if (status === 'failed') return `FAILED · LAST SUCCESS ${when}`;
return `UNVERIFIED · LAST SUCCESS ${when}`;
]]]
# Core statistics-graph is required because mini-graph-card can only read
# the 180-day recorder window, while long-term statistics retain 12 months.
- type: statistics-graph
title: NAS + NVR Used Space - 12 Months
chart_type: line
days_to_show: 365
period: month
stat_types:
- mean
- max
entities:
- entity: sensor.carlo_nas01_volume_1_used_space
name: NAS Used Space
- entity: sensor.carlo_nvr_volume_1_used_space
name: NVR Used Space
card_mod:
style: !include /config/dashboards/infrastructure/card_mod/infra_card.yaml
# -------------------------------------------------------------------
# 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 total = 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
# 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

Powered by TurnKey Linux.