Core: Pi-Hole integration is no reaching Pi-Hole Hass.io addon

Created on 19 Sep 2019  ·  15Comments  ·  Source: home-assistant/core

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": []
}
pi_hole

All 15 comments

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

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!

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

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

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

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

@johnluetke, can you take a look please?

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?

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
}

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.

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

@Poeschl @pkishino Self signed or trusted certs?

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

I’ve got letsencrypt certs, but recently moved most of my services to
internal lan only..but haven’t disabled SSL for it so that is why verified
is false

On Mon, Sep 23, 2019 at 2:44, Markus Pöschl notifications@github.com
wrote:

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


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/home-assistant/home-assistant/issues/26747?email_source=notifications&email_token=AA7OFYVE6WXASFP3KGWRDLLQK6VGJA5CNFSM4IYQDWUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7JLFXQ#issuecomment-533902046,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA7OFYQFO3G3CEOYAE7SYI3QK6VGJANCNFSM4IYQDWUA
.

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

Was this page helpful?
0 / 5 - 0 ratings