Energy hourly balance for Solar Instalations

And you reboot after update?

Yes, today one additional time.
I see polish name in step configuration


but not in entity names (one more time added to check)

We can wait for others to confirm :slight_smile:

1 Like

For me I have seen already two times during a PV working hours that calculaton was delayed more then 5 seconds (once 8 and once 12 seconds) which caused small miscalculation in energy tab.
Most of the time its spot on 5sec before full hour

Its not a big problem but maybe can be customized :slight_smile:

1 Like
For example, turn on the water heater/AC when the net balance is greater than 1.0 kWh and turn it off when it's less than 0.5 kWh.

Should I understand that after reaching the set threshold, the device will be turned on and turned off either below the threshold or after each sensor reset (i.e. it will turn off e.g. the air conditioning every hour and then turn it on again)?

With a load of 700W, the device could work from 12 a.m. to 4 p.m. and will it be turned off after a full hour?

Sorry, it is bug in readme, you turn off with negative balance (-0.1kwh for example) for avoid turn off when balance reset.

1 Like

Umm… I check the readme and show negative value:

For example, turn on the water heater/AC when the net balance is greater than 0.2 kWh and turn it off when it’s less than -0.05 kWh.

Where you find the example with 0.5kwh?

Ok thank you, I understood. Thank you for this component.

This is my attitude (misunderstanding)

1 Like

I publish a video tutorial (in spanish but with english subs)

The new update have a configurable offset :wink:

Buenas.

Sabes si hay algún problema con la nueva actualización 2025 de Core de HA?

2024-01-16 18:17:14.487 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_TOTAL_INCREASING was used from balance_neto, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.TOTAL_INCREASING instead

Si te fijas, es para el 2025… Dentro de un año…

Es un simple aviso de que tengo que actualizar el código antes del lanzamiento del año que viene.

Llevo unos días con bastante lío, pero sacaré las actualizaciones oportunas antes de que sea un problema :wink:

1 Like

Ya me extrañaba porque funcionaba correctamente… muchísimas gracias… Por cierto voy a hacerte otra pregunta cambiando de tema… sabes si ha dejado de funcionar en meter de huawei, antes me encontraba el inversor+meter y ahora el meter no lo encuentra, sin embargo balance neto funciona correctamente. Gracias por todo.

Pues con el componente de Huawei a mí me siguen apareciendo los dos dispositivos.

Si el BNH te funciona es porque el meter lo está leyendo, otro tema es que te haya juntado todos los sensores o algo, pero los valores de exportación e importación los proporciona el meter, no el inversor.

Esto es lo que te comentaba

Pone desconocido, pero si entras salen los sensores?

Si,

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 :slight_smile:

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 :slight_smile:

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.

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) )}}