From 3d5693ceaa5cafdaa457436377d546a926c03d20 Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Thu, 4 Dec 2025 08:47:45 +0100 Subject: [PATCH] Migrated deprecated template sensors to modern way. --- sensors.yaml | 14 -------------- template.yaml | 10 ++++++++++ 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/sensors.yaml b/sensors.yaml index e51b5b5..ae88765 100644 --- a/sensors.yaml +++ b/sensors.yaml @@ -46,20 +46,6 @@ entity_id: sensor.internet_speed_out sampling_size: 10 - - platform: template - sensors: - sun_rising_template: - friendly_name: "Sun Rising Template" - unique_id: '0680294616247' - value_template: "{{ as_timestamp(states.sun.sun.attributes.next_rising) | timestamp_custom ('%H:%M') }}" - - - platform: template - sensors: - sun_setting_template: - friendly_name: "Sun Setting Template" - unique_id: '8298170865533' - value_template: "{{ as_timestamp(states.sun.sun.attributes.next_setting) | timestamp_custom ('%H:%M') }}" - # Sensor for Riemann sum of energy import (W -> Wh) - platform: integration source: sensor.power_import diff --git a/template.yaml b/template.yaml index fe35dd6..b20fa1e 100644 --- a/template.yaml +++ b/template.yaml @@ -39,6 +39,16 @@ data: value: "{{ option }}" - sensor: + - unique_id: 0680294616247 + default_entity_id: sensor.sun_rising_template + name: Sun Rising Template + state: '{{ as_timestamp(states.sun.sun.attributes.next_rising) | timestamp_custom + (''%H:%M'') }}' + - unique_id: '8298170865533' + default_entity_id: sensor.sun_setting_template + name: Sun Setting Template + state: '{{ as_timestamp(states.sun.sun.attributes.next_setting) | timestamp_custom + (''%H:%M'') }}' - name: "power_other" unique_id: '5579422933393' unit_of_measurement: "W"