I would like to integrate my Air Quality Sensor into Homekit. I use Luftdaten PM25 sensor and prepared a HA template. The sensor works properly and is detected by homekit. Unfortunately it does not show any value or status. Does anyone know what’s wrong?
- platform: statistics
name: pm25 stats
entity_id: sensor.luftdaten_p2
max_age:
minutes: 60
- platform: template
sensors:
air_quality_pm25:
friendly_name: 'Luftqualität'
value_template: >
{% if states('sensor.pm25_stats_mean') | float <= 15 %}EXCELLENT
{% elif states('sensor.pm25_stats_mean') | float <= 30 | float > 15 %}GOOD
{% elif states('sensor.pm25_stats_mean') | float <= 55 | float > 30 %}FAIR
{% elif states('sensor.pm25_stats_mean') | float <= 110 | float > 55 %}INFERIOR
{% elif states('sensor.pm25_stats_mean') | float > 110 %}POOR
{% endif %}