External integration - Pi-hole

cover-pihole

Hi everyone! :waving_hand:

The bank’s website that refuses to display, and Pi-hole which is obviously the culprit… :roll_eyes: Here’s Pi-hole in Gladys: your ad blocker stats, and especially the ability to pause blocking with a single gesture from the dashboard. Everything runs locally, via the Pi-hole API. It’s the little sister of @cicoub13’s AdGuard Home integration :wink:

What it does

  • :shield: One device per Pi-hole (up to 3: we often have a backup Pi-hole) with:
    • a « Blocking » switch;
    • DNS queries, blocked queries, the blocked share, and active clients over 24 hours;
    • domains in the block list and available updates.
  • :puzzle_piece: A widget with the figures from the last 24 hours, the status of each server (and remaining pause minutes), and buttons Pause 5 min, Pause 30 min, Pause… (custom duration), and Resume.
  • :clapper_board: Two scene actions: pause blocking (one server or all, in minutes) and resume it.
  • :bell: Five triggers: blocking paused (from Gladys or from the Pi-hole interface), blocking resumed, Pi-hole update available, Pi-hole not responding, and Pi-hole responding again.

The cool part

Pi-hole not responding → alert immediately (it’s the DNS for the whole house!) :police_car_light:
8:00 PM → blocking is resumed, in case a pause was forgotten :locked:
Someone paused Pi-hole from its interface → I’m notified :eyes:

Installation

:warning: Gladys 5.1 minimum (5.2 for the « Pause… » button with custom duration). Pi-hole v6 only.

:light_bulb: It will be available in the store later today. In a hurry? Integrations → Install from GitHub, with the address GitHub - guim31/gladys-pihole: Pi-hole for Gladys Assistant: DNS blocking statistics and control, on the local network · GitHub

  1. In Pi-hole: Settings → Web interface / API (Expert mode) → create an application password.
  2. In Gladys: enter the Pi-hole address and this password, then « Test connection ».
  3. Discovery tab: add your Pi-hole.

Honest caveats: the figures are for the last 24 hours, not the day, and there is no (yet) management of lists or clients.

:test_tube: Tested against a real Pi-hole v6 (Core 6.4.3, in a container): connection, stats, pause, automatic and manual resumption. It hasn’t run in a real Gladys yet, nor on a Pi-hole installation outside Docker: your feedback will be precious.

Like the previous ones, coded with the help of Claude Code :robot:. Independent project, not affiliated with Pi-hole.

Repository: GitHub - guim31/gladys-pihole: Pi-hole for Gladys Assistant: DNS blocking statistics and control, on the local network · GitHub

Do you have a Pi-hole? I’m counting on you :folded_hands:

1 Like