Based on this sensor I use statestics to create a average number over the last 7 days, and another template to generate a “yearly cost of power, based on last 7 days” and a small graph showing the useage pr day.
I have this information on my main dashboard page, hence the wife will notice. I know I can get the same information form the energy pages, however then it will not be on the main page.
Now the problem. Of the total space in my DB, a total of 29% is used by the utility sensor created to make the above. Mainly because it triggeres a lot, like every 5 seconds.
I woulkd like to reduce this space, used for the utility sensor. I only use it to get a total daily number:-) Seems like a lot of information to get this simple information.
I can see “Energy dashboard” have the “knowledge” about daily usage, as It make nice graphs with this information if you choose monthly view. Any way to get this information out?
Hi All, Have decided to go a different route, as I can not find a simple solution. Here is my working new setup to get measures pr minute. It will also work on a daily basis, however I can first see the result in 2 days:-)
First create a template (in template section), once pr minute (will work with whatever timing)
- trigger:
- platform: time_pattern
minutes: /1 ## One measurement pr minute
sensor:
- name: "Utility El usage Minut increasingtotal temp-number"
state: >
{{ states('sensor.develco_zhemi101_f21a021b_smartenergy_metering_summation_delivered') }}
To calculate the change between the readings, use statestics template (goes under sensor)
- platform: statistics
entity_id: sensor.utility_el_usage_minut_increasingtotal_temp_number
name: Utility El usage pr minut History temp-number
state_characteristic: change
precision: 3
sampling_size: 2
max_age:
days: 2
In the end, create a new sensor with the value calculations in other templates.
Nice! Glad you found a workaround. I just put my daily and monthly statistics in a flat text file and exclude them all from recorder.
It’s frustrating that HA trows everything into one database, and that there is no way to exclude the energy monitoring stuff if you’re not using it. A while ago I put in a feature request to allow individual entities to be set for different purge durations, which I think would be a step in the right direction. (Feel free to up-vote if you agree!) Adding all the energy monitoring only made the load on the DB worse.