Update Hydrawise for config flow (#28108)

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
David Knowles 2023-09-26 06:52:52 -04:00 committed by GitHub
parent f420329f80
commit c96b446adb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,6 +6,7 @@ ha_category:
- Irrigation
- Sensor
- Switch
ha_config_flow: true
ha_release: 0.71
ha_iot_class: Cloud Polling
ha_domain: hydrawise
@ -27,114 +28,44 @@ There is currently support for the following device types within Home Assistant:
- [Sensor](#sensor)
- [Switch](#switch)
## Configuration
## Prerequisites
To enable it, add the following to your `configuration.yaml` file:
To set up the Hydrawise integration, you must first obtain an API Key.
```yaml
# Example configuration.yaml entry
hydrawise:
access_token: YOUR_API_KEY
```
1. Login at [https://app.hydrawise.com](https://app.hydrawise.com).
2. Go to **Account Details** under the **My Account** menu (in the upper-right-hand corner).
3. Under the **Account Settings** section, copy the **API Key**.
1. If no API Key is present, select the **Generate API Key** button.
{% configuration %}
access_token:
description: The API KEY assigned to your Hydrawise account.
required: true
type: string
scan_interval:
description: The time interval, in seconds, to poll the Hydrawise cloud.
required: false
type: integer
default: 120
{% endconfiguration %}
To get your API access token log into your [Hydrawise account](https://app.hydrawise.com/config/login) and in the 'My Account Details' section under Account Settings click 'Generate API Key'. Enter that key in your configuration file as `YOUR_API_KEY`.
{% include integrations/config_flow.md %}
## Binary Sensor
Once you have enabled the `hydrawise` integration, add the following to your `configuration.yaml` file:
Binary sensor entities are created for the controller:
```yaml
# Example configuration.yaml entry
binary_sensor:
- platform: hydrawise
```
{% configuration %}
monitored_conditions:
description: The binary sensors that should be displayed on the frontend.
required: false
type: list
default: All binary sensors are enabled.
keys:
is_watering:
description: The binary sensor is `on` when the zone is actively watering.
status:
description: This will indicate `on` when there is a connection to the Hydrawise cloud. It is not an indication of whether the irrigation controller hardware is online.
{% endconfiguration %}
- Cloud API availability
<div class='note warning'>
The Hydrawise API removed the ability to read the rain sensor status. Therefore it is no longer supported by the Hydrawise integration to Home Assistant.
</div>
<div class='note warning'>
Binary sensor entities are created for each zone:
The Hydrawise API uses rate limiting and might throw errors in case the `scan_interval` is too low or too many manual service calls are triggered:
The limit is 3 calls to start/stop/suspend a zone per 30 seconds and an additional limit across the entire API of 30 calls in a 5-minute period per user.
</div>
- Running status
## Sensor
Once you have enabled the `hydrawise` integration, add the following to your `configuration.yaml` file:
Sensor entities are added to each zone:
```yaml
# Example configuration.yaml entry
sensor:
- platform: hydrawise
```
{% configuration %}
monitored_conditions:
description: The sensors that should be displayed on the frontend.
required: false
type: list
default: All sensors are enabled.
keys:
watering_time:
description: The amount of time left if the zone is actively watering. Otherwise the time is 0.
next_cycle:
description: The day and time when the next scheduled automatic watering cycle will start.
{% endconfiguration %}
- Timestamp for the next scheduled automatic watering cycle
- Remaining time for the current watering cycle
## Switch
Once you have enabled the `hydrawise` integration, add the following to your `configuration.yaml` file:
Switches are added for each zone, controlling:
```yaml
# Example configuration.yaml entry
switch:
- platform: hydrawise
```
{% configuration %}
watering_minutes:
description: When manual watering is enabled this will determine the length of time in minutes that the irrigation zone will run. The allowed values are 5, 10, 15, 30, 45, or 60.
required: false
type: integer
default: 15
monitored_conditions:
description: Selects the set of switches that should be enabled on the frontend. Also sets the length of time a zone will run under manual control.
required: false
type: list
default: All switches are enabled.
keys:
auto_watering:
description: Enables the Smart Watering features for this zone.
manual_watering:
description: Enables the manual watering control for this zone.
{% endconfiguration %}
- Smart watering features
- Manual watering
### Switch Operation
@ -145,17 +76,3 @@ When `manual_watering` is `on` the zone will run for the amount of time set by `
<div class='note warning'>
Due to changes in the Hydrawise API the status of the Auto Watering switches has changed. Under normal conditions the Auto Watering switches correctly reflect the Smart Watering schedule on the Hydrawise mobile or web app. However, if a rain sensor is connected to the system and it is active (rain detected), or the zone is running the Auto Watering switch will turn off. After both of those conditions are removed the switch will again show the correct Auto Watering condition.
</div>
```yaml
# An example that enables all the switches, and sets the manual watering time to 20 minutes.
switch:
- platform: hydrawise
watering_minutes: 20
```
```yaml
# An example that enables only the manual control switches.
switch:
- platform: hydrawise
monitored_conditions: manual_watering
```