Unfortunately, it is better to disable the “show points” option since the top state label is used not only for displaying the 1st entity’s state but also for displaying a value for the selected point of ANY graph.
Look at the picture: the bottom label contains a current state of the 2nd entity, the top label contains a state for the selected point of the same 2nd entity:
So, this mod should be used w/o the “show points” option.
Surely one binary sensor may be added as a background card - you need to “convert” this binary_sensor into sensor (0,1) and “attach” it to secondary y-axis:
Update 24.06.22:
Due to changes in HA 2022.6 in part of history-graph, this style should be revised:
not sure if you ever received a reply on this, but I just found your post, and hadn’t read @Ildar_Gabdullin 's remark above it… so I tried it and it still works (on dev 2022.2.0) very nice suggestion and addition indeed
Thanks for your feedback, Marius. I totally forgot about this when I upgraded at the time (and hence thank you for the reminder too), but luckily remained working (I’m on 2021.12.7).
Need some help with graphing hourly totals. The hourly aggregate: sum do not seem to correlate to the hourly changes for the sensor. For instance the total Pool Filling value goes from 42 to 105 from 7:06 to 7:22 am however the hourly bar chart only record 22 gallons from 8:00 am to 8:59 am. Why is it different and why 1 hour off?
align_state: center
animate: true
entities:
- entity: sensor.pool_filling
aggregate_func: sum
smoothing: false
hours_to_show: 24
name: Pentiar Pool Filing - Hourly
type: custom:mini-graph-card
show:
graph: bar
group_by: hour
Hey!! Im loving this graph! So beautiful and simple.
I did have a question though, can it shrink height wise? Like how can I adjust the padding on the graph? I think theres too much empty space at the top, I get how to adjust the graph at the bottom but I’m looking to shrink the negative space up top.
Hi,
I added my sensor to HA one month ago. I want to see graph from beginning, when sensor is adeed to HA. My card have the following settings:
hours_to_show: 744
points_per_hour: 0.04
which shows data for month. But after few days, graph will not display data which are older than one month. I could change parameters but this is not good solution.
Is it possible to display graph from beginning of data and only from beginning? Some kind of dynamic x axis range…, perhaps new option to set beginning date instead of hours_to_show?
Does the Recorder keep data for a period you need?
As for dynamically changing hours_to_show:
put the card inside a config-template-card;
use a template for hours_to_show - kind of “increase the value by 24 every day”.
The side effect is that the whole graph will have to redraw itself on every sensor’s update since it is placed inside config-template-card. But if your sensor is updated rarely then this is not a problem.
Alternatively - wait for native templates support in the mini-graph-card.
Can you please share the code you are using to generate the daily kWh bar chart? I’ve been trying to figure that out for over 1 month. I have a Sonoff S31 plug with power monitoring but I get only the watts. I know I can convert watts to kWh using Riemann Sum or Utility Meter, but then I don’t understand how to go from there and generate the bar chart where each bar is a day.