New energy upstream device inverted?

Hi,
Since the last update we can now add an upstream device.
This is super cool as it happens here to me:
I have a wall socket that count the power and energy, and later on, I have one other socket that is also counting these, and I need both of them to restart the latest one.
Until now it would count both energy meters for the total consumptions with obviously is wrong. But last update fixed this.
That said, I don’t understand the legends here.

When I add an upstream device, I would expect that the upstream count the energy, but not the one that have set this upsteam as the upstream device.

If the wall here is FB Bureau Gauche in my case, the Routeur should not be counted.
But the legend in the hourly graphic seems to say the opposite, so I’m lost.


As I can’t upload the others images, my Router is set with upstream for the FB Bureau Gauche, and the FB Bureau gauche has no upstream device

Ok I see. It can also make sense but both option would be better then.
Because here they all have perfect counting except the main one is the only one to take into consideration for the total amount as the other ones are inside it.
It’s confusing for me here. :slight_smile:

I had the same understanting. I tought the downstream device would not be counted and HA would only consider upstream device. It’s also confusing for me.

I have the same issue and this is really confusing. I would expect that the upstream device would report all its consumption EXCEPT the consumption of all the downstream devices. Instead i get this strange negative value.

In my configuration, “Cucina” is the upstream device and “Frigorifero” is downstream. Why do i get negative values?

Yes that is the expected behavior. Can you share a CSV dump?

You will get a negative value in the parent if the children report total consumption greater than that of their parent device.

How to do a dump? Sry, never done that :frowning:

If i might assume a possible reason…maybe this happens because the power meters have different reporting time interval? “Frigorifero” is on a power meter that updates every second. Cucina has a refresh time of 4-5 seconds. This might be the issue?

Here is the dump

