mini-graph-card
mini-graph-card copied to clipboard
Add more group option alternatives: week, month, quater e.t.c.
Hi,
it would be great if you could add support for month and quarter fr the group_by parameter. I would use this getting a graph for power metering.
Best, Michael
I just recognized that year also would be great to have.
I agree, right now I cannot do graph with utility meter other than daily.
It woul be great an aggregation function 'inc' that stays for last-first. I want use it to know consume in a day, in a week, in a month etc
I'd also love to see this. I'd like to graph by day, week and month with one point per unit in bar form.
Great idea ! upvote
Hi, I'm also looking for this feature. I need to monitor my water/electricty consuption by day/month/year. If someone has already a solution in home assistant to do that please let me know.
up!
Probably with 0.94 versione we will have a similar functionality, with new aggregation function "delta". But it's long time a wait for it.
let's assume you have a sensor for realtime power usage (in W).
sensors:
- platform: template
sensors:
power_instantaneous:
unit_of_measurement: W
value_template: "{{ states('sensor.actual_consumption_sensor') | round() }}"
entity_id: sensor.actual_consumption_sensor
device_class: power
then with the integration
component you can create an energy sensor (in kWh):
- platform: integration
source: sensor.power_instantaneous
name: energy_total
unit_prefix: k
unit_time: h
method: left
round: 2
Then with the utility_meter component you build the sensor that have the data for your mini-graph-cards:
utility_meter:
hourly_energy_kwh:
source: sensor.energy_total
cycle: hourly
daily_energy_kwh:
source: sensor.energy_total
cycle: daily
weekly_energy_kwh:
source: sensor.energy_total
cycle: weekly
monthly_energy_kwh:
source: sensor.energy_total
cycle: monthly
quarterly_energy_kwh:
source: sensor.energy_total
cycle: quarterly
yearly_energy_kwh:
source: sensor.energy_total
cycle: yearly
So it would be great if mini-graph-card
would support all of utility_meter
's cycles, so maybe instead of:
group_by: date
we could have
group_by: hour # or
group_by: day # or
group_by: week # or
group_by: month # or
group_by: quarter # or
group_by: year
as mentioned before here, right now only daily is doable:
- type: custom:mini-graph-card
name: energy today
icon: mdi:transmission-tower
entities: [sensor.daily_energy_kwh]
hours_to_show: 168
aggregate_func: max
group_by: date
points_per_hour: 24
hour24: true
show: {graph: bar}
This feature will be add?
+1
I'd love that too (BTW thanks few the great job)
up! please ;-)
+1
Any idea if it's planned to be implemented?
+1 here
Would love to see this!
+1, usefull feature
And the ability to use color_thresholds option in bar charts would be so nice too !
Very much looking for this.
+1 this would be awesome :)
+1 here, too. Would love to see that! :)
+1
Please avoid commenting a +1
but instead use the :+1: reaction to indicate your support.
That being said, this is something we'll look in to during the configuration update (next release).
Do note that the available history might be limited by HA itself, thus it might depend on #641 to actually be useful.
Can Date.getMonth
(https://www.w3schools.com/jsref/jsref_getmonth.asp) be used at
https://github.com/kalkih/mini-graph-card/blob/071f649861efcc320f2f1e960368abcb48102190/src/main.js#L987-L1000
Which places must be modified to set a grouping interval?
Is it correct that the biggest change might be the points_per_hour
setting as this is not constant for the different months?
+1 would love what @tbrasser shared here https://github.com/kalkih/mini-graph-card/issues/302#issuecomment-636386722
Half-hourly would also be useful, Electricity is often priced by the half hour, so this would allow plotting of consumption/charging in line with periods of different pricing.
In the UK at least, it is possible to consume electricity based on wholesale half-hour pricing, but also use simpler peak/off-peak tariffs. Those tariffs can run for example between 00:30 to 04:30, so again half-hourly makes sense.
The utility meter suggestion shown above is a good one, though some custom config is required for half-hourly with utility meter, so simply mirroring utility meter may not be helpful for half-hourly (unless utility_meter adds half-hourly - weirdly it offers quarter-hourly!).