mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-14 12:56:54 +00:00
Reworded section on pulling attributes from JSON (#13972)
Improved English; original probably written by someone using second language which is far more impressive than me slightly tweaking it in my first language!
This commit is contained in:
parent
9ddb9f3b0e
commit
c4ee09ef46
@ -320,7 +320,7 @@ sensor:
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
This configuration shows how to extract multiple values from a dictionary with `json_attributes` and `template`. It helps you to avoid flooding the REST service and only ask once the results and separate them in multiple templates referring to it. (No need for a specific state on the REST sensor and it's default state will be the full JSON value which will be longer than the 255 max length. It's why we'll used a static value)
|
||||
This configuration shows how to extract multiple values from a dictionary with `json_attributes` and `template`. This avoids flooding the REST service by only requesting the result once, then creating multiple attributes from that single result using templates. By default, the sensor state would be set to the full JSON — here, that would exceed the 255-character maximum allowed length for the state, so we override that default by using `value_template` to set a static value of `OK`.
|
||||
|
||||
{% raw %}
|
||||
```json
|
||||
|
Loading…
x
Reference in New Issue
Block a user