Thank you for this integration, I was struggling with being able to work with netted energy for a while. I was finally able to make sensors that reset every hour and tell whether there is import or export and calculate the cost based on the right tariff based on that. But then how to make that cumulative was the second question, this integration seems to do that
However, I have one question or maybe feature request. While within the hour we know what the current netted balance is, couldn’t this be used to show the real time netted values? At the moment, the sensor updates only once per hour (as we have hourly netting use in Finland still). What I am hoping is that I would see the real time cumulative info with these sensors.
I already tried creating a template sensor that calculates your sensors and the one I created (that resets every hour). But the issue there is the 5s offset so I get a spike at the end of each hour (well, this disappears right after but still a bit annoying). So therefore I was thinking why not add this (possibility at least) directly to this integration
That was the initial idea, but it doesn’t work. The problem is that the values would go up and down, since the balance changes during the hour and the total_increase sensors cannot lower their value.
Ok - and I guess for these sensor to work correct total increasing is the only way to set them up? My template sensor which is summing your import/export net sensors and hourly net seems to work except for the spikes at 59:55 mark at each hour. I tried adding this rule to the template sensor but it did not work:
state: >
{% set energy_base = float(states('sensor.net_exported'),0) %}
{% set energy_h = float(states('sensor.net_hourly'),0) %}
{% set last_seconds = now.minute == 59 and now.second >= 54 %}
{% if energy_h < 0 and not last_seconds %}
{% set energy_add = float(states('sensor.net_hourly'),0) %}
{% else %}
{% set energy_add = 0 %}
{% endif %}
{{ '%0.6f'|format( energy_base + energy_add ) }}
By defining “last_seconds” as time anything above 59:53 adding the hourly balance only if it is not last seconds of the hour I was hoping that it would not add the hourly sensor (that is, not adding after 59:53 when the integration does the adding). I think the safest way would be somehow to take this into consideration directly in the integration, but maybe it is not possible.
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.
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:
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.
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!