You have to put the sensor configuration for light.nachttischlampe under the group configuration, otherwise it will not be part of the group. Like this:
- platform: powercalc
create_group: Gruppe SZ1
entities:
- entity_id: light.nachttischlampe
standby_power: 0.4
fixed:
power: 15 #Power when the light is on
But this is in the docs and in the wiki of the github page really great explained and documented. I would suggest in reading through the docs 1-2 times.
I would like to clean up my calculations. Is there a way to reset the calculation of a group of devices? I know there is that service but I get often this error
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 711, in _handle_entity_call
result = hass.async_run_job(partial(getattr(entity, func), **data)) # type: ignore[arg-type]
AttributeError: 'VirtualUtilityMeter' object has no attribute 'async_reset_energy'
Traceback (most recent call last):
You cannot use the powercalc reset service to reset utility meters. Only the energy sensors are supported.
However I think you can use the reset service from the utility meter interation: Utility Meter - Home Assistant
Let me know if this works for you, then I will have a look if I can also call this service from the powercalc service when you want to reset a group, so you only have to call 1 service.
Probably because of “Some of the services are only available if tariffs are configured.”. Could you create an issue on github? I will see if I can make it work somehow, but I don’t know if it is possible yet.
I know when you create a utility_meter with multiple tariffs (i.e. peak and offpeak) it will create a select entity which you can use to switch from peak to offpeak and back.
The utility meter reset service select is limited to select.* entities, so it seems it only allows to reset the meters with multiple tariffs.
I have no idea why it does not support resetting a “simple” utility meter which doesn’t have multiple tariffs.
You could create a new topic on the community forum to ask why this is not supported, or how you can reset them. Or ask on discord.
Maybe someone else chimes in on this topic who knows more about this.
Just to be sure, I also created an utility meter entity without using powercalc.
utility_meter:
energy:
source: sensor.spot_bar_energy
name: My cool utility meter
cycle: monthly
This one also doesn’t appear in the reset service selection list.
I see why you don’t have this service. Powercalc creates utility meters, but does not execute the method which registers the service. I’ll see if I can improve upon that in the future.
For now you can either create a utility meter manual using the YAML I have put above.
Or you can use the GUI to create one (Settings → Devices & Services → Helpers → Create helper)
Just create one (does not matter for which entity) and you’ll get the service.
Try to define a utility meter via HA UI Helper and one via config-yaml, as in the example from Bram above, so both outside Powercalc. And see if the service will be enabled as well. Perhaps after a while or when one utility meter has valueas or … and the helper meter is updated or after 1-2 HA restarts.
And regarding groups. Not there isn’t, but you can call the service with more than one entity. I have put mine in one list and only paste it if I need to reset a lot of them.
How can I delete sensors of groups created by powercalc? I have renamed by existing ones but the old ones are still there and in the entities overview I can’t select the sensor and delete it.