Powercalc - Virtual power sensors

Like it. But the tables are not that comfortable. The total width is wasting a lot of space on bigger screens. E.g. here, but for sensors, etc. as well:

And secondly and even most important/not good, you have always to scroll left and right to be able to read attribute and information.

Thanks for the feedback. Yes, I also noticed that, will see if there is an option to render that differently (like with the current readme).

did you try the group option on that?
I use that on groups, but also on light groups, so maybe it works on your powercalc groups too?

type: custom:fold-entity-row
head: sensor.alle_verlichting_power
entities:
  - type: custom:auto-entities
    card:
      type: entities
    filter:
      include:
        - group: sensor.alle_verlichting_power
    sort:
      method: state
      reverse: true
      numeric: true

edit
forget about that, I tested it myself, and it doesnt work unfortunately. Maybe the group option does not check a domain sensor.

or, it expects an attribute entity_id and not entities.

yep, thats it: lovelace-auto-entities/filter.ts at ddff75935810065a110337621b4334f111fddf22 Ā· thomasloven/lovelace-auto-entities Ā· GitHub

entity_id seems to be the default for an attribute listing the compound entities, so maybe a change to that would be helpful? wouldnā€™t break anyoneā€™s install as far as I can see now.

it would probably also allow us to use the expand filter in jinja on the powercalc sensorā€¦?

It has been entities since the beginning of powercalc groups implementation, so I am not sure if we should change it, because people may already depend on it.
But when some core functions can be used in conjunction with powercalc groups the pros outweighs the cons for me.

Hi all
I added yesterday a sonoff basic switch which controls my water heater with fixed method. I can see the entities but I donā€™t know what it needs to add them in the energy dashboard.
I can see in the instructions that they should generated automatically, but this is not my case

Can someone explain please?

image

The energy entity is the one for the dashboard. If it isnā€™t showing up after you give it a little time to populate with data then you will need to check the attributes in the developer tools and see if any are missing. Check the energy dashboard thread which will have more info.

So, I think it is ok at least from this integration. Do you know if I have to add this sensor it in the recorder too? Now I am thinking about it I have disable the domain sensor from the recorder.

You should just be able to add it in the energy dashboard configuration under ā€œIndividual Devicesā€
sensor.water_heater_energy is indeed the right one.
Even if it doesnā€™t populate yet you should be able to select the entity in the listing.

Settings ā†’ Dashboards ā†’ Energy
Screenshot 2023-01-17 at 08.30.48

Well, this is my problem. Until now it is not in the list. I manually add it in the recorder.yaml (I have excluded various domains in order my backups to stay below 1gb) and I think (hope) that this will be the solution. I report back after an hour.

ā€“solution: after the addition in the recorder,yaml it appears at once

image

1 Like

Ah ok, that would be the problem as only entities which have recording enabled are considered for calculating statistics (as the state history is needed for that).

1 Like

I have installed this integration and want to create the same nice dashboard as shown in this topic. but I have no clue what I need to do for this. can you please provide information how to create it ?

Which dashboard do you mean exactly?

I mean the lightbulbs with the power usage below. How do I add these to a Home Assistant dashboard?

powercalc

That would be simple. Itā€™s just the default light and gauge cards, with a grid and vertical stack.
Like this:

type: grid
cards:
  - type: vertical-stack
    cards:
      - type: light
        entity: light.my_light
      - type: gauge
        entity: sensor.my_light_power
  - type: vertical-stack
    cards:
      - type: light
        entity: light.my_light2
      - type: gauge
        entity: sensor.my_light2_power
  - type: vertical-stack
    cards:
      - type: light
        entity: light.my_light3
      - type: gauge
        entity: sensor.my_light3_power

Is anyone using Powercalc for a virtual EVSE sensor?

Iā€™ve recently switched to Ford vehicles and chargers, and one of the downsides of the transition is that I no longer have access to all of the sensor data that can be easily accessed from Tesla. The challenge is that this scenario involves multiple vehicles and multiple EVSEs. Iā€™m curious if anyone has any suggestions for this situation. Here are some of the details:

  • FordPass Integration through HACS provides a sensor for Distance To Empty, which has attributes for Charging Status, Charging Start Time, Charging End Time (predicted based on charge settings), and more. So it seems that creating a Template sensor for the Charging Status would be the first step, but this also doesnā€™t update in real-time as there is a delay of a few minutes.
  • Home Power Consumption reported through Tesla PowerWall integration, so I know that when my house is consuming more than 11.5kW of power, this particular EVSE without any sensor data is charging a vehicle.
  • There are two vehicles, both connected through the FordPass Integration above, so same limitations there.
  • There is another EVSE thatā€™s on a 30Amp line, so it uses roughly half of the power of the other one. This EVSE has a Z-Wave switch and sensor on it, so it has near-real-time updates as to active consumption.

Iā€™m ultimately exploring options to create a sensor for the EVSE that does not currently connect to HA, so it can track how much energy is consumed over time. I was thinking I could build some logic along the lines of IF one of the vehicles has charging status to X AND the overall consumption is greater than 11.5kW, then start this virtual sensor counter UNTIL the power consumption is reduced by 11.5kW OR the vehicle charging status changes. And this is why Iā€™m asking for thoughts as it definitely complicates the normal virtual power sensor configurationā€¦

Hi all,

I installed this great tool. Add al groups etc ā€¦ since then my HA crash all the time. When I remove the tool everything is back to normal. Can this happen because all sensors with kHw, Watt, Volt etc will write to database and also powercalc will write to database. So there is an overkill of information?

Is it good to exclude all sensors from writing to database (recorder integration) and only let powercalc store in database?

What errors do you get or how is it crashing exactly?

When it crash and HA restart the log is cleared all the time.
I donā€™t know how to prevent it to clear the log

First of all: Great tool :slight_smile:

Iā€™m having some Hue bulbs that are powered off by a normal switch and therefore should become unavailable when turned off. (Im using Zigbee2Mqtt).
But where do they report that state?

Or how can i tell Powercalc that they are unavailable if the switch is turned off (itā€™s also in HA through KNX integration).

Hard to say what causes this.
Itā€™s definitely a good idea to only record states of stuff you need history / statistics of.
What kind of configurations do you use for powercalc? Any template sensors you use?
Maybe disable some powercalc entries until you find the culprit.
You can enable debug logging for powercalc and just monitor it for a bit to see if you see any strange things (like constant state changes or something like that).
Do you see a pattern in how long HA keeps running until it crashes?