Powercalc - Virtual power sensors

Still a bit peculiar:
Can’t click the update entity in the repairs section , but we can redownload inside the Hacs interface.

Restart loads the correct version now. Thx for the manual intervention

Ah! Got it. Thanks for this. Moved all powercalc stuff (incl. Initial global config) to a dedicated powercalc.yaml and included it in the main config.

All works fine again.

2 Likes

Hi, I just started experimenting with this integration and I’m not sure if I’m reading the documentation wrong, or misinterpretting it.

I’d like to have an input_select for tariffs, and through reading the documentation it seems as though Powercalc should automatically create the helpers when I globally enable tarrifs in my config, but it’s only created the daily/weekly/monthly sensors, not the associated select helpers.

The only way I’ve been able to create the helpers is to create a utility_meter helper, but this results in me having double the amount of tariff sensors thst I need, since I’m now left with separate daily/weekly/monthly sensors created by powercalc AND utility_meter.

Am I doing something wrong here? I’ve set everything up via GUI, not yaml (except for the necessary configuration.yaml entries for powercalc).

Thanks

What does your configuration look like in configuration.yaml?

powercalc:
  create_utility_meters: true
  utility_meter_tariffs:
    - onpeak
    - midpeak
    - offpeak

That looks fine. Could you please create a bug report on github? And include debug logs after startup. We will figure out what the problem is.

Hi, I just recently discovered Powercalc, and since I have lots of bulbs which are not yet in the DB, I wanted to measure them through.

I have understood the principle how the measurements work and can be submitted from Measure — Powercalc documentation, and the first measurement is running right now (unfortunately, it seems to take >5 hrs for a RGBW bulb).

I have a bunch of questions regarding the measurements:

  • Once I have created the data, is there any way I can already use it in my HA instance, instead of having to wait for the PR to go through and a new Powercalc version being released?
  • For an RGBW bulb, I have now started with colormode.hv. Once this is through, do I need to measure again with colormode.color_temp?
  • Is there any way to make measuring an RGBW bulb quicker, e.g. can I safely reduce some of the sleep times?

Thanks for providing this great integration, keep up the good work!
Cheers,
Bernd

Awesome you want to contribute some new light models.
Here are answers to your questions.

  • Once I have created the data, is there any way I can already use it in my HA instance, instead of having to wait for the PR to go through and a new Powercalc version being released?

You can just put the folder(s) and files in config/custom_components/powercalc/data directory, and restart after that to test.

  • For an RGBW bulb, I have now started with colormode.hv. Once this is through, do I need to measure again with colormode.color_temp?

Yes when this light also allows to control color temperature. You can check that in developer tools. Lookup the attributes for your light and the supported_color_modes attribute.
The color temp mode measurements will take significantly less time than hs mode.

  • Is there any way to make measuring an RGBW bulb quicker, e.g. can I safely reduce some of the sleep times?

You may modify HS_BRI_PRECISION, HS_HUE_PRECISION and HS_SAT_PRECISION to decrease measure time for hs mode.

I just started the measurement for the color_temp mode, and it estimates about 4.8 hrs, so not significantly faster…

One more question: When re-running the script (I am runnig the docker version), I have to enter the whole device information (name, measure_device etc) again, which seems kind of superfluous. Is there a better way to e.g. run both loops (hs and ct) directly after each other?

You might also have a look at SAMPLE_COUNT and both SLEEP_TIME and SLEEP_TIME_SAMPLE. You may reduce those. But you’ll need to keep an eye if the power values update frequently enough.

One more question: When re-running the script (I am runnig the docker version), I have to enter the whole device information (name, measure_device etc) again, which seems kind of superfluous. Is there a better way to e.g. run both loops (hs and ct) directly after each other?

Currently no, there is no option to do multiple loops after eachother.

Nice power graph during the measurements, on the left ist the HS measurement, on the right the COLOR_TEMP one:
image

1 Like

A small enhancement request for the measure script.

I have some that I would like to add, but I cannot as my shelly cannot read measurements that low. It would be great if we could set some configurable starting level when you can actually measure the reading.
Maybe its not ideal, but it would be useful and how often do we actually use our lights at 1% brightness? :slight_smile:

I am not quite sure if this does what you want, but have you checked the MIN_BRIGHTNESS setting in the .env file when you run the script? This seems to do what you want:

# Brightness level (range 1-255) to start the measurements with.
# Some lights are turned off at 1 so you might need to increase this. Set this at the lowest level at which the light actually turns on
MIN_BRIGHTNESS=1
2 Likes

That could work, I could figure out that in HA when Shelly starts to show something then use that as the minumum.

Thanks

FYI: At the moment I am running it in a Synology Docker container, and passing in the parameters. Not the best method but it is working

1 Like

I can’t make it work with home assistant packages:

  • sensors appears if I write them in configuration.yaml, but not inside a Home Assistant package

What does your log say?

^^ This, and what does you configuration look like which is not working?

@breinonline @bramski It was my fault. I still don’t know why at the end of the package it doesn’t work, while at the start, it does. Probably some other component fault.
Thank you

1 Like

Question for this topic but how do you fine the on power level to the stand-by power? I have been trying to setup this integration but stumbling through all the setup. Now I have created a yaml file with all the lights, switches, etc like it shows on the documentation. Now should those entities should up in the integration? I see only the ones it finds by discovery but not the manual ones. Or will I have to hand jam all the entities in on the integration interface?

Sorry, but I don’t understand everything about your exact question.
You’ll need rephrase some of it.

What do you mean with “fine the on power level to the stand-by power”?

You can create sensors both with GUI or YAML. Only the ones create with GUI (also discovered ones) are shown on integration tab to modify their configuration. For the YAML sensors you can just edit the YAML file.
All created entities by Powercalc are to be found when clicking the entities link on the integration page.