Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pi-Hole integration is no reaching Pi-Hole Hass.io addon #26747

Closed
Poeschl opened this issue Sep 19, 2019 · 15 comments · Fixed by #27073
Closed

Pi-Hole integration is no reaching Pi-Hole Hass.io addon #26747

Poeschl opened this issue Sep 19, 2019 · 15 comments · Fixed by #27073
Assignees

Comments

@Poeschl
Copy link
Contributor

Poeschl commented Sep 19, 2019

Home Assistant release with the issue:
0.99.0

Last working Home Assistant release (if known):
0.98.5

Operating environment (Hass.io/Docker/Windows/etc.):
Hass.io

Component/platform:
Pi-Hole platform #25837

Description of problem:
I'm currently running pi-hole as a hass.io addon and tried to migrate to the latest home assistant version. But the new pi-hole integration can't reach the dockerized pi-hole anymore. The only output I get over the logs is Can not load data from *hole: <host>, also no access to the pi-hole is logged on the addon.

First I migrated from the old config to the new one (both shown below) and tried afterwards all combinations of localhost, ip, and a0d7b954-pi-hole.local.hass.io with and without the api port 4832. The UI port 80 is disabled since I'm using the ingress feature of hass.io.

Old config:

- platform: pi_hole
    host: localhost:4865
    ssl: true
    verify_ssl: false
    monitored_conditions:
      - ads_blocked_today
      - ads_percentage_today

Migrated config:

pi_hole:
  host: localhost:4865
  ssl: true
  verify_ssl: false

Pi-Hole Hass.io Addon config

  • Version: 4.0.0
  • Mapped Ports:
    • 80 -> disabled
    • 53 -> 53
    • 4865 -> 4865
{
  "update_lists_on_start": false,
  "ssl": true,
  "certfile": "p-assist.crt",
  "keyfile": "p-assist.key",
  "interface": "eth0",
  "ipv6": false,
  "ipv4_address": "",
  "ipv6_address": "",
  "virtual_host": "p-assist.fritz.box",
  "hosts": []
}
@Kanga-Who
Copy link

Faced the same issue, and can confirm that this config fixes the issue. I have also posted about this in the blog updated on the forums with the same code last night.

https://community.home-assistant.io/t/0-99-withings-device-automations-launch-home-assistant-cast-from-python/137960/20

@probot-home-assistant
Copy link

Hey there @fabaff, mind taking a look at this issue as its been labeled with a integration (pi_hole) you are listed as a codeowner for? Thanks!

@frenck
Copy link
Member

frenck commented Sep 20, 2019

Seem that the Pi-hole integration no longer resolves hosts names. Not sure if that was intended or accidental.

@Poeschl
Copy link
Contributor Author

Poeschl commented Sep 20, 2019

@Kanga-Who
Unfortunately the raw IP also don't work for me here. Tried it with host: 192.168.0.37:4865 without success. I would also prefer hostnames instead of raw ip's, but that may be a different issue.

For more information I added also my pi-hole hass.io config above.

Copy link
Member

frenck commented Sep 20, 2019

for the add-on, please use 127.0.0.1, which is the same as localhost.

@Poeschl
Copy link
Contributor Author

Poeschl commented Sep 20, 2019

I tried that one as well :'
No request logged on the addon logs

@fabaff
Copy link
Member

fabaff commented Sep 21, 2019

@johnluetke, can you take a look please?

@johnluetke
Copy link
Contributor

This is interesting. I've tested connecting to my pihole via both pi.hole and IP address, and both have resolved correctly.

@Poeschl What happens if you disable SSL? Also, can you confirm that admin is the correct path to your instances API?

@Kanga-Who
Copy link

Kanga-Who commented Sep 22, 2019

This is my working config. Running Hass.io 0.99.2 over Ubuntu Server 18.04LTS, PiHole 4.0.0 via Hass.io Add-on.

pi_hole:
  host: 192.168.1.101:4865
{
  "update_lists_on_start": true,
  "ssl": false,
  "certfile": "",
  "keyfile": "",
  "interface": "",
  "ipv6": true,
  "ipv4_address": "",
  "ipv6_address": "",
  "virtual_host": "someaddress.ddns.net",
  "hosts": [],
  "password": "PASSWORD",
  "admin_port": 4865,
  "dns_port": 53
}

@Poeschl
Copy link
Contributor Author

Poeschl commented Sep 22, 2019

So I tested some different scenarios and came up with the following results (ssl setting was set on addon and HA):

  • ssl: false + host: 127.0.0.1:4865 -> working ✔️
  • ssl: false + host: 192.168.0.37:4865 -> working ✔️
  • ssl: false + host: localhost:4865 -> working ✔️
  • ssl: false + host: p-assist.fritz.box:4865 -> working ✔️

  • ssl: true + host: 127.0.0.1:4865 -> failed ❌
  • ssl: true + host: 192.168.0.37:4865 -> failed ❌
  • ssl: true + host: localhost:4865 -> failed ❌
  • ssl: true + host: p-assist.fritz.box:4865 -> failed ❌

Log from working requests:

[22/Sep/2019:13:06:27 +0200] 200 -(127.0.0.1) GET /admin/api.php HTTP/1.1 (HomeAssistant/0.99.2 aiohttp/3.5.4 Python/3.7)

Log from failing requests:

[22/Sep/2019:12:53:17 +0200] 400 -(127.0.0.1) \x16\x03\x01\x02\x00\x01\x00\x01\xFC\x03\x03\x94\x1C%\xA9tr\x03\xEA,\xA9\xD7\x16H\xCD\xEEh\xB5\xDA\xA5\xDF*\x04\xB7x\xAF\xD2R\xEE``>\x88 \x15\xE5\xE8\xA6t\xDA\xB2\xBB\xA2z\x7F\xAD\xCC\xD0\xA8\xCA\x9B\x92\x89\xAA\x80C#\xBDf\xAE\x91{\x04S:K\x00>\x13\x02\x13\x03\x13\x01\xC0,\xC00\x00\x9F\xCC\xA9\xCC\xA8\xCC\xAA\xC0+\xC0/\x00\x9E\xC0$\xC0(\x00k\xC0#\xC0'\x00g\xC0 (-)

All requests are received by the addon it seems, but the ssl request is not correctly understood by it.

@pkishino
Copy link
Contributor

pkishino commented Sep 22, 2019

I have the same issue since upgrading..
new config is this:

pi_hole:
 ssl: true
 verify_ssl: false
 host: 10.1.125.10
 location: 'dns/admin'

old config in sensor.yaml:

- platform: pi_hole
  ssl: true
  verify_ssl: false
  host: 10.1.125.10
  location: 'dns/admin'
  monitored_conditions:
    - ads_blocked_today
    - ads_percentage_today
    - dns_queries_today
    - domains_being_blocked
    - queries_cached
    - queries_forwarded
    - unique_clients
    - unique_domains
    - clients_ever_seen 

I can curl it ok, worked fine pre-0.99.
pihole is running baremetal on a pi

@johnluetke
Copy link
Contributor

@Poeschl @pkishino Self signed or trusted certs?

@Poeschl
Copy link
Contributor Author

Poeschl commented Sep 22, 2019

I use certs from a self-signed CA.
verify_certs is also set to false in the config.

@pkishino
Copy link
Contributor

pkishino commented Sep 23, 2019 via email

@pkishino
Copy link
Contributor

I fixed this by updating my apache alias to direct / to /var/www/html/dns/ as well as use the fqdn as per ssl cert.
then in my configuration.yaml file I only use

pi_hole:
 ssl: true
 host: fqdn.host.name

works now, but yes, seems like verified=false isnt working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants