Pi-hole


The pi_hole integration allows you to retrieve statistics and interact with a Pi-hole system.

Configuration

To enable this integration, go to the Integrations page inside the configuration panel. You can also use YAML configuration. Add the following lines to your configuration.yaml file

# Example configuration.yaml entry
pi_hole:
  - host: IP_ADDRESS

Configuration Variables

host

(string)(Required)

The hostname (and port), e.g., ‘192.168.0.3:4865’ of the host where Pi-hole is running. Home Assistant add-on users should be sure to specify port 4865.

name

(string)(Optional)

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.

Default value:

Pi-hole

location

(string)(Optional)

The installation location of the Pi-hole API.

Default value:

admin

ssl

(boolean)(Optional)

If true, use SSL/TLS to connect to the Pi-hole system.

Default value:

false

verify_ssl

(boolean)(Optional)

Verify the SSL/TLS certificate of the system. If your Pi-hole instance uses a self-signed certificate, you should specify false.

Default value:

true

api_key

(string)(Optional)

API Key for interacting with the Pi-hole. This is not required if you want to just query the Pi-hole for usage statistics.

Default value:

None

Full examples

Single Pi-hole running via Home Assistant add-on:

pi_hole:
  - host: 'localhost:4865'

Multiple Pi-holes:

pi_hole:
  - host: '192.168.0.2'
  - host: '192.168.0.3'
    name: 'Secondary Pi-hole'

Pi-hole with a self-signed certificate:

pi_hole:
  - host: 'pi.hole'
    ssl: true
    verify_ssl: false

Pi-hole with an api_key that allows it to be enabled or disabled:

pi_hole:
  - host: 'pi.hole'
    api_key: !secret pi_hole_api_key

Services

The platform provides the following services to interact with your Pi-hole.

Service pi_hole.disable

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

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.

This integration was not made by Pi-hole LLC or the Pi-hole community. They did not provide support, feedback, testing, or any other help during its creation. This is a third party platform which may break if Pi-hole changes their API in a later release. It is not official, not developed, not supported, and not endorsed Pi-hole LLC or the Pi-hole community. The trademark Pi-hole and the logo is used here to describe the platform. Pi-hole is a registered trademark of Pi-hole LLC.