homeassistant-powercalc icon indicating copy to clipboard operation
homeassistant-powercalc copied to clipboard

Include non-PowerCalc energy meters into groups

Open thomaskonrad opened this issue 3 years ago • 1 comments

In my home, I have a combination of physical energy meters and virtual ones, also within the same area which I'd like to create a group for (e.g., lights).

It looks to me though that I can only group energy meters generated by PowerCalc into groups. It would be great if I could also existing ones, especially the ones provided by smart energy metering plugs.

thomaskonrad avatar Sep 22 '22 04:09 thomaskonrad

You can include existing energy sensors without any problem.

Just create a group sensor using the GUI and select additional power and energy sensors.

Screenshot 2022-09-22 at 09 58 43

bramstroker avatar Sep 22 '22 07:09 bramstroker

Oh, thanks for that, I missed it!

Can these be simply infinitly-counting energy (kWh) entities, or do they have to be utility meters with a reset cycle?

thomaskonrad avatar Sep 23 '22 10:09 thomaskonrad

Just the infinitly-increasing, not the utility meters.

bramstroker avatar Sep 23 '22 11:09 bramstroker

I'm asking because I'm getting really weird results with my test groups. For example:

  • I didn't use my washing machine (Waschmaschine) or laundry dryer (Trockner) today, which is correctly represented with the individual devices at the very bottom.
  • The group "Laundry [kWh]" at the top shows 15.5 kWh, which I do not know how PowerCalc came up with this value. It's the total energy consumption of only the washing machine since I installed my Shelly power meter. The laundry dryer used 115 kWh since I have the energy meter, so it is apparently considering the whole consumption since day 0 of only the washing machine. If it were just the total sum, it would be 130.5 kWh. I'm confused.
  • After all, I would expect only today's energy usage to show up in the dashboard. But it's a value where I don't see how it was calculated.
Screenshot 2022-09-23 at 12 54 41

These are the settings of the PowerCalc group:

Screenshot 2022-09-23 at 13 33 29

thomaskonrad avatar Sep 23 '22 11:09 thomaskonrad

You are looking at the energy dashboards which is looking at statistics. In the database this is the statistics table. These statistics are aggregated data per period and calculated each hour by HA (afaik). By default when you open the energy dashboard "Day" will be selected. When you add a new sensor (in this case the group energy sensor) it will calculate the aggregation. Maybe you have setup wrong yesterday, resulting in the calculation getting negative.

The grouped powercalc sensor should just sum both the raw values of Waschmaschine and Trockner together, so I suggest to first check these values in Developer tools. When the Waschmaschine is 20 kWh and Trockner 40 kWh the group sensor should be 60 kWh.

Hope this helps.

bramstroker avatar Sep 23 '22 11:09 bramstroker

Yeah, you're right @bramstroker. It looks like I first added a few devices, then removed some, and that lead to negative daily values. From the next day, they seem correct.

Thanks for your help!

thomaskonrad avatar Sep 26 '22 19:09 thomaskonrad

Good to hear it's working correctly for you.

bramstroker avatar Sep 26 '22 19:09 bramstroker