-
I think I understand that I should use a filter for this but I can't wrap my head around the more (complex) examples I have found. I want to do this:
where {{ state_attr('sensor.tibber_electricity_price', 'today') }} looks like:
and {{ state_attr('sensor.tibber_electricity_price', 'tomorrow') }} similarly as:
I'd appreciate a hint, I used plotly before in javascript but its hard to wrap ones head around its functionality embedded in home assistant, although it does seem worth trying to learn it! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Hi there! type: custom:plotly-graph
entities:
- entity: sensor.tibber_electricity_price
x: $ex meta.today.map(item => item.startsAt)
y: $ex meta.today.map(item => item.total)
name: Today
mode: lines+markers
- entity: sensor.tibber_electricity_price
x: $ex meta.tomorrow.map(item => item.startsAt)
y: $ex.meta.tomorrow.map(item => item.total)
name: Tomorrow
mode: lines+markers
layout:
title: Tibber Electricity Price
xaxis:
title: Time
yaxis:
title: Electricity Price (SEK)
config:
scrollZoom: false
# the next two you had inside config and they belong at root level
hours_to_show: 1s # since you are using the last attribute through "meta", no historical data is needed
refresh_interval: auto
|
Beta Was this translation helpful? Give feedback.
Got it to work, thanks for all advice @dbuezas!