Pi hole sensor config error

Sure its me, but what is wrong with my code here:

pi_hole:
  - host: '192.168.1.117:4865'

I get this error which I do not understand:

Invalid config for [pi_hole]: expected a dictionary for dictionary value @ data[‘pi_hole’]. Got [OrderedDict([(‘host’, ‘192.168.1.117:4865’)])]. (See /config/configuration.yaml, line 85). Please check the docs at https://home-assistant.io/integrations/pi_hole/

I am running Pi Hole Hassio Addon on my Pi which has that IP address?

Thanks!

This is my config and it works ok I am not sure that you need the port number on the end either:

pi_hole:
  - host: '192.168.0.4'
    name: 'dns-1'
    ssl: False
    verify_ssl: False

Thanks will try that. The docs say you need port if using the hassio addon but will try.

Are you using the addon?

Hmm just using the pi_hole and ip lines doesn’t work either.

I wonder if it’s because I am on duckdns and have duckdns set in the pi hole config as server?

IP addresses work. Hostnames should work, as long as your local DNS works. You only need the port number if it is non standard (as with the addon).

You error message implies some sort of formatting error in your yaml. Make sure it is indented correctly, including no tabs.

It may be the : before the port number. Try either no quoting or " quoting.

No I am not using the addon sorry I don’t have any other suggestions.
Thinking about it I am sure I got that error before I added:

name: 'dns-1'

Try without the port and check the indentation.

ok So I have tried these options. I have included the full config file down to the pi_hole part as it advises to add Pi_hole at the top, not within sensors etc. Assuming where I have put it is ok

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

homeassistant:
  customize: !include customize.yaml


pi_hole:
  - host: '192.168.1.117'

the above gives this error:

Invalid config for [pi_hole]: expected a dictionary for dictionary value @ data[‘pi_hole’]. Got [OrderedDict([(‘host’, ‘192.168.1.117’)])]. (See /config/configuration.yaml, line 8). Please check the docs at https://home-assistant.io/integrations/pi_hole/

Then I tried with port:

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

homeassistant:
  customize: !include customize.yaml


pi_hole:
  - host: '192.168.1.117:4865'

which gives pretty much the same error:

Invalid config for [pi_hole]: expected a dictionary for dictionary value @ data[‘pi_hole’]. Got [OrderedDict([(‘host’, ‘192.168.1.117:4865’)])]. (See /config/configuration.yaml, line 8). Please check the docs at https://home-assistant.io/integrations/pi_hole/

Then I took quotes out:

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

homeassistant:
  customize: !include customize.yaml


pi_hole:
  - host: 192.168.1.117:4865

and still got the error:

Invalid config for [pi_hole]: expected a dictionary for dictionary value @ data[‘pi_hole’]. Got [OrderedDict([(‘host’, ‘192.168.1.117:4865’)])]. (See /config/configuration.yaml, line 8). Please check the docs at https://home-assistant.io/integrations/pi_hole/

So then I took port out:

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

homeassistant:
  customize: !include customize.yaml


pi_hole:
  - host: 192.168.1.117

and got this:

Invalid config for [pi_hole]: expected a dictionary for dictionary value @ data[‘pi_hole’]. Got [OrderedDict([(‘host’, ‘192.168.1.117’)])]. (See /config/configuration.yaml, line 8). Please check the docs at https://home-assistant.io/integrations/pi_hole/

Trying the code posted by @daveyrb I used this:


pi_hole:
  - host: '192.168.1.117'
    name: 'HomePiHole'
    ssl: False
    verify_ssl: False

and got this error:

Invalid config for [pi_hole]: expected a dictionary for dictionary value @ data[‘pi_hole’]. Got [OrderedDict([(‘host’, ‘192.168.1.117’), (‘name’, ‘HomePiHole’), (‘ssl’, False), (‘verify_ssl’, False)])]. (See /config/configuration.yaml, line 8). Please check the docs at https://home-assistant.io/integrations/pi_hole/

So its really not happy.

Keep thinking I must be using the wrong location to type it or wrong docs

So I added this:

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

homeassistant:
  customize: !include customize.yaml

pi_hole:
  host: 192.168.1.117

And now I can see all the sensors. they show as unavailable though, so maybe they were there pre adding anything to the config?

Think I need to give up on this.

ok!

Perseverance is the key, docs are wrong, this works:


pi_hole:
  host: "192.168.1.117:4865"
  ssl: false
  verify_ssl: false

Matt,
Just to check what version of HA are you running? As the Pi-Hole integration did have a breaking change (I think in release 103 might have been 102)