View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000230WebSolarLogBackendpublic2014-03-18 15:072014-04-09 17:56
Assigned Tomfrijmann 
PlatformRaspberry PIOSRaspbianOS Version3.10.33+ #656
Product VersionRelease 1.0.0 
Target VersionRelease 1.1.0Fixed in VersionRelease 1.1.0 
Summary0000230: kWh missing if wsl is started after sunrise
DescriptionStarting point to fix it:

      * here we do 2 checks;
      * 1. is (current KWHT - last['KWHT']) > 0
      * 2. is (sunrise['time'] - last['time']) > 18000 (5 hours)
      * if these checks are good; we are probably started later
      * with logging and so make a dummy record to fix the graph
      * and daily production

>We then create a "dummy history record" with the last known KWHT (kWh total) value and the time of today sunrise minus 30 minutes.

What about a "more than a day stop"? I think that some more checks are needed.
Additional InformationMy suggestion is to deal with daily/weekly/year output from devices who offer it. It will make the fix more relialable and it will never miss a kWh in the long period even if we have not a complete minute history.

Could be an option in config to make wsl compute an extimate rounding and a flag in db rows could say "extimate value" for distinguis sampled values from calculated values.


If (<Actual date-time sampled> - <Last date-time sampled>) gt <last sunset> -<today sunrise> then

/* extimate missing sampling periods */

Adjust year using total cumulative if needed (weigthed using theoric ones)
Adjust monthly using year cumulative if needed (weigthed using theoric ones)
Adjust weekly using month cumulative if needed (weigthed using theoric ones)
Agjust Daily using day comulative if needed (weigthed using theoric ones)
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
mfrijmann (administrator)
2014-03-18 15:18
edited on: 2014-03-19 09:56

By far not all scripts can provide daily, monthly, yearly figures. So the suggested option is not(!) generic available. This means we need to program allot of lines to "fix" it this way.

When using the total kWh figure (that all scripts deliver), we also are not missing kWh's or Wh's. I just submitted a fix that i tested and seems to work great. It could be tested by;
1. stop WSL on day X after sundown
2. start WSL on day Y about 60 min. after sunrise

Please test it for me.

example for "started to late";
18-3-2014 07:02, 980.000
18-3-2014 17:00, 999.000 (this day we generated 19kWh)
.... night ....
.... sunrise: 07:00 ....
19-3-2014 08:00, 1000.000 (we started to late and missing 1kWh)

18-3-2014 07:02, 980.000
18-3-2014 17:00, 999.000 (this day we generated 19kWh)
.... night ....
.... sunrise: 07:00 ....
19-3-2014 06:00, 999.000 (add dummy record one hour before sunrise time to fix totals)
19-3-2014 08:00, 1000.000 (WSL started and we already have generated 1kWh for today and are happy :) )

mfrijmann (administrator)
2014-03-19 09:37
edited on: 2014-03-19 13:49

And where you able to test it for me?

Just release another "problem" when using the Daily value;
By sunset most inverter are already to sleep and we are not able to query them.
One would be possible to query the inverter the next day and in the mean time (sunset till sunrise the next day) WSL will show the wrong figures.

In the case that WSL shutdown to early;
We could on inverter awake check if the totalKWH value is bigger then the last record of the day before. If so, we could add a end of the day dummy record with the totalKWH value that the inverter reports on awake.


sunset is 18-3-2014 on 17:30
unexpected WSL shutdown is 18-3-2014 15:00 with 990 on the totalKWh counter
sunrise the next day on 19-3-2014 07:00 the inverter reports 999.000 on the totalKWh counter
In this case we missed 9KWH and we add for 18-3-2014 18:00 (half our after sunset) a dummy record with a totalKWH of 999.

Then the records would look like;
18-3-2014 07:02, 980.000
18-3-2014 14:55, 989.900
18-3-2014 15:00, 990.000
18-3-2014 18:00, 999.000
19-3-2014 07:00, 999.000

On 19-3-2014 WSL will report that on 18-3-2014 there was generated 999-980 = 19kWh

Only when WSL crached before sunset and not restarted before sunrise the next day, we will miss data some kWh's. But in this case you could correct this in Admin::Yields

mfrijmann (administrator)
2014-03-19 14:13

More days offline?
In that case i think that the user have a more serious problem.

With Admin::Yields its possible to add/change missing/incorrect production figures.
mfrijmann (administrator)
2014-03-20 09:06
edited on: 2014-03-20 09:06

This morning i tested it myself by forcing WSL to start to late and here are the results; [^]

Sunrise time is 6:43
WSL started around 08:10
In the time between sunrise and WSL starting we generated about 250Wh.
When i started WSL it showed 0kWh generated
After the first history interval it generated an dummy record and the first official history record. After that both counters on the dashboard showed about 250Wh production.

