Add config flow for Times of day (#22143)

Co-authored-by: Erik Montnemery <erik@montnemery.com>
This commit is contained in:
Franck Nijhof 2022-03-28 15:25:47 +02:00 committed by GitHub
parent c713378903
commit c03ce6c5a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,20 +6,34 @@ ha_category:
ha_release: 0.89
ha_iot_class: Local Push
ha_quality_scale: internal
ha_config_flow: true
ha_domain: tod
ha_platforms:
- binary_sensor
---
The `tod` platform supports binary sensors which get their values by checking if the current time is within defined time ranges.
The Times of the Day integration provides a binary sensor that gets its values by checking if the current time is within defined time ranges.
{% include integrations/config_flow.md %}
{% configuration_basic %}
Name:
description: The name the binary sensor should have. This can be changed later.
On time:
description: The time when the sensor should turn on.
Off time:
description: The time when the sensor should turn off.
{% endconfiguration_basic %}
## YAML Configuration
Alternatlively, this integration can be configured and set up manually via YAML instead. This has some additional functionality over the UI version.
The time ranges can be provided as absolute local time or using the `sunrise` or `sunset` keyword calculated based on the sun position for location. The location must be provided in the configuration.
In addition for sun position based ranges, the negative or positive offset can be configured.
## Configuration
Here is an example of adding a sensor to the `configuration.yaml` file:
To enable the Times of Day binary sensor in your installation, add the
following to your `configuration.yaml` file:
```yaml
# Example configuration.yaml entry