Energy hourly balance for Solar Instalations

You can simplify the template with max/min functions

Exported
{{ '%0.6f' | format( float(states('sensor.net_exported'), 0) + max(float(states('sensor.net_hourly'), 0), 0) )}}

Imported
{{ '%0.6f' | format( float(states('sensor.net_imported'), 0) - min(float(states('sensor.net_hourly'), 0), 0) )}}

Hi! @MiguelAngelLV
Today’s update you posted caused a dramatic spike in CPU usage. And as a result, an increase in Load 1,5,15 and processor temperature.

balance

balance1

You can help ?

I publish a update that would fix the problem.

1 Like

Thank you very much, the fix solves the problem. Good job.

Edit … 14.05
however, the problem returned

net

Yup, same issue here. 1.4.0 is working fine.

I am testing “very well” a V1.6 before of publish that should fix (of truth) the problem.

2 Likes

Published the new updated. I hope that now “it is the good”

This time it looks really good.

1 Like

Has someone experienced any issue since the last Home Assistant update? It seems the energy registration stops early in the morning and it doesn’t come back until I restart HA:

Do you check you inverter/metter integration?

I’m not sure about what you mean, but they (2 inverters) seem to be ok; they are reporting power and energy with no issues trough HA and the values reported are consistent with the values reported by the vendor’s app.
Maybe I should uninstall the HACS hourly balance addon and see what happens.

For me it wasn’t issue with Miguel’s addon, on your screen you dont even have info about inverter’s production which is not provided via this addon. This was some other issue in your HA.

1 Like

You should check if the missing data is available in inverters sensors in HA.

Exactly

Yes, HA is reporting power and energy with no issues. As an example: HA reported (by an automation) the exact consumption at 08:00 as usual.
Ok, I know you can’t help me with so little information; I’ve only asked just in case someone other had issues. I’ll investigate more.
Thank you!

Same issue in my HA during last night, HA was updated on yesterdays evening to 2024.07.1. Issue was impacting whole data in HA (graphs and values in entities).
Just to double check because maybe it was different addon or root cause.
@MiguelAngelLV aren’t you using database in the same way as those?

Hey, can’t help much here (I’m a simple user just dealing with some custom sensors) but just in case: I’ve restored a backup previous to the last HA update and the issue didn’t reproduced so far.
Sorry for posting here; I just suspected this addon was somehow related, because that never happened before; this was my first HA update after installing the Energy hourly balance addon and the first time I had that issue, but I can’t assure whether it’s related.
If you want I check any log, config or whatever, I can happily do it.
And man, @MiguelAngelLV thank you for your hard work!

Nop. The component not use the database directly, it only create 3 sensors and HA is have the responsibility of save the data.

1 Like

Hi there,
sorry for bugging you again, but I have a question. I have custom sensors to show me the daily exported and purchased energy (without the netting) and to notify me the total amounts at the end of the day via an automation. I’ve created these sensors using the Utility Meter through the total exported and total purchased sensors delivered by the inverters.
I’ve realized that these values aren’t the total (without the netting) anymore, so I’ve thought that the component is modifying these values (BTW, the values aren’t the result of the netting neither, they are even lower)
So I’ve created a cloned sensors for the total purchased and total exported ones, hopping I could use these new sensors to get the values without netting that I want to see, in addition to the netted values, but after creating the new sensors for the daily values through the Utility Meter using the new cloned sensors, I’m still having that unexpected values (not the daily total purchased and exported, not the netted values neither).
Someone has any idea about how I could get back the daily total purchased and exported energy without netting (and without loosing the netted values delivered by the add-on, of course)?

The component can’t modify the values returned by the inverter. It only read it, it not modified them (literally It can’t do it).

Maybe the problem is the utility meter, sometimes lose values after reboots for example.

It makes sense, because the total values for both sensors (total purchased and total exported) are absolutelly right.
The weird thing is that it never happened before; so I’m going to carefully review the configuration.yaml, just in case, to check if I’ve created a bug there.
Thank you for your answer!

1 Like