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


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
  - host: IP_ADDRESS

Configuration Variables

host string Required

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

name string (Optional, default: Pi-hole)

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_.

location string (Optional, default: admin)

The installation location of the Pi-hole API.

ssl boolean (Optional, default: false)

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

verify_ssl boolean (Optional, default: true)

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

api_key string (Optional, default: None)

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

Full examples

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

  - host: 'localhost:4865'

Multiple Pi-holes:

  - host: ''
  - host: ''
    name: 'Secondary Pi-hole'

Pi-hole with a self-signed certificate:

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

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

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


The platform provides the following services to interact with your Pi-hole. Use switch entities when calling the services.

Note: Switch entity requires api_key to be configured.

Service pi_hole.disable

Disables configured Pi-hole(s) for the specified amount of time.

Service data attribute Required Type Description
entity_id False string Target switch entity. Use all to target all Pi-hole services
duration True timedelta Time for which Pi-hole should be disabled