Pi-Hole Sensor

Pretty straightforward. Wished I had the time to pick up python because I’m sure this would be easy to do…

Pi-hole is essentially an easy to install network-wide ad-blocker. https://pi-hole.net

I noticed it has a straightforward API: https://github.com/pi-hole/pi-hole/#api

http://pi.hole/admin/api.php returns:

{ "domains_being_blocked": "136708", "dns_queries_today": "18108", "ads_blocked_today": "14648", "ads_percentage_today": "80.89" }

Not sure yet exactly how to integrate this information into my home automation, but at very least it could be incorporated into the monitoring and notification (<headshake>from Nagios to Home Assistant</headshake>.)

How about

sensor:
  - platform: rest
    name: Pi-Hole
    resource: http://IP_ADDRESS_PI_HOLE/admin/api.php
    value_template: '{{ value_json.dns_queries_today }}'

Let me think about a Pi-Hole sensor. This task should be done in a couple of minutes, I guess.

https://github.com/home-assistant/home-assistant/pull/3158

2 Likes