This is an enhanced version of the Pi-hole Virtual Switch for Hubitat, originally created by Nick Veenstra, with contributions from cuboy29, harriscd, and Jed Brown. This driver allows you to control your Pi-hole instance from Hubitat, enabling on/off toggling, status checks, and automation integration.
- ✅ Enable or disable Pi-hole via a virtual switch in Hubitat.
- 🔄 Check the current status of Pi-hole.
- ⚡ Updated to comply with Pi-hole v6 API changes.
- 📦 Now installable via Hubitat Package Manager (HPM).
- 🛠️ Improved code structure, better logging, and added authentication handling.
With the release of Pi-hole v6, the API structure changed, requiring updates to the original driver. This version ensures compatibility with the latest Pi-hole release while improving maintainability, security, and performance.
- Open Hubitat Package Manager in your Hubitat interface.
- Choose Install → Search by Keywords.
- Search for Pi-hole Virtual Switch.
- Click Install and follow the on-screen instructions.
- Open Hubitat Web Interface → Drivers Code.
- Click + New Driver and paste the contents of
pi-hole-virtual-switch.groovy
. - Save the driver.
- Go to Devices → Add Virtual Device and select Pi-hole Virtual Switch as the driver.
- After installing, open the device page in Hubitat.
- Enter your Pi-hole API key and server URL in the device preferences.
- Save the settings.
- Use Hubitat automation or dashboards to toggle Pi-hole on/off.
To update the driver via HPM:
- Open Hubitat Package Manager.
- Select Update → Check for Updates.
- If an update is available, follow the instructions to install.
This project is based on the original Pi-hole Virtual Switch by Nick Veenstra, cuboy29, harriscd, and Jed Brown.
Major updates for Pi-hole v6 compatibility and HPM support were made by WalksOnAir.
I'm a single papa raising two amazing kiddos, and building cool things like this keeps me motivated (and sane!).
If this has been useful to you, and you feel like saying thanks, you can get me a beer or a coffee—no pressure, just appreciation.
Cheers! 🍻
This project is licensed under the Apache License, Version 2.0. See the LICENSE
file for details.