home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.89k stars 30.12k forks source link

Pi-Hole Disable switch not working when Pi-Hole does not have a password #100259

Closed mwolter805 closed 4 months ago

mwolter805 commented 1 year ago

The problem

The disable switch created by the integration does not work. Receive the following log

2023-09-12 20:01:29.633 ERROR (MainThread) [hole] You need to supply an api_token to use this

When the switch is pressed, it turns off for a second, then turns on. Checked the Pi-Hole GUI and ad blocking was not disabled.

The HA Pi-Hole integration was added for the first time today and is not a previously working instance that has now stopped working. When adding the integration I was not prompted to input an API key, as there is no API key because there is no Pi-Hole password.

Screenshot 2023-09-12 at 8 30 51 PM

Statistics appear to be working fine, only the disable switch and service are not working. Disabling directly through the Pi-Hole GUI works fine.

Pi-Hole Version Docker Tag 2023.05.2 Pi-hole v5.17.1 FTL v5.23 Web Interface v5.20.1

What version of Home Assistant Core has the issue?

2023.9.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

pi_hole

Link to integration documentation on our website

https://www.home-assistant.io/integrations/pi_hole

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 year ago

Hey there @johnluetke, @shenxn, mind taking a look at this issue as it has been labeled with an integration (pi_hole) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `pi_hole` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign pi_hole` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


pi_hole documentation pi_hole source (message by IssueLinks)

mwolter805 commented 11 months ago

Additional context:

Setup uses traefik reverse proxy and authelia for authentication. Authelia is set for bypass for the Home Assistant IP address. Pi-hole admin password is disabled with WEBPASSWORD: "" in setupVars.conf.

And the following command works perfectly when ran from the Home Assistant container console:

curl -X GET 'https://pihole/admin/api.php?disable=5&auth='
Andreaj42 commented 10 months ago

To temporarily solve this issue, you can set a password for Pi-hole using the following command:

pi-hole -a -p

Once you've set the password, you can access the 'Show API Token' button under Settings/API in web interface. Home Assistant will ask you for this API token afterward.

tobse91 commented 9 months ago

I got the same issue.

DayandAge27 commented 8 months ago

I also have this issue

wavemop commented 8 months ago

Me too

issue-triage-workflows[bot] commented 5 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

mwolter805 commented 5 months ago

Hello, are there any plans to make the integration work without a pihole password?

rwblank commented 5 months ago

Having the exact same issue as described above. Both HA and PiHole are updated to current versions.