initial push

This commit is contained in:
CeeWeasel
2024-04-14 14:08:56 -04:00
commit 53bf393d14
1111 changed files with 71730 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
platform: template
sensors:
sun_elevation:
unique_id: templatesensor.sun_elevation
value_template: "{{ state_attr('sun.sun', 'elevation') }}"
unit_of_measurement: "degrees"
icon_template: >
{% set elevation = state_attr('sun.sun', 'elevation')|default(0) %}
{% if elevation > 0 %}
mdi:weather-sunny
{% else %}
mdi:weather-night
{% endif %}
period_of_day:
unique_id: templatesensor.period_of_day
friendly_name: Period of the Day
value_template: >-
{% 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 %}
Dawn
{% elif (states.sun.sun.attributes.elevation) < -4 %}
Night
{% else %}
Day
{% endif %}