Firstly credit to @Vasiley for this pihole package here
I wonder if anyone who understands this level of code can help solve an issue.
For me pihole runs on a Pi on my network (not the same machine as HA) so i had to modify a few things where my command is:
ssh pi@<IP> pihole status
but displays pihole_raw_status correctly:
[✓] DNS service is running
[✓] Pi-hole blocking is Enabled
That said (a possible issue) is HA shows it on a single line:
[✓] DNS service is running [✓] Pi-hole blocking is Enabled
The error i get:
UndefinedError: list object has no element 1
is from the sensors reading the state from this:
sensors:
pihole_dns:
value_template: "{{states.sensor.pihole_status_raw.state.split('[?]')[1][1:-3]}}"
icon_template: >-
{%- if states.sensor.pihole_status_raw.state.split('[?]')[1][1:-3] == 'DNS service is running' -%}
mdi:checkbox-marked
{%- else -%}
mdi:checkbox-blank-outline
{%- endif -%}```
any thoughts on how to solve this issue?
[thanks in advance for any help!]