diff --git a/atom.xml b/atom.xml index 8b1ad1a53f..68659131dd 100644 --- a/atom.xml +++ b/atom.xml @@ -4,7 +4,7 @@
This example shows how to change the icon based on the day/night cycle.
+sensor:
+ - platform: template
+ sensors:
+ day_night:
+ friendly_name: 'Day/Night'
+ value_template: '{% if is_state("sun.sun", "above_horizon") %}Day{% else %}Night{% endif %}'
+ icon_template: '{% if is_state("sun.sun", "above_horizon") %}mdi:weather-sunny{% else %}mdi:weather-night{% endif %}'
+
+
+