why keep track any more?

This commit is contained in:
CeeWeasel
2025-12-03 20:23:33 -05:00
parent 7b8fbb063e
commit 921c3df342
52 changed files with 1985 additions and 1419 deletions
+23 -12
View File
@@ -1,21 +1,22 @@
platform: template
sensors:
sun_elevation:
unique_id: templatesensor.sun_elevation
value_template: "{{ state_attr('sun.sun', 'elevation') }}"
unit_of_measurement: "degrees"
icon_template: >
template:
- sensor:
- unique_id: templatesensor.sun_elevation
unit_of_measurement: degrees
default_entity_id: sensor.sun_elevation
icon: >
{% set elevation = state_attr('sun.sun', 'elevation')|default(0) %}
{% if elevation > 0 %}
mdi:weather-sunny
mdi:weather-sunny
{% else %}
mdi:weather-night
{% endif %}
state: '{{ state_attr("sun.sun", "elevation") }}'
name: sun_elevation
period_of_day:
unique_id: templatesensor.period_of_day
friendly_name: Period of the Day
value_template: >-
- unique_id: templatesensor.period_of_day
default_entity_id: sensor.period_of_day
name: Period of the Day
state: >-
{% if (as_timestamp(states.sun.sun.attributes.next_dusk)) - (as_timestamp(states.sun.sun.attributes.next_setting)) < 0 %}
Dusk
{% elif (as_timestamp(states.sun.sun.attributes.next_rising)) - (as_timestamp(states.sun.sun.attributes.next_dawn)) < 0 %}
@@ -24,4 +25,14 @@ sensors:
Night
{% else %}
Day
{% endif %}
icon: >
{% if is_state("sensor.period_of_day", "Dawn") %}
mdi:weather-sunset-up
{% elif is_state("sensor.period_of_day", "Dusk") %}
mdi:weather-sunset-down
{% elif is_state("sensor.period_of_day", "Night") %}
mdi:moon-waxing-crescent
{% elif is_state("sensor.period_of_day", "Day") %}
mdi:weather-sunny
{% endif %}