Pi-Hole all values

How do i get the other valuse from Pi-Hole to show in my “pi-hole” group?
I am using this in my sensors/pi_hole.yaml

- platform: pi_hole
  host: 192.168.1.80

and this in my groups/pi_hole.yaml

name: Pi-Hole
view: no
entities:
  - sensor.pihole

But i only get the one default value.

i want to show these values to in that group.

percentage_today: 10.6
queries_today: 1,617
domains_blocked: 93,760

The Pi-Hole sensor is designed to be used with template sensors for the attributes.

I have tried to understand this templating now for 2h.
But i have no luck at all.
I cant see why this is not right.
i have this in a sensors/template.yaml file

- platform: template
  sensors:
    pihole_queries_today:
      value_template: '{{ states.sensor.pihole.attributes.queries_today }}'
      friendly_name: 'Queries Today'
    pihole_percentage_today:
      value_template: '{{ states.sensor.pihole.attributes.percentage_today }}'
      friendly_name: 'Percentage Today'
    pihole_domains_blocked:
      value_template: '{{ states.sensor.pihole.attributes.domains_blocked }}'
      friendly_name: 'Domain Blocked'

But no luck.
Been looking throu all example files on the webpage but no one seem to use pi-hole, and those that have a template i cant understand why my wount work…

I get a lot of errors:
16-09-16 23:19:26 homeassistant.components.sensor.template: UndefinedError: 'None' has no attribute 'attributes'

Please use the code tag when posting code. It is the < / > symbol in the tool bar. It makes it easier to read or copy.

Works like a charm:
in sensors.yaml:

- platform: pi_hole
  host: xxx.xxx.xxx.xxx

- platform: template
  sensors:
    pihole_queries_today:
      value_template: '{{ states.sensor.pihole.attributes.queries_today }}'
      friendly_name: 'Queries Today'
    pihole_percentage_today:
      value_template: '{{ states.sensor.pihole.attributes.percentage_today }}'
      friendly_name: 'Percentage Today'
    pihole_domains_blocked:
      value_template: '{{ states.sensor.pihole.attributes.domains_blocked }}'
      friendly_name: 'Domains Blocked'

I have no idea why it did not work for med yesterday, maybe i was to tired.
Thank you for your effort tho.

I did use the code tag, but yesterday the forum would not format the text when i marked more then 1 line of text, dont know why, but i see today that the text got formatted

1 Like