Powercalc - Virtual power sensors

I’m trying to combine some sensors for the christmas lights.
I have zigbee plug that show the active power (W), and i want to combine these lights into a (virtual) energy consumption sensor.

This is my setup configured in the UI:

This results in one entity that combines the power of the individual group members, but the virtual energy meter is missing.

Am i missing something ?

How do you know if there is heat demand? Which entity does provide this information to HA?

You’ll also need to add all the corresponding energy sensors to “Additional energy entities”, Kerst 01 energy, Kerst 02 energy etc.

Well, these devices don’t have energy entities (kWh), just power (W)

Google is your friend! Convert W to kWh? - #11 by koying

1 Like

This is a sensor that is exposed via the evohome RF integration returning a % of heat demand for that zone (or even a specific actuator), however easy to create a binary sensor of that via template in case heat demand is >0%.

Yes, you can just use built-in Riemann sum helper to integrate W to kWh. “Settings” → “Devices & Services” → “Helpers” → “Create helper”

Have a look at calculation_enabled_condition, you can put in a template there. Then use the fixed strategy to set the 28W. When the condition evaluates to true or 1 the power meter will record 28W, when this is false or 0 the power meter will record 0W (or standby power when you specify that as well).

1 Like

Great integration. Apart from the normal use I also use it in combination with the hass-virtual integration to add virtual devices which are not connected inside HA but I want them on my energy and Sankey dashboards to see an indication of the energy they use. I added my Mac Mini and two fridges which are on 24/7.
I do have a question of something I just do not understand. Why is the Powercalc integration discovering Shelly devices which already report the power usage?

Great plugin, love it! I am using the create_domain_groups to see aggregated power of all lights. Is there a way to add shelly dimmers to the calculation?

It should work as soon as the dimmer is configured as light. Isn’t it?

You might also have a look into daily fixed energy feature, which makes it possible to create energy sensors for devices not in HA.

Powercalc provides profiles for the self usage of the shelly devices. They all consume a littlebit of power even when turned off, so you can also get insights in that. So it’s an addition to the power usage of the connected appliance which the shelly plug itself provides.

1 Like

With the create_domain_groups only virtual power sensors created by powercalc are included.

You can create custom groups where you can also include the shelly dimmers with the GUI. Devices & Entitiies → Add Integration → Powercalc → Group. Add the shelly using Additional power/energy sensors option.
Or with YAML using the create_group option in combination with power_sensor_id and energy_sensor_id options.
See the readme for more info.

Hi Bram,

needed some extra template sensors again, so I tried:

sensor:


  - platform: powercalc
    entities:

      - create_group: All lights
        include:
          template: >
            {{expand('light.all_lights_only')|map(attribute='entity_id')|list}}

      - create_group: All switches
        include:
          template: >
            {{expand('group.all_switches')|map(attribute='entity_id')|list}}

      - entity_id: light.corridor_pool

ofc the templates are correct, and listing all entities in dev tools. All individual entities exist (and, already have individual powercalc sensors)

And yet, I get this error at startup:

Deze fout is ontstaan door een aangepaste integratie.

Logger: custom_components.powercalc.sensor
Source: custom_components/powercalc/sensor.py:238 
Integration: Powercalc (documentation, issues) 
First occurred: 11:21:12 (1 occurrences) 
Last logged: 11:21:12

Could not resolve any entities in group 'All lights'

and no sensors are created. the switch template does not show an error, but Powercalc does not create any sensors for that config either.

added to that, all other utility integration entities are now unavailable…

configuring the template entities individually like:

sensor:

  - platform: powercalc
    create_group: All lights
    include:
      template: >
        {{expand('light.all_lights_only')|map(attribute='entity_id')|list}}

  - platform: powercalc
    create_group: All switches
    include:
      template: >
        {{expand('group.all_switches')|map(attribute='entity_id')|list}}


  - platform: powercalc
    entities:

      - entity_id: light.corridor_pool
      - entity_id: etcetc
      - etcetc

does create the sensors.

is this a bug, or to be expected?

Could you create an issue on github please?

Hi there!! I want to ask you what kind of voltage have you used in your measurements for calculating wattage of each light? The reason I am asking is that the math for calculating Wattage includes voltage

Amps (A) x Volts (V) x Power Factor = Watts (W)

If you have used this equation then the output of the sensors created by Powercalc will work only for 120V or 230V depending where you are in the world.

Am I correct?

Depends on the voltage which the contributor used to measure the light. Pretty sure most have been done by europeans.
I believe most lights have another type number (model id) when they are for US market, so that would be a separate measurement/contribution.
But even when the model id’s are identical I assume the power reading would be pretty much similar, as the 120V version would just have a resistance to bring the A down to a similar Amperage as the 230V version (to have the same lumen output). So ultimately the power would also be more or less similar.

Also a question was raised about E26 bulbs vs E27. Not sure how we can be 100% sure and asume the power rating would be the same.
Hope someone else can join the conversion which has more in depth knowledge about this topic.

1 Like

Thank you for the answer, I work for an authorized dealer of the professional products from signify (Vari-Lite, Strand) so I could find a contact within signify to ask a few technical questions like the one above.

2 Likes

sure, consider that done: template group config not allowed under entities? · Issue #1421 · bramstroker/homeassistant-powercalc · GitHub