Powercalc - Virtual power sensors

Thankā€™s did it use also the states to know if the device is on or off?
It can be off with 100%.

When the fan is off it will be default to 0 watt. When you also want to define power draw when the device is off you can use standby_power option.

Like this:

- platform: powercalc
  name: Conso fan
  entity_id: fan.fan
  standby_power: 1
  linear:
    calibrate:
      - 33 -> 14
      - 67 -> 18
      - 100 -> 30
1 Like

MĆ©ga super great :+1:.

This is awesome.

I certainly ask more in few days as Iā€™m measuring all my devices due to you components :rofl:

1 Like

The docker container to automatically measure a light is AWESOME!
It is very easy to use, so Iā€™m planning to add a few lights soon.

Thanks. glad you like it. cool you want to contribute!

Me again :kissing_closed_eyes::joy:

Do I understand this correctly (the power_sensor_id parts)ā€¦

- platform: powercalc
  name: ups power
  power_sensor_id: sensor.ups_real_power

The sensor is the live consumption in w from my ups.

Does it allow to create a energy and add it correctly in energy dashboard?

Could help a lot of people who wants to add ups in this new energy things :stuck_out_tongue_winking_eye: (including myself).

May I made some PR on GitHub for those example (an example.md at root ie.) The readme is well documented but miss of some examples I think (no criticism). I understand that the base of this was oriented on light.

Do I understand this correctly (the power_sensor_id parts)ā€¦

Yes this is exactly the purpose of this option. Is your snippet working? Because Iā€™m pretty sure entity_id is mandatory.

May I made some PR on GitHub for those example (an example.md at root ie.) The readme is well documented but miss of some examples I think (no criticism). I understand that the base of this was oriented on light.

Yes the base of this was lights, but has been extended to support a multitude of use cases later on.
We can add docs to the repository but I think there are two better fits for user contributed examples.

There is a section ā€œShare your configā€ in discussions part.
But even beter fit for extensive examples would be the Wiki imho. I can add you as a collaborator. Than you could contribute by creating pages / articles.
In the main readme I can make a link to the Wiki section containing more configuration examples / use cases.

Iā€™ll look at this at the weekend

1 Like

Hi @bramski
Iā€™m trying to measure the power consumption of some Innr spots. My Shelly plugs can only measure the power above 2 or 3 watts which is at 50% brightness with 5 spots connected. Any sugestions on how to improve the power measurement or is this good enough to submit?

Strange, I did never experienced this before with my Shelly plug. It starts measuring from approximately 0.4 watt. Which shelly plug do you use?
Maybe someone else has an idea. You could also ask this question on discussions part of github repository, potentially users read there which are not on this forum.
Itā€™s not good enough to submit. Needs to have quite accurate measurements across the full brightness range.

Hi, sorry for the noob question.

I updated to 0.14 and deleted my previous config to use autodiscovery. I rebooted HA and waited for the sensor to be created. Nothing happened. Any hint?

I checked the log and no error there

Did you enable debug logging? Than you should see an entry ā€œStart auto discovering entitiesā€ followed by a lot of other log lines which should hopefully give some insight.

Yes I did. No entry like the one you described. I still can see some of the old ā€œenergyā€ sensors that now are unavailabe. Thatā€™s it.

This is the only entry I found:

2022-01-09 15:23:20 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration powercalc which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

Than you either have debug logging not correctly enabled, or you have autodiscovery option disabled (should be enabled by default in v0.14 though).
I am 100% certain when these conditions apply you must see at least see ā€œStart auto discovering entitiesā€ in the logs. And you should see a few log lines for each power/energy sensor created.

Enable debug logging:

logger:
  default: warning
  logs:
    custom_components.powercalc: debug

Try force enable autodiscovery:

powercalc:
  enable_autodiscovery: true

When you have still no logging lines with the above I really have no clue.

Hi @bramski ,

Just thankā€™s for your stuff, amazing component, why not try to integrate it as an official HA component?
Once again, nice job !

Anthony

Thanks. No plans on that, please see this github issue for considerations.

1 Like

@Jokerigno Please see issue 498 where two other users are experiencing similar issues. There is a resolution in my comment, however Iā€™m still unsure why things are not working ā€œout of the boxā€.

Is there a way to create a group of daily_fixed_energy devices? I donā€™t see any examples and I canā€™t seem to find a way to make it work, since thereā€™s no ā€œentityā€ to supply the entities section with, just names

Hi, doesnā€™t seem to work currently, however I think I will be able to make this work. Could you please create an issue on github with this feature request?

Adding

powercalc:
  enable_autodiscovery: true

Thank you!

worked for me as well!

1 Like