Parse a sensor that already gives a list of (timestamp, values) #229
-
Dear all, I was wondering if someone could help me to do something with many of the entities I have. This entity sensor.veolia_daily_consumption is in fact giving me a history of 3 months with the same pattern: day, value a hundred of time |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
I think #213 is a good base for this. In this case it should be something like this: (not testee) filters:
- fn: |-
({ meta }) => ({
xs: meta.HistoryConsumption.map(([date, value ]) => new Date(date)),
ys: meta.HistoryConsumption.map(([date, value ]) => value),
}) |
Beta Was this translation helpful? Give feedback.
-
Yeaaaaah it works! Many thanks! - type: custom:plotly-graph # test vdc
entities:
- entity: sensor.veolia_daily_consumption
filters:
- fn: |-
({ meta }) => ({
xs: meta.historyConsumption.map(([date, value]) => new Date(date)),
ys: meta.historyConsumption.map(([date, value]) => value)
})
show_value: true
hours_to_show: 2244 And the result: |
Beta Was this translation helpful? Give feedback.
I think #213 is a good base for this. In this case it should be something like this: (not testee)