Powercalc - Virtual power sensors

I can’t get this to work, even with the simplest configuration. I would like all my lights into one entity for Energy, but the grouping always fails with “Unknown”. Single sensors work nicely.

  - platform: powercalc
    create_group: All livingrom lights
    entities:
      - entity_id: light.stue_spotlights
      - entity_id: light.stue_lamps
      - entity_id: light.stue_ceiling_lamps

Any thoughts or even better: How do I include all my lights into one powercalc energy entity?

Could you enable debug logging for powercalc? See the readme last section. Than check the logs for errors and clues.
Does the power sensor work correctly? Or is that one also unknown?

“No entities could be resolved” The power entity doesn’t work either. I tried it now with several confirmed light groups. It works fine with single entities.

Hmm strange. Will have a look tomorrow or after Christmas. Are you able to create an issue on github with this information?

Will do! Thanks

i honest feel really dumb right now

i cant for the life of me setup a sensor for my lights

in my configuration.yaml file i have

but nothing shows up

regards
Jeremy

It is hard to tell because you didn’t format your code correctly but it looks like you don’t have any indents there at all?

As @OzGav correctly indicated min_power and max_power should be indented.
When it is still not working there should be an error in the logs indicating what is wrong.

Got it to work. the only issue i’m seeing is i have the sensors in my dashboard and the only way i can get a updated value is to restart the server. did i miss something or is this ment to happen?
server
lounge

No this is not supposed to happen. Which values are you referring to, the watt value of kWh?
Watt values should update realtime whenever you change the light brightness, for example light.computer_room_light

go no issue with the live watts part of the powercalc. but the total consumed (energy)(sensor.computer_room_switch_energy and sensor.server_rack_switch_energy) dont update ntil i restart the server

Could be you have to wait a bit for that to update. Just leave your HA instance running, those should update eventually. When the power value does not change powercalc forces a state change every 15 minutes to make the energy sensor update. When the power value changes (for example when you change brightness) the energy sensor should also update.
The energy sensors are just a Riemann integral sensore.

Now its calling me a liar and working without restarting LOL

Haha, glad you got it working. Have a happy holidays.

I may be doing this wrong, but after having installed Powercalc via HACS, nothing happens. If I understand your documentation correctly, Powercalc should automatically detect any entities which support auto configuration, but I’m not seeing any.
Do I need to add a line of two to my config?

The log doesn’t seem to give a hint.

Did you restart HA after you installed powercalc?
You could also enable debug logging, maybe that gives some clues (see last section readme).
You sure you have any lights from the supported models list?

based on the model names, I have at least two Signify/Hue supported lights. Haven’t checked the rest of my bulbs, but it’s mostly Hue as well.

I’ve restarted HA a few times. Do I need to install via integrations? Because can’t find powercalc there :slight_smile:

No you don’t have to do any additional installation through HA integration manager. Only install the component via HACS is enough.
You could try adding configuration for 1 light manual and see if that works.

When you did enable debug logging you should see a line “Start auto discovering entities”, followed by a lot of information.

edit
I’m pretty sure autodiscovery was disabled by default as it is a new feature, and was requested to be disabled by some users. Will be enabled by default in the future.

Try adding this to configuration.yaml:

powercalc:
  enable_autodiscovery: true

Will make this the default soon or update readme to avoid confusion.

adding a configuration for one light did it for the power sensors. They are now showing for every supported light - thank you :slight_smile:

Can’t find the energy sensors yet for integrating individual devices into the energy dashboard, but I’ll wait a little and see what happens.

Great!
Yes the energy dashboard can take some time. Usually an hour to a few hours. statistics will only be generated few times a day by HA.