Add referencing sensor entities for before/after in time conditions (#18115)

This commit is contained in:
Franck Nijhof 2021-06-07 18:24:16 +02:00 committed by GitHub
parent 6a81548dc6
commit c1f6e7ef5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -474,15 +474,29 @@ A better weekday condition could be by using the [Workday Binary Sensor](/integr
</div>
For the `after` and `before` options a time helper (`input_datetime` entity) can be used instead.
For the `after` and `before` options a time helper (`input_datetime` entity)
or another `sensor` entity containing a timestamp with the "timestamp" device
class, can be used instead.
```yaml
condition:
condition: time
after: input_datetime.house_silent_hours_start
before: input_datetime.house_silent_hours_end
- alias: "Example referencing a time helper"
condition: time
after: input_datetime.house_silent_hours_start
before: input_datetime.house_silent_hours_end
- alias: "Example referencing another sensor"
after: sensor.groceries_delivery_time
```
<div class='note warning'>
Please note that the time condition only takes the time into account. If
an referenced sensor or helper entity contains a timestamp with a date, the
date part is fully ignored.
</div>
## Zone condition
Zone conditions test if an entity is in a certain zone. For zone automation to work, you need to have set up a device tracker platform that supports reporting GPS coordinates.