Pi-hole

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

配置

要将 Pi-hole integration 添加到您的 Home Assistant 实例中,请使用此 My 按钮:

手动配置步骤

如果上述 My 按钮不起作用,您也可以手动执行以下步骤:

During the setup, it will ask for the following:

Item Description Example
Host The IP or domain name to Pi-Hole 192.168.1.1
Port Port used to get to the admin page 80
Name Name to for this Pi-Hole. Pi-Hole
Location the path to the admin page. /admin

The combined host, port and location should take you to the login page of Pi-Hole. Using the example above, it would be http://192.168.1.1:80/admin.

If your Pi-hole web interface is password protected, an API key will be requested by Home Assistant after submitting the initial details above. You can get the API key by logging into your Pi-Hole and going to from Settings > API and then the Show API token button.

Actions

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

Action pi_hole.disable

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

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

Example action:

# Example action to disable Pi-Hole for 30 minutes
action: pi_hole.disable
data:
  duration: '00:30'
target:
  entity_id: all

Switches

The integration creates a switch for the Pi-hole allowing you to toggle the Pi-hole on and off.