Store Monthly Values in Entity?

I installed a Emporia Vue Energy Monitor with 12 sensors that each read usage by:

  • minute
    -daily
    -monthly

I built my own energy tab in lovelace to view these figures based on the appliance they are monitoring…What I would like to do is add an additional entity for: LAST MONTH USAGE. I just want to compare the current month to the previous month and see how I’m tracking but I can’t figure out a way to tell HA at the end of the month to capture the current monthly data and store it as “previous month” for each of the 12 entities. I’ve got two days to figure this out until April 1st rolls around! lol…any thoughts?

Also - Running a basic HA Raspberry Pi setup with the default SQL database (nothing fancy)

I use this integration to record daily/weekly/monthly/yearly data:

But doesn’t the utility meter reset after the month is over? I need to capture the previous month so I can compare it to the current month. Maybe I missed something?

I believe you are correct.

The Energy dashboard is able to display a sensor’s monthly stats but it depends on how it is configured, specifically its state_class. How are your sensors configured for state_class?

I’m not sure the energy panel is going to help me out since I want to track individual appliance consumption and not total consumption. Here is a portion of what my energy tab looks like now:

I want to add an additional column for the previous months total Kwh for each appliance. The current month state class of each device looks like this:

state_class: total_increasing
unit_of_measurement: kWh
device_class: energy
friendly_name: xxxxxxx

Does that give a better idea of what I’m trying to accomplish?

1 Like

When I view the Energy chart in Year mode, it displays a stacked-bar graph. I can tap on a stacked-bar and it reports each device’s consumption (for the selected month). If that’s insufficient for your needs, you may want to consider storing sensor data in Influxdb (long-term storage) and graphing it with Grafana.

Thanks @123 , I’ll play around with it. I guess I was just hoping for populate my data all in one spot instead of jumping back and forth. The energy tab is nice but I like the ability to easily break down the month usage and cost in one place. Thanks again for your prompt response. It’s much appreciated.

@mboarman Hi Bro,I really like ur table pic,could please share how to code the daily and monthly sum energe???

Hey there! I used a slightly tweaked version of some code that was posted here:

I ended up adding an additional column to keep track of the prior months energy usage. An example of my dashboard can be found here:

All credit goes to that guy! Let me know if you have any additional questions. Good luck!

Hi @mboarman ,could you pls help me to solve this: How to use utility_meter and integrations to summarize my energy and mileage?

To clarify, you just want to create three sensors that store:

current daily energy?
current monthly energy?
current yearly energy?

yes, totally right,just need the sum between start and end time

Moved this conversation over to the other thread.