Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions _docs/entities/greenness_forecast.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,18 @@ 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:
- trigger: calendar
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:
Expand All @@ -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.
```
```