Pi-hole unavailable

My hass is on 192.168.1.239 and my pi-hole is on 192.168.1.239
my code is the following.

On all sensors I receive unavailable value. How tyo troubleshoot?

  - platform: pi_hole
    host: 192.168.1.239
    ssl: true
  - 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 only have needed to defined pi hole as follows:

- platform: pi_hole

I’d first check if your pi hole sensors themselves are returning any values. If they are, you know the problem exists in your template, if not, then homeassistant isn’t seeing pihole, in which case check the logs.