type: 'custom:mini-graph-card'
entities:
- entity: sensor.daily_energy_power_total
name: Energy consumption (Weekly)
hours_to_show: 168
aggregate_func: max
group_by: date
show:
graph: bar
My sensor.daily_energy_power_total updates every few seconds whenever there is a change.
The day has passed and now yesterdays bar has increased a lot now. Am I correct to say that the current day(bar) doesn’t grow over the day but gets populated when the day has passed?
As far as I understood, the "group_by" feature works like this (@kalkih please correct me):
There is an array of values of some sensor (updated every XXX seconds/minutes).
A usual LINE graph shows a curve reflecting every value (+ some interpolation dependingly on "scan_interval" & "points_per_hour" & "hours_to_show").
Grouping per hour: for every hour an “Arithmetic mean” is calculated (sum of values within this hour / number of values). This calculated value then is displayed in the graph as a value for this particular hour.
To investigate any strange behaviour with "group_by" I recommend you not to use grouping first; then if everything looks fine - use "group_by".
I am working on electrical energy monitoring with a combination of the Riemann sun integration, the utility meter integration and the mini graph custom cards. I get my energy readings through Smappee energy monitor.
All works pretty smooth within the range of a week. In the bar charts data per hour is fine and grouped per hour or date works perfectly. However once you go beyond that range problems start.
Could the hours_to_show changed to time_to_show with a selection of hours, day, week, month, year (like the utility meter also counts the data).
And the same for grouped_by not only hour or date but calendar_week, calendar_month or calendar_year?
There is the option for interval but I couldn’t find any description on how to use that.
I read quite some threads facing similar issues. I think it would create great flexibility.
Finally I like to say I like the cards a lot. I don’t understand why this is not replacing the standard history graph in Lovelace!
Cannot read property 'length' of undefined
type: 'custom:mini-graph-card'
No matter how many times I do a clean install of HACS, i still get this error. Same thing is happening for the mini media player card, however other cards that I installed through HACS are running fine.
Anyone has any solution? I am pulling my hair out!
How do you expect to “see” the ‘mini-graph-card’ in Lovelace?
If you mean “It is not available for selection in the ‘Create new card’ window” - this is normal for ALL custom cards.
Just create a new card (it can be of ANY type) and type a new code starting with “type: ‘custom:mini-graph-card’” etc.
I am creating a dashboard with Sqare buttons, and would love to have a graph with temperature in some of them. But I am facing a problem where the graph itself is using very little space on the card.
I have played with the height parameter, however this is an absolute value, and from device to device it requires different values.
Is there a way to use some relative value?
This is my card:
And this is my config (please note that this is inside a grid card: