Last question for today…
I have two sensors that measure the state of a relay: one for daily statistics and one for monthly statistics. And the respective graphs are correct.
Can I keep only one and draw both graphs?
I have tried with various filters, but nothing seems to work.
I’m following one of the many instructions on how to plot Temperature vs Humidity, (e.g. Plotly interactive Graph Card - #386 by mateine) and I just can’t get the X-axis to show anything other than time. What am I missing?
This happens a lot - I have a watts vs. time plot. And I’d LOVE to be able to click on a arbitrary point, and either click on a 2nd point (or drag over select), and have know (somehow) what the total w/time is. Basically kWh, but I can do that extra math on the units if necessary.
I’ve done all kinds of searches, like “graph tool select range calculation area home assistant” etc. Plotly looks awesome, but doesn’t appear to handle the math.
Any suggestions? (besides writing my own - and depending on what happens in the near future I might have some… free time to do so.)
Try adding raw_plotly_config: true at the root.
I assume there’s something in the defaults that assumes time (here are the defaults)
You could also try with
layout:
xaxis:
type: numeric # or something like that
Hoping I am ok to post here for help with plotly-graph-card. I have used it quite a bit in my HA and I love it. Mindblowing how flexible it is.
I have a utility meter with 12 tariffs. Each one saves the electric bill amount for a given month. So I have sensor.elec_bill_utilmeter_1 with January’s value, sensor.elec_bill_utilmeter_2 with Feb’s value, and so on.
I want to show a bar graph with these values lined up, with months Jan thru Dec along the x axis. I have gone through many many googles and even tried asking Copilot (surprisingly helpful sometimes, but often not great). Been through lots of failed attempts and can’t seem to figure this one out. I believe I need to assign each sensor an x value corresponding to the month.
Most examples that I find have the historical values of a sensor against timeline. This is a bit different.
Appreciate any help you can share!
Thank you!
Yes, flexibility was my ambition with it!
I find that chatgpt can be good at the yaml for this if one tells it it uses plotlyjs and paste a bunch of examples too.
if the entity for e.g August has that of last monthYEAR you’ll need to adapt it a bit. I bet that if you paste this example and your original question, ChatGPT or similar will nail it
FYI I tried a variety of types, as per the options listed in Layout.xaxis in JavaScript. Although the appearance of the axis changed, the plot/line itself did not appear. So it’s probably a deeper thing. (?)
I notice that in mode: text, at least the textposition is passed to plotly. Is there a way to specify the text color (textcolor?) and angle (textangle?) in a similar way?