Comments (6)
Every midnight, while other statistics resets to zero (in the frontend, in the backend they are still counting energy), the two battery statistics reset to negative values (in the frontend, in the backend they are reset to zero as they are daily stats).
In HA documentation they say that they keep the initial value when the statistic is added, as zero-point... Don't know if this may be relevant?
from homeassistant-fusionsolar.
I think I will first need to read up on the documentation.
I don't think the Huawei Fusion Solar API exposes when the data is reset, for probably I will need to recalculate of take the current time or, ...
I don't have much time the coming weeks as I'm busy with other projects. So don't expect a change very soon.
Feel free to create a pull request yourself.
from homeassistant-fusionsolar.
Actually, Home Assistant recognize the "last reset" by looking if a "total increasing" sensor goes to zero. At the end the logic is clear: the sensor starts from zero, it is total and it is INCREASING, so it goes to (say) 20kWh, and if this sensor drops to 0, well that's a reset. HA is intelligent enough for this.
Problem is that there's something in the initialization phase that set the so-called "zero-value" of the sensor to the value that it has in that moment. In this way, when it resets, it goes back to the zero-value (so if you setup this integration at 4PM when you already produced 15kWh, every middnight, the dashboard will display -15kWh). Calculation is: actual value (0) - zerovalue (15) = -15.
I need to evaluate a possible solution for this too.
There's no hurry, your work is already excellent as is. Just putting the issue here if anyone would like to contribute. I will, as soon as I manage a possible workaround for this.
from homeassistant-fusionsolar.
Progress so far:
- Battery discharge capacity and Battery charge capacity are set to total, while they can set to total_increasing. See attached image. If sensor are kept total (without increasing) we should put in place routines to set last_reset based on drops to 0.
@tijsverkoyen for this specific behavior (battery charge and battery discharge capacities) state_class to total_increasing will solve the issue. But, we should be able to make this reasoning for all statistics, for example, the daily_* or monthly_* entities provided by Huawei.
I'm guessing if I'm the only one with this behavior (or maybe I'm the only one with a battery tracked in HA energy dashboard?)
from homeassistant-fusionsolar.
Changing line 535 in sensor.py from FusionSolarRealtimeDeviceDataEnergySensor
to FusionSolarRealtimeDeviceDataEnergyTotalIncreasingSensor
would solve.
But, I'm not sure if doing so would break other things. It shouldn't, but who knows. I'm testing it locally on my HA istance - keep you posted.
from homeassistant-fusionsolar.
I have merged your PR.
I will create a PR in a few moments
from homeassistant-fusionsolar.
Related Issues (20)
- Entities not Updating in Kiosk Mode HOT 8
- All sensors unavailable (Kiosk) HOT 5
- Half of entities are unavailable HOT 4
- Unexpected error fetching FusionSolarOpenAPIDeviceRealKpiType data: 'NoneType' object is not iterable HOT 15
- No more entities provided HOT 63
- User/pass is output to log file. HOT 4
- Always disconnecting HOT 3
- Lifetime energy does not recover after Kiosk max retries. HOT 10
- Energy dashboard showing wrong values HOT 2
- Wrong device_class? HOT 1
- Steps in cumulative quantities. (open api) HOT 1
- Kiosk mode: SyntaxWarning: invalid escape sequence '\?' HOT 2
- Question: have you ever considered using APIs from the web portal? HOT 5
- Error requesting FusionSolarKiosk data HOT 1
- Not in coordinator data HOT 5
- Some numerical sensors do not allow to be used completely in the statistics cards HOT 6
- New entities created when updating kiosk URL HOT 1
- sensor.solar_total_lifetime_energy unknown HOT 6
- Some sensors take previous values at midnight HOT 2
- Not all kiosk sensors are present in Home assistant HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from homeassistant-fusionsolar.