type: 'custom:mini-graph-card'
entities:
- entity: sensor.water_hourly
color: '#0080ff'
name: Verbruik
name: Water Verbruik
show:
graph: bar
labels: true
group_by: hour
aggregate_func: max
hour24: true
Some questions/remarks if possible:
Would it be possible to âfixâ the bar chart in bars of 1 hour always going from midnight to midnight rather than the last X eg 24) hours?
When there is 0L used, I would expect a very tiny bar or none at all, now it seems quite significant even though the value is 0
The bar seems a bit too squeezed to the bottom of the card, a couple of pixels of whitespace would be nice
The state is the current value of the latest bar, would it be possible to display another sensorâs value (e.g. the daily water usage sensor, so I would have a sum of all bar values) and show the bar value on hover
Is it possible to have an X-axis indicating which bar represents which hour?
Nope, not at the moment at least, you could use something like config-template-card to adjust hours_to_show dynamically, e.g. match current hour so if itâs 16:00 â hours_to_show: 16.
Thatâs to be able to easily hover/touch over a point on mobile, even if itâs at the lower bound. You can adjust this with the line_width option, the lower you set it the shorter the minimum bar height gets.
Also intentional design decision, use the show option fill: false to add a padding around the graph, or use card-mod to add a custom bottom padding.
Yes, just list that entity first in the entities object, and use the entities options to hide it from the graph, you can also show several states, with the show_state option.
No, not at the moment, thereâs a feature request on github for this already though.
Which is the best config about history option to have recorded only the sensors included into the mini-media-graph sensors? Iâd like to disable completely the history option, but in this way i will have no more the card workingâŠ
Alright, Iâve never really used the edit UI, and Iâm not sure how HA handle config edits there but Iâll have a look at it!
Iâve made some changes in how we handle config changes after the initial render, this will enable compatibility with e.g. lovelace-auto-entities and might also work better with the edit UI (untested)?.
The order in the config doesnât matter.
I suggest trying in out in a simpler setup, should be much easier to debug.
Itâs also easier to debug if you set labels: true imo.
I do see an issue in your config.
Youâre setting the bounds on the primary y-axis, this will override the state_map generated bounds.
lower_bound: -5
upper_bound: 40
You would either need to move the night_time sensor to the secondary y-axis or remove the bounds.
What could happen if youâve provided an invalid/wrong state_map is that the entity data is cached based on those state_map values, changing hours_to_show to something else reloading the page then changing it back should clear the cached data.
Edit: I saw you also had the night_time sensor in the bar chart, this will probably not work as you expect, it will just end up as another bar. Thereâs currently no way of mixing bars and lines.
Setting show_state: true on the night_time sensor could also be useful for debugging purposes.
For the humidity one I know, it was just there ready for, and if, when it become available
For the lower/upper bound, those are working fine, and if I remove them it doesnât change.
Also, as far as I can tell the night_time binary sensor it is already on the secondary axis, is it not?
I will try on a test view to have it without the template-card now
What could happen if youâve provided an invalid/wrong state_map is that the entity data is cached based on those state_map values, changing hours_to_show to something else reloading the page then changing it back should clear the cached data.
After you do this youâll have to change hours_to_show again. What does the labels say when you got the correct state_map? It says Night? Is it night where you are and is the sensor working/changing as expected?