Skip to content

Instantly share code, notes, and snippets.

@thorrrr
Created February 24, 2021 14:02
Show Gist options
  • Save thorrrr/e6194f67b287e9e9b40c2eef71797472 to your computer and use it in GitHub Desktop.
Save thorrrr/e6194f67b287e9e9b40c2eef71797472 to your computer and use it in GitHub Desktop.
platform: template
sensors:
nextsunrise:
entity_id: sun.sun
friendly_name: 'Next Sunrise'
value_template: >
{{ as_timestamp(states.sun.sun.attributes.next_rising) | timestamp_custom(' %I:%M %p') | replace(" 0", "") }}
icon_template: mdi:weather-sunset-up
nextsunset:
entity_id: sun.sun
friendly_name: 'Next Sunset'
value_template: >
{{ as_timestamp(states.sun.sun.attributes.next_setting) | timestamp_custom(' %I:%M %p') | replace(" 0", "") }}
icon_template: mdi:weather-sunset-down
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment