I have a few aqara outlets, and a few breakers that provide a reading of power and energy.
The entity state is energy.
What’s the best way to get the total of all sensors combined?
Is there a way to get the total of the Power attribute?
Is the only way to do a template sensor and add them up? Or is there a better way out there before I go into this. I have a lot of these to do around the house to get the power at a moment in time, so trying to find the best approach before I go down the wrong path.
This is what my aqara looks like:
@bramski, @michaelblight, thanks for the input. The groups with powercalc would be a solution for the energy entities I have.
I could not gather from reading through the docs if I can point to an attribute to create a group for power, not energy.
Or would I then create a new entity out of an existing entity’s attribute, and then use that new entity in a powercalc group given I want a group of power, not only energy so I can compare real-time usage.
I see the group does generate power and energy sensors, for entities we add, I was just not clear what it does if the entities already have one in their attribute, not the entity itself.
Either way, I will try it out now and see the output of powercalc and play with it.
Powercalc can create groups for both power and energy.
It’s a bit strange you have an entity where the power is in an attribute, and not a separate entity. Most (if not all) integrations provide this kind of information as an entity.
When you don’t have it in a seperate entity yet you can do so by making a virtual power sensor in powercalc and use a template to extract the value from the attribute.
Than you can add that new entity to the powercalc group.
yeah, that’s where I landed. I will have to create a virtual power sensor for each, then add that as a powercalc entity when I create the group. Playing with one area now, then will deploy to others. Have a ton of them…
Ton or work, but I think cleanest we it will all be managed within powercalc then.
Yeah, the aqara and my breakers (different brand altogether) have the power as an attribute. I only have a few others where like you said, I get 2 separate entities for power and energy.
dont want to take away anything from the great Powercalc integration by Bram (heavy user here), but you can also create a helper entity to combine entity values and use Sum
I added the entities to my powercalc. At first look, it automatically made a power entity for the group, and correctly added the power attributes. Didn’t have to go and make a bunch of power entities.
So I think this is the best way forward for me.
And with the nested groups, I can make one for my house, and have sub-groups for each room to have them tracked. I will keep playing around with it to see if there is any case that won’t work out. I haven’t used powercalc before other than the auto created WLED one.
I did a quick example in the GUI and seems to work.
I prefer handling in YAML though. I deleted the integration I created and moved the same to YAML, but for some reason it is not picking it up. I restarted HA as well.