Service call with a native dictionary (#19922)

This commit is contained in:
Chris Browet 2021-10-23 21:10:55 +02:00 committed by GitHub
parent 302e81d8ee
commit 99b3511c31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -108,6 +108,23 @@ data:
```
{% endraw %}
You can use a template returning a native dictionary as well, which is useful if the attributes to be set depend on the situation.
{% raw %}
```yaml
service: climate.set_temperature
data: >
{% if states('sensor.temperature_living') < 19 %}
{"hvac_mode": "heat", "temperature": 19 }
{% else %}
{"hvac_mode": "auto" }
{% endif %}
```
{% endraw %}
### `homeassistant` services
There are four `homeassistant` services that aren't tied to any single domain, these are: