Thanks @mateine ! This is very close. I think the key part I’m stuck on now
is how to only show the current instantaneous bars rather than a time series.
Maybe it’s going to be something including
vars.is = ys[ys.length-1]
edit: ok, maybe I’m on the right path using
x: $ex {
and
“y”: $ex {
What I would like to achieve is that the blue lines are as wide as the duration of the valve opening or closing. Instead of marker symbols I could also use lines or rectangles. They would have to start at the opening/closing event and end at the next “open” event (“open” is HAs “stopped” on the front end, even though they internally once have it as “stopped”). How could I do that?
Epic work!
The thing that would make it double as useful for me is if the time period could be selected using the energy date selector, something like:
If you want an example, the Sankey chart does this already.
``
sxdescaluelayout: auto energy_date_selection: true
type: custom:sankey-chart
I also think that date selector and plotly would be an ingenious combination.
The fact that you can already use historical data and automatically switch between aggregation durations based on the zoom level would make this work perfectly.
With other charting cards you would have the problem of loading too many data points when simply selecting something like month or year in the date selector.
But as switching an existing graph from 24h duration to a full year using the zoom buttons works perfectly in my tests, this would be an ideal solution.
(In case mateine has time and passion to add this )
I use plotly a lot. A lot. And I just can’t get enough of it. It’s awesome.
Here is a chart to display hourly cost of the electricity. The upper bar is price and the one below (brown) is the consumption in kWh. Unfortunately I had to convert the kWh to negative values in order to display it as in the chart.
Is this the place to get help with Plotly? New HA and Plotly user, setting up some graphs right now for energy. I use Emporia Vue which brings in three data points for each sensor: 1-minute average power, 1-day total energy, and 1-month total energy.
I can’t quite tell why, but Plotly is treating the daily and monthly values (both totals in kWh) differently in the plots I’m creating which are bar charts. Some of the graphs come up with good bar widths, for multiple entities on one graph; others have required some manipulation to get them visible.
The one I’m having the greatest issue with is a monthly graph with three different entities. No matter what I do, I can’t prevent it from creating a stacked graph - I want the bars to be grouped side-by-side. I’ve tried a few things - barmode, offsetgroup, etc. But nothing changes. Any help would be appreciated. Thanks!
Hello everybody. Today I discovered this card that has some features I was looking for… However, I would like to ask three things:
1- Is it possible for the value to be outside the graph?
2 - Can the bars have more rounded corners? to give a more “modern” look?
3 - Regarding the color of the bars, is it possible to apply a gradient? Any color mix? As in the example picture of “custom:chartjs-card”
Plotting waste bins lifts where the data is scraped. The sensor has the lift weigth and then the date it was lifted is an attribute of the sensor.
Trying to plot these as a bar graph and while the weights are correct, I have an issue with the date defaulting to 1/1/1970 which means there is an issue in the config of how I am trying to use the date attribute of the sensor.
Below is my config - any advice appreciated on how to resolve.
- type: custom:plotly-graph
title: Waste Lifts
entities:
- entity: sensor.waste_lifts
name: Waste
type: bar
x: "{{ as_timestamp(state_attr('sensor.waste_lifts', 'date')) | timestamp_local}}"
- entity: sensor.recycling_lifts
name: Recycling
type: bar
x: "{{ as_timestamp(state_attr('sensor.recycling_lifts', 'date')) | timestamp_local}}"
- entity: sensor.compost_lifts
name: Compost
type: bar
x: "{{ as_timestamp(state_attr('sensor.compost_lifts', 'date')) | timestamp_local}}"
refresh_interval: 3600
layout:
barmode: group
yaxis:
title: Weight (kg) or paste code here
Still experimenting with Plotly for some charts on my dashboard.
I have a situation where I want to pan left<>right along the x-axis, and I want the y-axis to auto-range as I do so. In this particular case, I’d like it to show a week’s worth of daily data at a time.
It’s been working fine until it accumulated about a week’s worth of data. The chart is now stacking some of the left-most points together as the data scrolls. It’s forcing in an 8th day’s data on a 7-day graph.