diff --git a/source/_cookbook/automation_sun.markdown b/source/_cookbook/automation_sun.markdown index fafc28a8a64..e83bec979e7 100644 --- a/source/_cookbook/automation_sun.markdown +++ b/source/_cookbook/automation_sun.markdown @@ -73,7 +73,7 @@ Solar elevation automations can cope with offsets from sunset / sunrise as the s trigger: platform: numeric_state entity_id: sun.sun - value_template: '{% raw %}{{ state.attributes.elevation }}{% endraw %}' + value_template: "{% raw %}{{ state_attr('sun.sun', 'elevation') }}{% endraw %}" below: 3.5 action: service: scene.turn_on @@ -83,7 +83,7 @@ Solar elevation automations can cope with offsets from sunset / sunrise as the s trigger: platform: numeric_state entity_id: sun.sun - value_template: '{% raw %}{{ state.attributes.elevation }}{% endraw %}' + value_template: "{% raw %}{{ state_attr('sun.sun', 'elevation') }}{% endraw %}" below: 1.5 action: service: scene.turn_on @@ -93,7 +93,7 @@ Solar elevation automations can cope with offsets from sunset / sunrise as the s trigger: platform: numeric_state entity_id: sun.sun - value_template: '{% raw %}{{ state.attributes.elevation }}{% endraw %}' + value_template: "{% raw %}{{ state_attr('sun.sun', 'elevation') }}{% endraw %}" below: -2.5 action: service: switch.turn_off