Sensor watt usage etc for each month

Hi

I’m using a bunch of z-wave power measurement sensors trying to get control of my power usage, I’ve managed to create a template sensors that shows the current usage of all sensors, another sensor that multiplies that value with the cost per watt to get the current cost per hour for my usage.

Now I would like to create a sensor that measures the power usage from the first each month up to the current date/time, then resets at the end of the month. Has anyone done this or know of a way to do this?

I’ll try to ilustrate it with a pic of my current config

The badges shows the current usage and cost/hour, and the total usage/cost since “start”, which in this case is when i first enabled the z-wave device in my z-wave network.
this is were i would like to measure it per month instead, to show the total power usage for 1st of april to today (18th).

I can’t tell you how to do this only using hass. I’ve achieved something similar to what you’re trying to do using emonCMS (http://emoncms.org) and also, independently, using influxDB/grafana. For the latter I haven’t actually checked whether it is counting correctly.

If you’re interested in setting up another piece of software I can share screenshots of my settings.

The ultimate thing would be to have it in hass, but if can be done using influxdb/grafana that would work I already have those installed :slight_smile:

Add a single stat. Here is the select that I use:

SELECT cumulative_sum(difference("value")) FROM "kWh" WHERE "entity_id" = 'energy_sensor' AND $timeFilter GROUP BY time($__interval) fill(null)

Add a panel for each device you are monitoring. By selecting the period you should be able to see the usage for the given period.

I noticed it starts showing up zeroes if I use periods longer than a week that do not see lots of usage - e.g. 4-5kWh. I’d appreciate if you give me some feedback as to how precise the measurement is actually.

Not to necro a thread, but could you post your config for that power usage group? Looking to try to so something similar Thanks!