use correct attribute for valve position (#16118)

"valve" reflects the VALVE_STATE, e.g. "ADAPTION_DONE" etc.
This commit is contained in:
Matthias Merz 2021-01-08 15:20:22 +01:00 committed by GitHub
parent 42e30c7360
commit 79a13f6d45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -203,14 +203,14 @@ This does *not* affect the entities in Home Assistant. They all use their own co
### Reading attributes of entities
Most devices have, besides their state, additional attributes like their battery state or valve position. These can be accessed using templates in automations, or even as their own entities using the [template sensor](/integrations/template) component. Here's an example of a template sensor that exposes the valve state of a thermostat.
Most devices have, besides their state, additional attributes like their battery state or valve position. These can be accessed using templates in automations, or even as their own entities using the [template sensor](/integrations/template) component. Here's an example of a template sensor that exposes the valve position of a thermostat.
```yaml
sensor:
- platform: template
sensors:
bedroom_valve:
value_template: "{% raw %}{{ state_attr('climate.leq123456', 'valve') }}{% endraw %}"
value_template: "{% raw %}{{ state_attr('climate.leq123456', 'level') }}{% endraw %}"
entity_id: climate.leq123456
friendly_name: 'Bedroom valve'
```