diff --git a/_docs/entities/greenness_forecast.md b/_docs/entities/greenness_forecast.md index 8408bde2..d86a442c 100644 --- a/_docs/entities/greenness_forecast.md +++ b/_docs/entities/greenness_forecast.md @@ -112,7 +112,7 @@ Standard calendar attributes will indicate the current/next highlighted greener ### Automation Example -Below is an example of raising a persistent notification 5 minutes before a saving session starts. +Below is an example of raising a persistent notification 5 minutes before a Greenness night with a greenness score of at least 50 starts. ```yaml triggers: @@ -120,6 +120,10 @@ triggers: entity_id: calendar.octopus_energy_{{ACCOUNT_ID}}_greener_nights event: start offset: -00:05:00 +conditions: + - condition: template + value_template: |- + {{ state_attr('trigger.entity_id','greenness_score') > 50 }} actions: - action: persistent_notification.create data: @@ -128,4 +132,4 @@ actions: {% set minutes = ((state_attr(trigger.entity_id, 'end_time') | as_datetime - state_attr(trigger.entity_id, 'start_time') | as_datetime).seconds / 60) | round(0) | string %} {% set start_time = (state_attr(trigger.entity_id, 'start_time') | as_datetime).strftime('%H:%M') %} Greener night starts at {{ start_time }} for {{ minutes }} minutes. -``` \ No newline at end of file +```