1
0
ansible-home-assistant/automations/templates/air-purifier/sensor.yaml.j2
2020-11-05 02:05:23 +01:00

30 lines
1.3 KiB
Django/Jinja

{% for airPurifier in airPurifiers %}
# {{ airPurifier.name }}
- platform: template
sensors:
{{ airPurifier.componentId }}_temp:
friendly_name: "Temperature"
value_template: {{ '"{{ state_attr(\''+ airPurifier.entityId +'\', \'temperature\') }}"' }}
unit_of_measurement: "°C"
device_class: "temperature"
{{ airPurifier.componentId }}_humidity:
friendly_name: "Humidity"
value_template: {{ '"{{ state_attr(\''+ airPurifier.entityId +'\', \'humidity\') }}"' }}
unit_of_measurement: "%"
device_class: "humidity"
{{ airPurifier.componentId }}_air_quality_pm25:
friendly_name: "Air quality"
value_template: {{ '"{{ state_attr(\''+ airPurifier.entityId +'\', \'aqi\') }}"' }}
unit_of_measurement: "μg/m³"
icon_template: "mdi:weather-fog"
{{ airPurifier.componentId }}_speed:
friendly_name: "Fan speed"
value_template: {{ '"{{ state_attr(\''+ airPurifier.entityId +'\', \'motor_speed\') }}"' }}
unit_of_measurement: "rpm"
icon_template: "mdi:speedometer"
{{ airPurifier.componentId }}_filter_remaining:
friendly_name: "Filter remaining"
value_template: {{ '"{{ state_attr(\''+ airPurifier.entityId +'\', \'filter_life_remaining\') }}"' }}
unit_of_measurement: "%"
icon_template: "mdi:heart-outline"
{% endfor %}