Skip to content
A Domoticz plugin that retrieves data from Pi-hole, a black hole for internet advertisements. With this plugin you also can switch off/on Pi-hole.
Branch: master
Clone or download
Latest commit a10d37e Feb 18, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE Create LICENSE Jan 30, 2018
README.md Update README.md Feb 13, 2018
plugin.py Update plugin.py Feb 18, 2018
xfr_pihole.zip Add files via upload Dec 25, 2017

README.md

Pi-hole Summary

This Domoticz plugin retrieves data from Pi-hole, a black hole for internet advertisements. Also a switch is added to enable/disable Pi-hole on your network.

Prerequisites

You must have Pi-hole installed. See https://pi-hole.net/ for more information.

Description

This plugin is calling the Pi-hole API by using http://<pihole adrress>/admin/api.php?summaryRaw. This will return:

{"domains_being_blocked":106002,"dns_queries_today":9341,"ads_blocked_today":1812,"ads_percentage_today":19.398352,"unique_domains":1387,"queries_forwarded":5522,"queries_cached":1820,"clients_ever_seen":8,"unique_clients":8,"status":"enabled"}

This plugin will create 10 devices. One of them is a switch (if the API Token is filled in) with which you can switch On or Off Pi-hole. The others devices gives you summary data from Pi-hole.

Installation

Python version 3.4 or higher required & Domoticz version 3.87xx or greater. To install:

  • Go in your Domoticz directory using a command line and open the plugins directory.
  • Run: git clone https://github.com/Xorfor/Domoticz-Pi-hole-Plugin.git
  • Restart Domoticz with sudo systemctl restart domoticz.

In the web UI, navigate to the Hardware page. In the hardware dropdown there will be an entry called "Pi-hole summary".

Updating

To update:

  • Go in your Domoticz directory using a command line and open the plugins directory then the Domoticz-Pi-hole-Plugin directory.
  • Run: git pull
  • Restart Domoticz with sudo systemctl restart domoticz.

Parameters

Parameter Value
Pi-hole address eg. pi-hole, or 192.168.1.231
Port default is 80
API Token required to switch on/off Pi-hole
Debug default is False

API Token

The API Token can be found in the Pi-hole web interface:

  1. Goto your Pi-hole web interface, eg. //192.168.1.231/admin/index.php
  2. Login
  3. Goto Settings -> API / Web interface
  4. Click on Show API token

Or from the command line more /etc/pihole/setupVars.conf, and look for the value of WEBPASSWORD.

You can’t perform that action at this time.