I dug around and found a similar question but I don’t have the code quite right. Display a list of items - #2 by juaigl
I tried a markdown card and an entity card.
This is the entity card
and the markdown is
and finally the markdown code…
type: markdown
content: >-
Items:
{% for item in states("sensor.master_todo_list") %}
* {{item}}
{%- endfor %}
I would like the list to be somewhere between those two cards. Each element on its own line (or bullet point).
Understood. When I add from_json I get an error. I am doing a little digging into my json formatting. So far I checked it on a json verifier and I get an A OK.
Maybe I can parse the string by hand? I will look around.
An entity’s state property can only store a string value of 255 characters. So if your JSON payload’s total length ever exceeds that limit, it will be truncated thereby corrupting its JSON structure.
In contrast, an entity’s attributes property can store up to 16Kb and the data’s type can be a string, list, dict, boolean, etc. That means your data’s list structure will be preserved and your Markdown card’s template will work correctly (although it will need to use the state_attr() function).
I recommend you modify your REST Sensor’s configuration to store your spreadsheet data in an attribute. Refer to the example in the documentation.
OK so looking at the docs… I see how the attributes are defined in json_attributes and how the path is defined. I just don’t understand what the $ syntax means.
That’s helpful. I did experiment with the tool and the $ didn’t make a difference if it was there or not. But I did find a reference for the JSONPath syntax. I will just drop it here in case it helps anyone else.