Home Assistant Community

Great new Utility Meter, now how to keep track of history?

#1

Ok, so I just enabled the new utility meter for my dutch smart meter. So far all green but… how can I now keep track of the history ‘forever’ for this component? Is that at all possible in HA or do I (for now) need to push these new sensors to influxdb (or any other external database) and use a different tool to keep track of my daily/weekly/monthly/yearly powerusage?

I set the recorder to record only 3 days as HA starts to hang/crash if I store more days… probably because our DSMR updates every few seconds which blows up the internal db of HA very quickly.

0 Likes

#2

If your HA crashes with 3 days history, you need an external db.
I’m using csv files for daily values.

0 Likes

#3

I’ve setup mariadb recently but if I touch the history button in HA, than it will never respond and loads go over 33! That page is seriously dangerous and should be disabled :frowning:

I just disabled the recording of the original utility sensors and now only record the new sensors created by this component. Lets see how that runs. But should HA be able to record (and retrieve) years of data?

0 Likes

#4

I have a similar problem, what I did was to exclude the energy sensor from the recorder component

0 Likes

#5

I would be interested in the original question of the OP as well.

Is it in any way possible to reproduce the power/ energy monitoring approach of the original ewelink application of a sonoff pow?

I.e. Have a daychart for the actual month and have monthly history of the consumed data?

Utility meter component wil reset the counters as soon as it completes the cycle, no? Is there a way to keep/ store them and have the history?

0 Likes

#6

Each utility_meter.sensor keeps an attribute which contains the last_period value. You can create a template sensor to extract such attribute.

0 Likes

#7

I see (I think), but how do I store the extracted data for their respective period in the Db? I mean how do I set it in the template sensor automatically that the extracted last_period is e.g. 2019 January, February and so on in case on a monthly cycled utility_meter.sensor?

0 Likes

#8

@dgomes, could you please give me a hint on this? I understand the extraction of the last_period, but can’t figure out how to record the history for the different cycles (daily, monthly).

0 Likes

#9

If you extract the last period using a sensor template, then that sensor template becomes your history, since it only gets update once each cycle.

Personally I keep all the long historical records in an influxDB and plot them using graphana.

0 Likes