From 38fa3122ec27e1e5d3d09da1a9bc4de834d8f02e Mon Sep 17 00:00:00 2001 From: Cameron Smith <27576381+camcs1@users.noreply.github.com> Date: Mon, 9 Aug 2021 21:43:55 +0100 Subject: [PATCH] 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 --- source/_integrations/vesync.markdown | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/source/_integrations/vesync.markdown b/source/_integrations/vesync.markdown index 5d724d535dc..5a2cee259bb 100644 --- a/source/_integrations/vesync.markdown +++ b/source/_integrations/vesync.markdown @@ -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 %}