After some time a generated the above screenshot and checked the production with the Aurora counters and it "matched".
There was a small difference, but my system generated at that moment about 1500Wh(1Wh every 2,5 seconds) and in the few seconds i need to make the screenshot and run the aurora command the system generated some Wh.

Paolo (reporter)
2014-03-23 10:42
edited on: 2014-03-23 10:47

I finally tested late wsl startupand I confirm that WSL it's able to handle it. I didn't miss early morning generated power.

FYI, my dashboard, that I opened when I started wsl and I left open without "manual refresh", keeps showing 0 as power and trees and some other errors were shown in log. [^]

Here is some significant debug log I got:

20140323 101841 debug onDebug - QueueServer: start
20140323 101846 debug onInverterStartup - Aurora1
20140323 101854 debug onDebug - OTHER error (8) in /usr/share/nginx/www/websolarlog/classes/services/EnergyService.php [70] :: Trying to get property of non-object
20140323 101854 debug onDebug - OTHER error (8) in /usr/share/nginx/www/websolarlog/classes/services/EnergyService.php [71] :: Trying to get property of non-object
20140323 101854 debug onDebug - OTHER error (8) in /usr/share/nginx/www/websolarlog/classes/services/EnergyService.php [72] :: Trying to get property of non-object
20140323 101854 debug onDebug - OTHER error (8) in /usr/share/nginx/www/websolarlog/classes/services/EnergyService.php [73] :: Trying to get property of non-object
20140323 102000 debug onDebug - It looks like we started this morning to late, so lets 'fix' that by adding a dummy record
20140323 102001 debug onDebug - OTHER error (2) in /usr/share/nginx/www/websolarlog/classes/services/HistoryService.php [85] :: Creating default object from empty value
20140323 102008 debug onDebug - WeatherOWM::getData::Lets start with gathering weather data from OWM
20140323 102010 debug onDebug - OTHER error (8) in /usr/share/nginx/www/websolarlog/classes/devices/WeatherOWM.php [47] :: Trying to get property of non-object
20140323 102010 debug onDebug - WeatherOWM::getData::Looks like we didn't receive useful weather data::

After some minutes, dashboard page was automagically completly refreshed without any intervention (I'm using Chrome) and now missing values are correctly shown.

I never understood how and when wsl pages are automaticallly refreshed. Sometimes they refresh fast, sometimes slow, sometimes they didn't refresh, sometimes yes. Chrome problem?

Paolo (reporter)
2014-04-09 17:56

I need to restart from a backup of few days ago (2-apr-2014).

Having some day missing on db and no records for yesterday but only for some days ago, production started with the sums of all missing days production.

I don't know if this is the intended behavior, but to avoid bad highest values in stats could be better to restart from 0 if latest sampled value is later than currentsunrise - latestsunset.

- Issue History
Date Modified Username Field Change
2014-03-18 15:07 Paolo New Issue
2014-03-18 15:15 Changeset attached => SourceForge trunk r1792
2014-03-18 15:18 mfrijmann Note Added: 0000367
2014-03-18 15:37 mfrijmann Note Edited: 0000367 View Revisions
2014-03-18 15:38 mfrijmann Note Edited: 0000367 View Revisions
2014-03-19 09:37 mfrijmann Note Added: 0000372
2014-03-19 09:37 mfrijmann Assigned To => mfrijmann
2014-03-19 09:37 mfrijmann Status new => feedback
2014-03-19 09:52 mfrijmann Note Edited: 0000372 View Revisions
2014-03-19 09:56 mfrijmann Note Edited: 0000367 View Revisions
2014-03-19 13:49 mfrijmann Note Edited: 0000372 View Revisions
2014-03-19 14:13 mfrijmann Note Added: 0000373
2014-03-20 09:06 mfrijmann Note Added: 0000377
2014-03-20 09:06 mfrijmann Note Edited: 0000377 View Revisions
2014-03-23 10:42 Paolo Note Added: 0000396
2014-03-23 10:42 Paolo Status feedback => assigned
2014-03-23 10:47 Paolo Note Edited: 0000396 View Revisions
2014-03-27 08:44 mfrijmann Status assigned => resolved
2014-03-27 08:44 mfrijmann Fixed in Version => Release 1.1.0
2014-03-27 08:44 mfrijmann Resolution open => fixed
2014-03-27 08:49 mfrijmann Product Version => Release 1.0.0
2014-03-27 08:49 mfrijmann Target Version => Release 1.1.0
2014-04-09 17:56 Paolo Note Added: 0000433
2014-04-09 17:56 Paolo Status resolved => feedback
2014-04-09 17:56 Paolo Resolution fixed => reopened

Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker