File tree 1 file changed +11
-7
lines changed 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -115,13 +115,17 @@ switch:
115
115
This example shows how to change the icon based on the day/night cycle.
116
116
117
117
` ` ` yaml
118
- sensor :
118
+ switch :
119
119
- platform: template
120
- sensors:
121
- day_night:
122
- friendly_name: 'Day/Night'
123
- value_template: {% raw %}'{% if is_state("sun.sun", "above_horizon") %}Day{% else %}Night{% endif %}'{% endraw %}
124
- icon_template: {% raw %}'{% if is_state("sun.sun", "above_horizon") %}mdi:weather-sunny{% else %}mdi:weather-night{% endif %}'{% endraw %}
125
-
120
+ switches:
121
+ garage:
122
+ value_template: {% raw %}"{{ is_state(cover.garage_door', 'on') }}"{% endraw %}
123
+ turn_on:
124
+ service: cover.open_cover
125
+ entity_id: cover.garage_door
126
+ turn_off:
127
+ service: cover.close_cover
128
+ entity_id: cover.garage_door
129
+ icon_template: {% raw %}"{% if is_state('cover.garage_door', 'open') %}mdi:garage-open{% else %}mdi:garage{% endif %}"{% endraw %}
126
130
` ` `
127
131
You can’t perform that action at this time.
0 commit comments