Home Assistant Community Add-on: Pi-hole

Having a issue with no long term data showing up, even after selecting different dates. I have Hassio installed on HassOS. To add to this, I do see network activity (a call to api_db.php) in Chrome’s network tool when I select a date but no information is returned.

Does this work for other people?

Is it possible to use this addon as DHCP server and keeping the configuration file that (standard) pihole has?

If yes where to put this configuration file?

:tada: Release v2.1.1

Full Changelog

  • Changed past to paste (#53) (@dayofdoom)
  • Upgrades git to 2.18.1-r0
  • Upgrades bind-tools to 9.12.3-r0
  • Upgrades openssl to 1.0.2q-r0
  • Fixes spelling mistake (#55) (@mjrider)
  • Upgrades Perl to 5.26.2-r1
  • Upgrades PHP to 7.2.10-r0
  • Upgrades Pi-hole to 4.1
  • Upgrades nginx to 1.14.2-r0

Questions? Join our Discord server! https://discord.me/hassioaddons
Enjoying my add-ons? Consider supporting my work: https://patreon.com/frenck

Currently I have my hassio and pihole systems running on two separate pi’s.

I did had and have problems running both on one device.
Lately my pi zero w with pihole running made some problems. I had to unplug it to make it work again.
Also my hassio runs on a raspi connected via ethernet (so this might my slightly faster and more reliable)
The main reason why I had to set this up, is because my router does not support nat loopback.
So I first used dnsmasq and than switched to pihole (because of its benefits).

Now I’d like to “merge” both systems to use only one ethernet connected device. So I installed the pihole addon on my hassio. (So I turned off my pi zero, changed the dns in my router to the ip of my hassio)
My setup looks the same like @tod36 posted above, but I’m facing issues with some components. Components like netamo, alexa-mediaplayer and some else don’t get connected. There is however an internet connection, because my ping sensor und Aqara componet work.

I get some errors, most about failing SSL handshakes.
I think this might be the problem (copied from one of the errors).

ssl.CertificateError: hostname 'localhost' doesn't match ‚XXXXXX.duckdns.org'

How can I solve this issue?

EDIT:

After commenting out the pihole-sensor the ssl errors are gone.

But still most of my components can’t connect. This is one example (tado):

Error during setup of component tado
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/urllib/request.py", line 1318, in do_open
    encode_chunked=req.has_header('Transfer-encoding'))
  File "/usr/local/lib/python3.6/http/client.py", line 1239, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.6/http/client.py", line 1285, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.6/http/client.py", line 1234, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.6/http/client.py", line 1026, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.6/http/client.py", line 964, in send
    self.connect()
  File "/usr/local/lib/python3.6/http/client.py", line 1392, in connect
    super().connect()
  File "/usr/local/lib/python3.6/http/client.py", line 936, in connect
    (self.host,self.port), self.timeout, self.source_address)
  File "/usr/local/lib/python3.6/socket.py", line 704, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  File "/usr/local/lib/python3.6/socket.py", line 745, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Try again

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/setup.py", line 148, in _async_setup_component
    component.setup, hass, processed_config)  # type: ignore
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/tado.py", line 47, in setup
    tado = Tado(username, password)
  File "/usr/local/lib/python3.6/site-packages/PyTado/interface.py", line 292, in __init__
    self._loginV2(username, password)
  File "/usr/local/lib/python3.6/site-packages/PyTado/interface.py", line 154, in _loginV2
    response = self.opener.open(req)
  File "/usr/local/lib/python3.6/urllib/request.py", line 526, in open
    response = self._open(req, data)
  File "/usr/local/lib/python3.6/urllib/request.py", line 544, in _open
    '_open', req)
  File "/usr/local/lib/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python3.6/urllib/request.py", line 1361, in https_open
    context=self._context, check_hostname=self._check_hostname)
  File "/usr/local/lib/python3.6/urllib/request.py", line 1320, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [Errno -3] Try again> 

I hope someone is able to help.

any advice would be helpful.

I also have a UniFi setup with a USG. I had the same issue as you. I was beta testing the dnsmasq dhcp server in the USG. Apparently there is a bug in the local hostnames not registering or something like that. So if you are also beta testing dnsmasq turn it off and go back to the old dhcp.

thanks for the tip, but I’m not beta testing any thing on my USG.

Hi,

I do not understand this now at all.
I installed the pihole as a add-on into hassio OS.

Made few conf changes ssl -> false, password and ipv6 -> false
and after
basic configuration.yaml setup.

After restarting the PI3 pihole admin-portal only works and perfectly. e.g. configurator is not available from any url.
What I am doing wrong or do not understand?

What’s the equivalent of /etc/unbound/unbound.conf.d/pi-hole.conf on Pihole within hass-io? I’m trying to resolve a Plex direct connect issue by adding private-domain: plex.direct to the file according to this link. But I can’t find the file, or the docker config location to edit or to create an environmental variable to the file.

Are you still having this issue? I’m having the issue still and have tried all the combinations you tried as well.

I have the same error

I have since some days the error that i do not get any data more from pi hole.
In the past it works fine.

PiHole

  • platform: pi_hole
    monitored_conditions:
    • ads_blocked_today
    • ads_percentage_today
    • dns_queries_today
    • domains_being_blocked
    • unique_clients
    • unique_domains
    • clients_ever_seen

Unable to fetch data from Pi-hole
22:40 components/sensor/pi_hole.py (ERROR)

Pi-hole Version v4.1.1 Web Interface Version v4.1.1 FTL Version v4.1.2
Any changes here ?

Home%20Assistant%202019-01-17%2022-54-10

You need to change the sensors from sensor.pihole to sensor.pi_hole. This was a breaking change during the last update.

Here is mine

1 Like

Thank you!
This was the issue.
Changed and now it works fine again.

1 Like

I have the same issue. Did you find a solution?

Try adding the following to your pi hole sensor:

verify_ssl: false
1 Like

Has anyone else had any luck with getting the sensor to work with ssl?

Yes. This works for me.

sensor:
  - platform: pi_hole
    host: 192.168.0.xxx:4865
    ssl: true
    verify_ssl: false
    monitored_conditions:
      - dns_queries_today
      - domains_being_blocked
      - ads_percentage_today
      - unique_domains

Thanks that works.

Is turning verify_ssl to false a security issue?

Wow. That really works.
Must have been the monitored conditions somehow although they are all optional.