Timestamp in attribute #458
Unanswered
froggi1930
asked this question in
Q&A
Replies: 2 comments 1 reply
-
Either of these should work: - entity: ''
name: My solar production forecast today
filters:
- fn: |-
({hass}) => ({
xs: hass.states['sensor.my_solar_production_forecast_today'].attributes.data.map(({ timestamp }) => new Date(timestamp)),
ys: hass.states['sensor.my_solar_production_forecast_today'].attributes.data.map(({ value }) => value),
})
- entity: ''
name: My solar production forecast today
x: "$ex hass.states['sensor.my_solar_production_forecast_today'].attributes.data.map(({ timestamp }) => new Date(timestamp))"
y: "$ex hass.states['sensor.my_solar_production_forecast_today'].attributes.data.map(({ value }) => value)"
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks for your quick reply! type: custom:plotly-graph
entities:
- entity: " "
- entity: ""
name: My solar production forecast today
x: "$ex hass.states['sensor.my_solar_production_forecast_today'].attributes.data.map(({ timestamp }) => new Date(timestamp))"
y: "$ex hass.states['sensor.my_solar_production_forecast_today'].attributes.data.map(({ value }) => value)" That one did the trick. Now, moving on to the next question: How can I limit the x-axis so that the graph only displays when data is available for the timestamp? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone,
I’ve typically used simple charts in Home Assistant so far, but I recently discovered the Plotly card, and I’m a bit overwhelmed by its potential!
I want to create a graph to display my solar production forecast.
Using the template engine, I get:
How can I best integrate this data into the Plotly card?
Thanks in advance for any guidance - I’m feeling a bit lost here!
Beta Was this translation helpful? Give feedback.
All reactions