entity_id,type,unit,2025-04-11T22:00:00.000Z,2025-04-11T23:00:00.000Z,2025-04-12T00:00:00.000Z,2025-04-12T01:00:00.000Z,2025-04-12T02:00:00.000Z,2025-04-12T03:00:00.000Z,2025-04-12T04:00:00.000Z,2025-04-12T05:00:00.000Z,2025-04-12T06:00:00.000Z,2025-04-12T07:00:00.000Z,2025-04-12T08:00:00.000Z,2025-04-12T09:00:00.000Z,2025-04-12T10:00:00.000Z,2025-04-12T11:00:00.000Z,2025-04-12T12:00:00.000Z,2025-04-12T13:00:00.000Z,2025-04-12T14:00:00.000Z,2025-04-12T15:00:00.000Z
sensor.potenza,grid_consumption,kWh,0.20490996357602853,0.19127646395054398,0.2120972353986872,0.1905453750405286,0.1948242709954684,0.18520088564810067,0.19820745142760643,0.5629500891227508,0.22044313650212644,0.19166267887112554,0.18737814376981987,0.18838542693674754,0.26254100912274225,0.29116623672780406,0.6846019527060889,0.5180380561246238,0.39997984349884064,0.3176271242846269
sensor.potenza_cost,grid_consumption_cost,EUR,0.021853418589046214,0.020382477848670533,0.02257667454193779,0.02028258835946417,0.02073805512304716,0.01971369458115646,0.021098177514005556,0.06868808044853836,0.026897261741225975,0.023385628246046508,0.022862852786118992,0.022985755950372777,0.032033813128578004,0.03552650630786047,0.08353137322697535,0.06320816065584722,0.04880334544552056,0.03875511859234848
sensor.presa_asciugatrice_sommatoria_consegnata,device_consumption,kWh,0,0,0,0,0,0,0,0.00999999999999801,0,0,0,0,0,0,0,0,0,0
sensor.presa_lavatrice_sommatoria_consegnata,device_consumption,kWh,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
sensor.presa_microonde_friggitrice_e_vaporiera_sommatoria_consegnata,device_consumption,kWh,0,0,0,0,0,0.010000000000001563,0,0,0,0,0.00999999999999801,0,0,0,0,0,0.010000000000001563,0
sensor.power_meter_luci_sommatoria_consegnata,device_consumption,kWh,0.020000000000000018,0.010000000000000009,0.019999999999999962,0.020000000000000018,0.010000000000000009,0.020000000000000018,0.019999999999999962,0.020000000000000018,0.010000000000000009,0.020000000000000018,0.020000000000000018,0.010000000000000009,0.019999999999999907,0.030000000000000027,0.020000000000000018,0.030000000000000027,0.020000000000000018,0.019999999999999907
sensor.presa_pozzetto_sommatoria_consegnata,device_consumption,kWh,0.01999999999999602,0.00999999999999801,0.020000000000003126,0.00999999999999801,0.020000000000003126,0.00999999999999801,0.020000000000003126,0.00999999999999801,0.00999999999999801,0.020000000000003126,0.01999999999999602,0.010000000000005116,0.030000000000001137,0.01999999999999602,0.020000000000003126,0.01999999999999602,0.020000000000003126,0.01999999999999602
sensor.frigorifero_sommatoria_consegnata,device_consumption,kWh,0.020000000000003126,0.01999999999999602,0.03999999999999915,0.020000000000003126,0.01999999999999602,0.030000000000001137,0.030000000000001137,0.030000000000001137,0.01999999999999602,0.020000000000003126,0.030000000000001137,0.030000000000001137,0.030000000000001137,0.01999999999999602,0.020000000000003126,0.030000000000001137,0.02999999999999403,0.030000000000001137
sensor.presa_televisione_sommatoria_consegnata,device_consumption,kWh,0.03999999999999204,0.04000000000000625,0.04000000000000625,0.04999999999999716,0.03999999999999204,0.04000000000000625,0.03999999999999204,0.05000000000001137,0.03999999999999204,0.04000000000000625,0.03999999999999204,0.05000000000001137,0.03999999999999204,0.04000000000000625,0.03999999999999204,0.04999999999999716,0.04000000000000625,0.04000000000000625
sensor.aqara_smart_plug_pc_sommatoria_consegnata,device_consumption,kWh,0.02400000000000091,0.023000000000024556,0.02199999999999136,0.02199999999999136,0.023000000000024556,0.022999999999967713,0.021000000000015007,0.02400000000000091,0.04699999999996862,0.023000000000024556,0.023000000000024556,0.020999999999958163,0.05700000000001637,0.12400000000002365,0.18199999999995953,0.3140000000000214,0.23399999999998045,0.12700000000000955
sensor.presa_divano_sommatoria_consegnata,device_consumption,kWh,0,0.010000000000001563,0,0.009999999999999787,0,0.009999999999999787,0,0.009999999999999787,0,0.009999999999999787,0,0.009999999999999787,0,0.009999999999999787,0,0.009999999999999787,0,0.010000000000001563
sensor.presa_bagno_sommatoria_consegnata,device_consumption,kWh,0,0.00999999999999801,0,0.010000000000001563,0,0.00999999999999801,0,0.360000000000003,0,0.00999999999999801,0,0.010000000000001563,0,0.00999999999999801,0,0.010000000000001563,0,0.00999999999999801
sensor.power_meter_cucina_sommatoria_consegnata,device_consumption,kWh,0.01999999999999999,0.03,0.03999999999999998,0.030000000000000027,0.02999999999999997,0.020000000000000018,0.03999999999999998,0.030000000000000027,0.02999999999999997,0.030000000000000027,0.020000000000000018,0.040000000000000036,0.029999999999999916,0.030000000000000027,0.030000000000000027,0.020000000000000018,0.039999999999999925,0.030000000000000027
sensor.energia_luci_esterne,device_consumption,kWh,0.00032691980736111736,0.0006494184640277734,0.0004526754148611034,0.00023310348305556616,0.0020309616745833314,0,0.0012525038931944371,0.0000561196815277859,0,0.0012778495577777799,0,0,0.003976506719444439,0,0.0011713126888888842,0.00034438777333334336,0,0

I don’t think reporting interval would matter that much, unless one was like larger than an hour, but all I can say is that for 5-6AM the parent sensor.power_meter_cucina_sommatoria_consegnata reports 0.02 kWh, and the child sensor.frigorifero_sommatoria_consegnata reports 0.03 kWh, which is impossible if the frigorifero is really included within cucina.

You’d have to dive deeper into the data to understand how that came to be possible. But given that input data, showing -0.01 for the cucina seems to be the correct result.

I understand! What probably happens is that when the only deviced powered on is Frigorifero, the Cucina power meter may report a slightly different value from the Frigorifero power meter because of different measurement device tollerance.

