Powercalc - Virtual power sensors

so wery wery spot on :slight_smile:

may I as why you are filtering out the unavailable ones? Is it not useful to see that a sensor is unavailable (asking just to increase my knowledge/understanding)

I actually had the similart setup with manually configured groups in lovelace (see the picture and the red square which is the manually configured one)
But with more and more devices enabled for control/summary, I was considering that two locations to maintain was enough for my ad-hoc-usage, so you solution is implemented on the green square, automagically showing details :slight_smile:

thanks for the great solution :clap: :clap: :clap:
(have been preaching to the HA-audience in Norway about it, and it is gaining momentum :+1:)

You can also show the unavailable ones, I had a problem with 4 of my Zwave sensors after power outage yesterday. So I had excluded them out to make the screenshot :wink: but forgot to remove that from the resulting YAML afterwards.

That’s cool.

I have been busy today reworking the powercalc documentation. Currently it’s one massive readme, so I decided to convert it to dedicated documentation site.
Readthedocs is used a lot for open source projects, so decided to go with that.

Current state is visible here here.
https://homeassistant-powercalc.readthedocs.io/en/latest/

Still some work to do but getting there.
As I am the developer and the documentation is user facing I am interested in any improvement/suggestions of the userbase.
Let me know if you have any additions or suggestions which can make the docs even more helpful.

3 Likes

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?