Powercalc - Virtual power sensors

I would suggest to introduce an input_boolean helper to define if the ESVE is actively charging, and put on some automations using the information you have to set it to true of false pretty reliable.
Than you can use this input boolean as the entity id for a virtual power sensor in powercalc.

1 Like

Iā€™m not really sure about your question. Normally when there is no power to a light the light entity should get unavailable in HA. When this is not the case this is a problem of the integration for the light (in this case KNX).
Normal behaviour of powercalc is the power sensor (created by powercalc) will also get unavailable when the light is unavailable. When you donā€™t want that you can have a look at ignore_unavailable_state option.

Thank you, found it and works great!

Hi,

is it possible to turn off a fictive daily fixed sensor?
I have two sensors for my refridgerators, and was hoping that this would work

 - platform: powercalc
    name: Frysbox
    unique_id: frysbox_energy
    daily_fixed_energy:
      value: 1.822505431
    calculation_enabled_condition: "{{ is_state('input_boolean.frysbox_defrost','off') }}"

but it does not seem like it does as the kWh sensor continued to increase this morning while defrosting.
Any suggestions?

I have only installed the integration and add the powercalc: in configuration.yaml file. And last night it crashed. Whole house offlineā€¦ This morning removed the line and integration and now HA is working perfect again.

So even without any entities etc itā€™s crashing. And it keeps crashing many times. My household canā€™t handle it haha. So canā€™t debug thisā€¦

This setting calculation_enabled_condition only works for virtual power sensors, not for the daily fixed energy. I will also not add that.
But you should be able to do like this maybe:

- platform: powercalc
  entity_id: sensor.dummy
  name: Frysbox
  unique_id: frysbox_energy
  fixed:
    power: 75.94
  calculation_enabled_condition: "{{ is_state('input_boolean.frysbox_defrost','off') }}"

I calculated your average power in Watt by this formula: 1.8225 * 1000 / 24

Now it will record 75.94 constantly when input_boolean.frysbox_defrost is off and 0 when on. The riemann sum energy sensor will integrate that to kWh over time.

Sad to hear you have this problem. Never heard a similar issue before.
You could try disabling auto discovery, than at least no power sensors should be created and powercalc should essentially do nothing at all. And check if HA stays available when you have that in place. Than we have at least something to work with.

powercalc:
  enable_autodiscovery: false

Not sure how to help you further with this issue when it canā€™t be debugged further.

When I have a moment to start this in morning so I have whole day in hope it will crash.
I will turn off the discovery part and see if this is issue. Ill come back on this

1 Like

hi. Iā€™m writing here because I believe there are people expert on the subject who may have already come across my problem, but the subject is not strictly speaking related to powercalc so feel free to ignore me.

I have installed powercalc for some time, it found the devices immediately, it started giving me consumption and it has always worked stably. magic!
however, I recently installed a power meter (clamp on the main meter) which measures the house total consumption. so now the consumptions in the dashboard are counted twice: one by the sensors created by powercalc and one in the ā€˜all includedā€™ sensor of the power meter.
my question is: what is the best way to handle this scenario?
should I remove the powercalc sensors from the sources and move them to ā€˜individual devicesā€™?

Yes. And this fits even better to the terms. One is the source (overall) and other are individual devices.

2 Likes

Thanks for the suggestion, I will try it out :slight_smile:

This setting calculation_enabled_condition only works for virtual power sensors, not for the daily fixed energy. I will also not add that.

Unfortunately I forgot/ignored to rename of uniq_id, so the new power sensor took on the old _energy id, thereby overwriting the historical kWh. I can crecalulate that, so no harm done there.
However, when I intended to use the service powercalc.increase_daily_energy it is not available in HA development view, only a powercalc.calibrate_utility_meter which is not documented - can I use that to set the intended/re-calculated kWh value of the new enegery sensor, so that I have the accumulated consumption?

I have added my Hue-lights through Zigbee2Mqtt. I can see the unavailable state within that add-on but i do not know how i can use this status for PowerCalc (the lights are never unavailable although they are unavailable in Z2M.

I am not using Zigbee myself so donā€™t know this addon. Powercalc just looks at the entities in HA. So when you have a light entity light.livingroom and it is unavailable in HA than the powercalc sensor should also be unavailable by default.

First of all the powercalc.increase_daily_energy service was only implemented a few days ago and is not released yet. But this will also only work with the daily energy sensors, not with the ā€œstandardā€ energy sensors.
You can create a feature request on github for that. Iā€™ll see if I can implement something similar for the standard energy sensors.
Or you have to live with the fact you donā€™t have the historic stats anymore.

@bramski first of all thank you for all the work on this custom integration and everyone adding measuring values. The created sensors are perfect for low cost power measuring.

But I do have a request for the integration from a management perspective. Currently in the integrations dashboard PowerCalc is shown as a tile with directly all the sensors. Since I have a large amount of sensors I was wondering if this cannot be showned like the Shelly or ZHA integrations

image

It would be much easier to navigate through a devices or entities screen

No I canā€™t unfortunately, each powercalc entity needs itā€™s own configuration persisted. This is called a config entry, and these are represented like this in the list. This is how HA presents it and there is no way for me to customize that.
Each config entry provides devices and/or entities. In case of powercalc each config entry has one power, an energy sensor, and maybe utility meters.
Itā€™s definitely a UX issue which can be made a lot better. When you have more than a few it becomes a nightmare to maintain. I have this same issue on my installtion with my shellyā€™s and ESP homes where I have more than 20 of each. Canā€™t find what I want and there is no way to search. There was a WTH post which suggested to have the option to display it in a list, same as entities, devices, helpers etc. WTH Can't view integrations as a list instead of cards?
I suggest you all to vote on that or provide feedback if you have a better idea.
Also see FR: Improvement to Integration 0-level UI Ā· Issue #1403 Ā· bramstroker/homeassistant-powercalc Ā· GitHub

2 Likes

Thanks for the reply. Just placed a vote and hopefully this will be fixed in the future. For know I am mostly glad the integration is created and with a standard naming scheme and search management can be optimized.

1 Like

Hi
just added a new heater (icehouse heater) to a group, and it is not showing up in the auto-view you so brilliantly pointed me towards :slight_smile:

Added last sensor (fixed - heater on a ikea-plug)

Restart - and it is adding a sensor (as expected):

and the sensor is listed in the attributes of the group (as exepected):

Output of the card (sum is ringt, but missing that one line for the icehouse heater.:

the actual card-code:

- type: custom:fold-entity-row
        head: sensor.pwrctrl_use_heating_power
        entities:
          - type: custom:auto-entities
            card:
              type: entities
            filter:
              template: >
                {{state_attr("sensor.pwrctrl_use_heating_power", "entities") }}
            sort:
              method: state
              reverse: true
              numeric: true

Can you look into this? I think the 'showing group-data is a powerfull feature to your solution, so it should work with all type of sensors included in a group.
Possible workarounds (have not tried them yet)

  • to create the sensor outside of the group? - would that make a difference??
  • other??

Hi
I was actually looking for something super simple, but this is waaaay better :slight_smile:
Thank you, let me try it :slight_smile: