Add offset instructions to automation trigger (#26963)

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
Robert Lagus 2023-04-25 09:26:08 +02:00 committed by GitHub
parent 8f1cf94b9f
commit 28b13f9408
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,23 +51,25 @@ sun:
<img src='/images/screenshots/more-info-dialog-sun.png' /> <img src='/images/screenshots/more-info-dialog-sun.png' />
</p> </p>
## Implementation Details ## Automation trigger
The sun's event listener will call the service when the sun rises or sets with The sun's event listener will call the service when the sun rises or sets with
an offset. an offset.
The sun event need to have the type 'sun', which service to call, The sun trigger need to have the type 'sun', which event (sunset or sunrise) and an optional offset.
which event (sunset or sunrise) and the offset.
```json ```yaml
{ trigger:
"type": "sun", - platform: sun
"service": "switch.turn_on", event: sunrise
"event": "sunset", offset: "-01:00:01"
"offset": "-01:00:00"
}
``` ```
| Key name | Description |
| --------- | ----------- |
| `event` | Possible values: `sunset` or `sunrise`
| `offset` | An optional offset for the sun event trigger, in a positive or negative number of seconds, or specified in `HH:MM:SS` (after sun event trigger) or `-HH:MM:SS` (before sun event trigger).
### Maintains entity `sun.sun` ### Maintains entity `sun.sun`
| Possible state | Description | | Possible state | Description |