Frigorifero has probably reported a higher value that Cucina, hence the problem.

Can you think of any workaround to account for this small differences, maybe with a custom helper sensor?

In this case maybe the subtract group of powercalc can be of some help?
I always have the doubt that upstream and subtract do the same thing, but not sure of this.
Do you know if subtract works like upstream or not? Or they can live together?

The whole concept of device hirarchy is much needed and its great that it is being implemented and worked on! Huge thanks to the devs!

At its current state however it either is more of a beta version or I am too stupid to understand how it is supposed to work:

In my configuration the electric boiler, water pressure and water treatment are configured as downstream devices from “Technical & Garden” yet they all get thrown onto the level “home” in the Sankey diagram instead of being substreams of “Technical & Garden”.

Since I (sadly) have no other source than the grid its absurd for the “home” section to be wider than the “grid” - it makes it seem that there is energy produced out of thin air!

In the energy dashboard it seems to somewhat work, but there is really no transparent way of checking how those numbers are put together, making it kinda hard to trust them:

Generally the fact that it labels anything that is not hooked up to its own meter as “untracked” is confusing. It is very much tracked - by mathematically substracting downstream devices from the total!

This feature needs e.g. some interactive tree-like UI for cascading devices and seeing the effect of it in real-time. Having to go into the energy dashboard → Configuration → Individual devices and then specifying the upstream device for each device without any topology overview makes this really intransparent and hard to understand.

1 Like

As far as I know the sankey chart hasn’t been updated to use this hierarchy information, hierarchy is only used in the Individual devices detail usage chart.

I think sankey is considered still in beta, since it is pretty hidden. Maybe it will be updated someday to leverage the hierarchy information.

Ah - so its sankey that is beta, not the upstream device feature. That would explain a lot. The fact that it is indeed quite hidden and not part of the default energy dashboard always baffled me as it really is one of the most useful graphics imo.

Would be very cool to see nesting in the sankey graphics - that would also solve the missing topology overview!

Yes it is really confusing…

The detailed consumptions are completely correct, but the “Total use of the single device” seems wrong to me.

Technically, I directly measure the Houseload (which is also the Groundfloor - because the first floor is his “slave”) and the Firstfloor. Since the first floor is part of the total house load, the correct total for Houseload should be:
Houseload – first floor.

Also, I measure my EVC, which is connected to first floor, so first floor should again be corrected:
firstfloor(calculated) = firstfloor (measured) – EVC.

Initially, I calculated this manually in configuration.yaml, but this caused spikes when sensor readings were delayed. Later I tried PowerCalc, which was better but still not perfect.

The new hierarchy function in the energy dashboard looks very promising! But if the hierarchy is like this:
Houseload (22kWh measured)
|–First Floor (19kWh measured)
|-----EVC (11kWh measured)
|-----Heatpump (5kWh measured)

I would expect this kind of result:

Meaning:
Each device’s total use should be subtracted by its child devices.

Example:

  • First floor (calculated) = First floor (measured) – EVC – Heatpump
  • House load = House load – First floor (measured)

Maybe an option could be added to configure this behavior?
Or alternatively, allow users to set a time frame (e.g., 24h) for “detailed consumption per device”?

The new Sankey seems promising. Device nesting now works and is correctly displayed, that is already great.

But now there is a new level of confusion: Where does all my Energy from “Technical& Garden” go? Shouldn’t there be an “untracked consumtion” stream showing all energy consumed by devices that are downstream from “Technical & Garden” but do not have their own power meter?

As it is, the chart makes it look like a large part of my Energy just evaporates!

Also it would be great if one could disable the “Grid” layer. I understand Its use if one has power generation such as solar, but if you don’t its pretty redundant, since “Home” and “Grid” will always be the same.

EDIT: Yes, I know I could template a sensor to substract all downstream tracked devices from “Technical & Garden” to get the missing stream. In my simple set-up thats feasible - but depending on how large an installation is, this method can get rather complicated real quick and also adding/removing meters would require to add/remove them manually out of these templates as well wich is prone to user error.

In a proper Sankey diagram, the remainder of the Technical & Garden would also flow over to the far right segment. It should be labelled something like “Technical & Garden (excluding downstream)” or something to that effect.

The whole point of the far right side of a typical Sankey is to show everything split out.

1 Like