mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-22 08:46:51 +00:00
Add an example template to extract air quality (#18869)
* Add an example template to extract air quality Thought it would be helpful to add a example template showing how to extract air quality and capitalise the results. This is my first PR for this project so I apologise if I've made any mistakes * Use new template format & changed to state_attr() * Tweaks * Tweak Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
parent
267d20d903
commit
38fa3122ec
@ -126,5 +126,17 @@ sensor:
|
||||
value_template: '{{ states.switch.vesync_switch.attributes["voltage"] | float }}'
|
||||
unit_of_measurement: "V"
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
Extracting air quality from a VeSync LV-PUR131S air purifier. Change the `vesync_air_purifier` to match your device's entity ID.
|
||||
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
template:
|
||||
- sensor:
|
||||
- name: "VeSync Air Quality"
|
||||
state: "{{ state_attr('fan.vesync_air_purifier', 'air_quality') | title }}"
|
||||
```
|
||||
|
||||
{% endraw %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user