Powercalc - Virtual power sensors

Thanks for the advise, will do! The energy graph was included earlier but I cut off the title in the screenshot to make it extra confusing for you :wink:

1 Like

Hello all,

I configured Powercalc via YAML, just like this:

# PowerCalc
powercalc:
  scan_interval: 00:01:00 #Each minute
  power_sensor_naming: "{} Powersensor"
  create_energy_sensors: true
  enable_autodiscovery: true

Everything has been working just fine - and in the meantime quite a few lights have been added to the LUT. Unfortunately those that were missing back then when I initially set up PowerCalc do not show up now, although “Autodiscovery” is enabled.

How can I update my virtual sensors so that the ones added to LUT in the meantime will also show up in my HA instance?

Cheers, Zwo

After a reboot they should just appear. When this is not the case enable debug logs to get a clue why not.

Thank you, Bram, for the fast response!

Well, there are a few models which are listed in the LUT (e.g. LLC020 and LTW013 by Signify) but according to the log they cannot be found in the library:

2022-08-25 18:23:26.000 DEBUG (MainThread) [custom_components.powercalc.power_profile.model_discovery] light.garderobe_rechts: Auto discovered model (manufacturer=Signify Netherlands B.V., model=8718696598283)
2022-08-25 18:23:26.000 DEBUG (MainThread) [custom_components.powercalc] light.garderobe_rechts: Model not found in library, skipping auto configuration
2022-08-25 18:23:26.001 DEBUG (MainThread) [custom_components.powercalc.power_profile.model_discovery] light.hue_go_arbeitszimmer: Auto discovered model (manufacturer=Signify Netherlands B.V., model=7146060PH)
2022-08-25 18:23:26.001 DEBUG (MainThread) [custom_components.powercalc] light.hue_go_arbeitszimmer: Model not found in library, skipping auto configuration

Your Hue or other zigbee integration reports this bulbs as respectively 8718696598283 and 7146060PH.
These are not known in the supported models list yet.
We can add these model id’s as aliases for LLC020 and LTW013 but need to be 100% sure it’s exactly the same bulb and not some other generation of the bulb having other power characteristics.

Could you please create an issue on github for this? Also would be nice if you could include some references which indicates these are indeed the same bulbs.

Hi - something went wrong with my home assistant and I had to remove the powercalc integration, with a view to reinstalling it.

However - after removing it (through HACS) I am left with lots of “switchname_energy” and “switchname_energy_daily” entities which I cannot remove (They can’t be deleted via the GUI as they have no unique ID).

Any advice appreciated!

Thanks!

Refresh your browser and have another look, if they are really still there.

now I feel stupid!

Thanks!

Is anyone able to advise on how to use PowerCalc to correct the kWh being reported wrong with a specific device type?

I think, you should describe more, what you want to achieve, what is reported “wrong” and how and should be “corrected” in which way?

Plug reports every now and then a -21,000 kwh reading, normal wattage and ampage records fine.
Trying to work out if PowerCalc can be used to resolve that issue.

If wattage is reported and is correct, just use (only) this as input for Powercalc. It will calculate the rest, e.g. the clean kwh, etc.

BTW If it is a on/off-plug with high jumps, use integration method left. See docs.

Powercalc logs errors after updating in HACS.
Any idea what happened here?

Logger: homeassistant.setup
Source: setup.py:339
First occurred: 10:18:10 PM (35 occurrences)
Last logged: 10:18:13 PM

Unable to prepare setup for platform powercalc.sensor: Unable to set up component.

Thanks, but I’m not sure some of what you are referencing here as a solution.
Would be useful to know ‘how’ it calculates the rest, as in, what we’d need to do to actually have it calculate, what inputs, what formula, where in its config, etc.

Nm for this though, at this point, I’m gonna give up and send the plug back.

You should read the documentation, if you don’t know what poercalc is (for). If you have the wattage, it is fine and enough to setup a powercalc sensor. It will create the needed sensors, an energy meter (the correct kwh) and utility meters, if you want. Done. All described (with examples) in the doc. rtm

1 Like

As @arganto correctly indicates powercalc main purpose is to provide virtual power sensors for devices which don’t have a built-in meter. Besides that it can create energy sensors (riemann integration sensor) and utility meters, but these are just the same as the core components which you also can create with the helpers section in Home Assistant.
It has no tools to auto correct errors provided by some watt sensor of an other integration. This should really be solved by the integration of that smart plug or the firmware of it.

I would enable debug logging for Powercalc https://github.com/bramstroker/homeassistant-powercalc#debug-logging. Then check the full log when you restart HA. It will likely show what powercalc is failing on.

I was having the same error, after checking the log I could see that the auto-discovery was failing on a Tasmota bulb I have that did not have a model/name set in it’s Template. Look like powercalc expects that. I will actually log a powercalc bug report on that. I may need to break my config to collect that info.

You may have a completely different issue but the debug log will give you more information.

So i cant get this to auto detect my localtuya integration based arlec gridconnect globes.

They’re a supported model (GLD130P3HA gridconnect globes) but the debug mode reports there’s no correct model detected (example this is in the log: Auto discovered model (manufacturer=Tuya, model=bf495627b5078df453etvp - instead of GLD130P3HA)

Problem is powercalc detects the unique identifier for the light provided by Tuyas cloud via localtuya (so every light is a different model code). I tried “customizing” the entity with the model number and it does add it too the lights details but again doesn’t detect that.

I guess i need to add the sensors manually then? or is there some other way of getting powercalc to correct ID the globes

I don’t know localtuya, maybe other can help with that. Powercalc only reads the manufacturer and model known in HA, the correct information needs to be there for auto discovery to work.
You could just set them up manually with the GUI config flow or YAML.

Hi guys!
I have added some IKEA bulbs (both supported and not yet supported bulbs) The supported ones do get their entities created automatically, but even for supported bulbs it says that power meter isn’t available. I have toggled the bulb on/off (when off it actually displays the standby power, see pic) What do I need to do?

When turned off it displays the standby power: