Energy Management in Home Assistant

You are right, I got the same error, once some indeterministic time after a restart:
Found unexpected unit kWh for sensor.bulb_energy_meter_gas_meter

It’s because it’s difficult to reproduce and pin-down so it’s up to the us to find the cause and do bugfix and make a PR.

Could people post developer tool of their gas sensor, let’s try to spot the similarity.

Anyone know why my energy usage would show negative values?

This is my sensor

Everything is the same as yours.

1 Like

Thanks. Did you have to do any customization to get it like this?

The first time I added it it had wrong device class and no state class. I’m wondering if that’s the cause for not calculating cost.

I guess now we need someone whose gas price calculation works, for comparison.

Please go on with comments on this forum and add your case to this P
Or even make your own one ,
We have to make pressure on développer in order to increase their priority for fixing this issue

Regards
Phil

1 Like

your sensor is not total increasing as you can see on the second chart. At least not for the shown period. I guess the math behind it does not work in this case.
You should clean out the database for this sensor.

1 Like

It is clearly a DAILY sensor, resets it self every midnight as intended :wink:

Exactly. But the state class is clearly set to “total increasing”. Might be intended but is not suited for the energy dashboard.

If it is a sensor which resets daily then the TOTAL_INCREASING state class is correct and should work. New sensor state class: total_increasing | Home Assistant Developer Docs

I think you have the input inverted though. This would explain a lot of the weird behaviour you are seeing. Having said that I can’t see that in the other info you have provided….

1 Like

The state class is incorrect. Should be TOTAL or TOTAL_INCREASING

After adding prices for buy and sell of Electricity, energy isn’t working any more. Any idea how to rest it via ssh or so?
(Version core-2021.10.5)

Hi folks,

I found an unexpected behavior on the energy dashboard, when I navigate across different days, the details for the individual devices change, but if I select the single bar, it shows all the time the same value (I guess the latest period).

there isn’t any match between the graph and the details

do I misunderstand something, or this is the expected behavior?

REgards

Hi, Today - one of my energy sensors dropped to zero for a very short period of time.
I’ve faced this issue a few times before - with other sensors, which received their data from the Cloud API.

Due to this, I have changed the setup and integration - and now I am getting my data throught the local network.

Integration: SolarEdge Modbus.

A fix for the drop to zero is already available for this integration (but not yet released)… but after recalculating the Statisticts (recalculated the sum) - the dashboard was showing correct data - until the next statistic run, when the issue came back.

This was the wrong statistic after the drop to zero for the import and export meter
grafik

Here’s the history for both sensors:


As said, after recalculating the SUM for these values in the Database, the issue was gone - and the Energy Graph did show correct readings.
But shortly after, a new Statistic was calculated - and the SUM was wrong again.
It did show the same behave:

grafik

Here are the DB entries for these sensors:

Import:

Export:

According to the Discussion in the Repository of the integration, it is unclear, why the statistic was again calculated with this big increase…
Was there a change within one of the recent releases?

The discussion for this integration can be found here:
https://github.com/binsentsu/home-assistant-solaredge-modbus/issues/60

1 Like

I have EXACTLY the same issue started today. I have not encountered it before running Solaredge modbus. I’m so glad I found your post!
How can I clear, or tell home Assistant the correct value? Energy dashboard is a mess right now with this huge peak.


there are several reasons, why this “peak” might occur.
usually, it happens, when a sensor becomes unavailable (and the integration does reset it to zero in this case).

Then, when the sensor does get the correct value, the sum will be doubled, since it has the previous value + o + the new (same value) again.

Resetting it was “easy” since you could just recalculate the statistics for your sensor… but as explained - since this time, with each new statistic run, the issue came back…

Hi,
I was wondering, is there any new information on where the energy management stores its data?
I have reduced all logging/recording to an absolute minimum on my system and I would like to replace Grafana with Energy. But I don’t want Energy to create a load of I/O that I cannot control. All data it needs is already available in my InfluxDB. And nothing else.

It is stored in the database, the one created by recorder:

1 Like

Thank you! So as I have set my database to influxdb for recorder, it should store in influxdb as well.
It seems like Energy is creating a kind of Riemann sum in the background. Is this data available to plot as a graph? I wanted to plot the “Energy usage” as a line graph rather than the block diagram. Is this possible?
Because if it is creating a Riemann sum, it is doing it on-the-fly because there is no such data in the database. At least not if it truly is using the recorder database (influxdb).

I didn’t even know that was possible. The docs do not mention it. Recorder - Home Assistant

Not necessary to configure it in Recorder. If you set influxdb up as the default database, then all home Logger and Recorder automatically use it instead of the built-in database.
At least that is my understanding ( InfluxDB - Home Assistant ) and seems to work as I was able to limit what was logged there by configuring Logger and Recorder excludes.

But, as I said, Energy has not written a single Bit in there, so I am not quite convinced yet that Energy is in fact using this database. Unless eveything is calculated and created on the fly.