From 2918b73d3e524b337ec90210cad21ed06e00ea86 Mon Sep 17 00:00:00 2001 From: Claus Dethlefsen Date: Thu, 9 Apr 2026 17:04:22 +0200 Subject: [PATCH] Replace deprecated sensor.hacs with new template sensor hacs_opdateringer --- dashboards/views/11_vedligehold.yaml | 6 +++--- include/templates/maintenance.yaml | 17 +++++++++++++++-- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/dashboards/views/11_vedligehold.yaml b/dashboards/views/11_vedligehold.yaml index 6d15053..bf0afeb 100644 --- a/dashboards/views/11_vedligehold.yaml +++ b/dashboards/views/11_vedligehold.yaml @@ -89,7 +89,7 @@ sections: state: "on" card: type: tile - entity: sensor.hacs + entity: sensor.hacs_opdateringer name: HACS opdateringer - type: conditional @@ -98,11 +98,11 @@ sections: entity: input_boolean.vis_alle_vedligehold state: "off" - condition: numeric_state - entity: sensor.hacs + entity: sensor.hacs_opdateringer above: 0 card: type: tile - entity: sensor.hacs + entity: sensor.hacs_opdateringer name: HACS opdateringer - type: grid diff --git a/include/templates/maintenance.yaml b/include/templates/maintenance.yaml index e216393..025d0f1 100644 --- a/include/templates/maintenance.yaml +++ b/include/templates/maintenance.yaml @@ -77,7 +77,7 @@ {{ is_state('binary_sensor.home_assistant_website_update_available', 'on') or is_state('update.hacs_update', 'on') - or states('sensor.hacs') | int(0) > 0 + or states('sensor.hacs_opdateringer') | int(0) > 0 }} - name: Vedligehold affald @@ -130,6 +130,19 @@ {{ states('sensor.dethlefsen_drive_4_status') | lower not in ['normal', 'unknown', 'unavailable', 'none'] }} - sensor: + - name: HACS opdateringer + unique_id: hacs_pending_updates + unit_of_measurement: opdateringer + icon: mdi:package-variant + state: >- + {{ + integration_entities('hacs') + | select('search', '^update\.') + | map('states') + | select('eq', 'on') + | list | count + }} + - name: Antal vedligeholdskort unique_id: maintenance_cards_count unit_of_measurement: kort @@ -139,7 +152,7 @@ [ 1 if is_state('binary_sensor.home_assistant_website_update_available', 'on') else 0, 1 if is_state('update.hacs_update', 'on') else 0, - 1 if states('sensor.hacs') | int(0) > 0 else 0, + 1 if states('sensor.hacs_opdateringer') | int(0) > 0 else 0, 1 if is_state('binary_sensor.dethlefsen_security_status', 'on') else 0, 1 if is_state('update.dethlefsen_dsm_update', 'on') else 0, 1 if is_state('binary_sensor.vedligehold_synology_disk_1_status', 'on') else 0,