Update docs for configuration multiple Pi-holes (#10758)

* Update docs for configuration multiple Pi-holes

* Code review
This commit is contained in:
John Luetke 2019-12-12 11:05:05 -08:00 committed by Franck Nijhof
parent d6aed6e1a0
commit bb35f515fd

View File

@ -8,7 +8,7 @@ logo: pi_hole.png
ha_release: 0.28
---
The `pi_hole` integration allows you to retrieve statistics and interact with a single [Pi-hole](https://pi-hole.net/) system.
The `pi_hole` integration allows you to retrieve statistics and interact with a [Pi-hole](https://pi-hole.net/) system.
## Configuration
@ -17,16 +17,23 @@ To enable this integration with the default configuration, add the following lin
```yaml
# Example configuration.yaml entry
pi_hole:
- host: IP_ADDRESS
```
{% configuration %}
host:
description: >
The hostname (and port), e.g., '192.168.0.3:4865' of the host where Pi-hole is running. If your Pi-Hole instance is the Hass.io add-on, you *must* specify port `4865`.
The hostname (and port), e.g. '192.168.0.3:4865' of the host where Pi-hole is running. Hass.io add-on users should be sure to specify port `4865`.
required: true
type: string
name:
description: >
The name for this Pi-hole. This name will be a part of the sensors created, e.g. `name: My Awesome Pi-hole` would result in sensor names beginning with `sensor.my_awesome_pi_hole_`.
**Note:** If you configure multiple Pi-Holes, each one *must* have a unique name.
required: false
type: string
default: pi.hole
default: Pi-hole
location:
description: The installation location of the Pi-hole API.
required: false
@ -50,14 +57,39 @@ api_key:
default: None
{% endconfiguration %}
### Full example
### Full examples
Single Pi-hole running via Hass.io add-on:
```yaml
# Example configuration.yaml entry
pi_hole:
host: 'localhost:4865'
ssl: false
verify_ssl: false
- host: 'localhost:4865'
```
Multiple Pi-holes:
```yaml
pi_hole:
- host: '192.168.0.2'
- host: '192.168.0.3'
name: 'Secondary Pi-Hole'
```
Pi-hole with a self-signed certificate:
```yaml
pi_hole:
- host: 'pi.hole'
ssl: true
verify_ssl: false
```
Pi-hole with an `api_key` that allows it to be enabled or disabled:
```yaml
pi_hole:
- host: 'pi.hole'
api_key: !secret pi_hole_api_key
```
## Services
@ -66,17 +98,22 @@ The platform provides the following services to interact with your Pi-hole.
### Service `pi_hole.disable`
Disable your Pi-hole for the specified amount of time.
Disables configured Pi-hole(s) for the specified amount of time.
| Service data attribute | Required | Type | Description |
| ---------------------- | -------- | -------- | ----------- |
| `duration` | `True` | timedelta | Time for which Pi-hole should be disabled |
| `name` | `False` | string | If preset, disables the named Pi-hole, otherwise, disables all configured Pi-holes |
_Note: This service requires `api_key` to be specified in the configuration._
### Service `pi_hole.enable`
Enable your Pi-hole.
Enables configured Pi-holes(s).
| Service data attribute | Required | Type | Description |
| ---------------------- | -------- | -------- | ----------- |
| `name` | `False` | string | If preset, enables the named Pi-hole, otherwise, enables all configured Pi-holes |
_Note: This service requires `api_key` to be specified in the configuration._