Hello guys,
I need your help regarding the creation of a sensor.
First of all, I want to explain what I need to do:
I need to create a Graph with some manually inserted data.
Ok, this isn’t a very smart usage of HomeAssistant, I know that. I already have a lot of atomation and so on, but now I’m starting a project that I want to track inside an HA Dashboard.
That said, I found a cool Custom Card (ApexCharts card) which can give the possibility to create a graph from an array inside an attribute of a sensor.
So, I tryied creating mine own sensor, like this one:
sensor:
- platform: template
sensors:
test:
friendly_name: Test
unit_of_measurement: 'X'
value_template: '1'
attribute_templates:
data: >
- date: '2021-05-22T05:30:00.000Z'
value: 0.00499446
- date: '2021-05-23T05:30:00.000Z'
value: 0.01417467
But it doesn’t work due to the fact I’m creating a string inside the “data” attribute and not an array. This is the attribute shown on Dev tools:
data: |-
- date: '2021-05-22T11:05:30+00:00'
value: 0.00499446
- date: '2021-05-22T11:05:30+00:00'
value: 0.01417467
The “problem” is that “|-
”
So, now I have to questions for you guys:
- Is there a way to create an array inside the attribute of a sensor template?
- Any other ideas on how to use some “graph card” with manually inserted data is welcome.
Thank you!