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:

1 Like

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.

5 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.

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