mcfrojd
(Mcfrojd)
September 16, 2016, 7:36pm
1
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
fabaff
(Fabian Affolter)
September 16, 2016, 7:44pm
2
The Pi-Hole sensor is designed to be used with template sensors for the attributes.
mcfrojd
(Mcfrojd)
September 16, 2016, 9:27pm
3
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'
PtP
(Mike)
September 16, 2016, 10:14pm
4
Please use the code tag when posting code. It is the < / > symbol in the tool bar. It makes it easier to read or copy.
custk9
(Custk9)
September 17, 2016, 8:48am
5
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'
mcfrojd
(Mcfrojd)
September 17, 2016, 9:37pm
6
I have no idea why it did not work for med yesterday, maybe i was to tired.
Thank you for your effort tho.
mcfrojd
(Mcfrojd)
September 17, 2016, 9:39pm
7
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