Home Assistant integration doesn't currently support Pi-hole v6

I'm not sure if this has been discussed before (I didn't find anything while searching) and it's not entirely relevant to Pi-hole v6 development, but I thought I would mention it here in case it helps anyone:

I use two Pi-holes, Pi-hole v5 AND Pi-hole v6 beta and I have the Pi-hole 'integration' configured in my Home Assistant setup.

Unfortunately, the current Pi-hole integration in Home Assistant, doesn't appear to work with Pi-hole v6 (I believe the API has moved/changed).

The current integration diagnostic reports:

},
"data": {
"error": {
"key": "bad_request",
"message": "Bad request",
"hint": "The API is hosted at pi.hole/api, not pi.hole/admin/api"
},
"took": 0.0002002716064453125
},
"versions": {
"error": {
"key": "bad_request",
"message": "Bad request",
"hint": "The API is hosted at pi.hole/api, not pi.hole/admin/api"
},
"took": 0.00019049644470214844
}
}
}

There is a GitHub issue to update the Home Assistant integration, but I'm not sure if it has progressed as yet:

https://github.com/home-assistant/core/issues/130245

2 Likes

As the hint suggested, the API location has changed. This is something that needs to be addressed on the home-assistant side.

1 Like

looks orignal dev for Pi-Hole integration in HA has abaonded the development. We can only hope that someone else with such knowledge/skills can pick it up now. I have disabled the integration in HA for now.

Probably some HA developer (or user) will create a new integration.

I never used HA, but you can take a look in the example from our documentation:

Or search the Discourse forum to find similar topic, like this one:

I've developed a quick integration for Home Assistant that supports the new Pi-hole API, offering the main features.

Check it out here: GitHub - bastgau/ha-pi-hole-v6: 🛡️ This custom integration restores compatibility between Home Assistant and Pi-hole, which is no longer supported by the native integration due to API changes.

I hope you find it useful! Feel free to try it out and contribute if you have any ideas for improvement.

7 Likes

hey bastgau - appreciate you jumping on this. Can you provide any guidance on working through this error "Failed to connect to the server. Ensure that the server address and the port are correct." when setting up your Pi-hole V6 Integration in Home Assistant?

I know the API changed in V6, and for me, the port of my Pi-holes changed too. I tried the IP address of my Pi-hole 6 also tried it with the 8080 new port and old 80 port with my web UI password and also tried the webserver.api.pwhash from the Pi-hole settings but nothing worked.

Sorry if I missed any instructions on the repo.

Hello.

Can you open an issue on the repository ?

Thanks.

1 Like

Works fine to me!
The only thing that is not working, but it's not so important, is that you dont have feedback to Home Assistant if you turn off Pi-Hole from its web interface.
The opposite works instantly.
Thank you very much!

Yep, the integration pull the information every 5 minutes through Pi-hole API.

You can change this frequency via an automation if you need a refresh quicker.

1 Like

Ok thanks for the information,
Can you give me a hint for that?
How i can do this?

Just created a page to explain how you can do it : ha-pi-hole-v6/docs/guide-configuring-refresh.md at c81889932536880a9144a3250e53a046008e83f2 · bastgau/ha-pi-hole-v6 · GitHub

Great!
It works fine
I also change the symbols with the * and now it synchronise almost simultaneously

Thanks a lot!

You have activated a refresh every seconds ? Not sure it's a good idea ...

Why are you saying that?
You think that will cause problems to HA or network maybe?

Just upgraded pi-hole to v6 and migrated to your integration.

Process:
Backup: HA and Pi-Hole.
HA/HACS: Install Pi-hole v6 integration
Upgrade: Pi-hole to v6
HA/Settings: Remove HA Pi-Hole integration
HA/Settings: Add Pi-hole v6 integration and configure for pi-hole url/password

When complete, the original sensor and entity names remain the same.
All of my dashboards still worked, and all sensor histories were retained.

Thank you!!

1 Like

I've just add this v6 compatible integration and it works great, thanks!

1 Like

This is great, thank you!

1 Like