That would make sense. I've had this same problem with pulse counters. Assuming that the sensor returns 0 or 1, one resolution is to use an accumulator that extracts the sum of values (rather than the default average). Then at the end of the archive interval, multiply the sum by the loop interval. The result will be the amount of time the sensor returned 1 during the archive interval, which should be the amount of time the sun was out.
On Thu, Jun 2, 2022 at 6:27 AM 'Peter Fletcher' via weewx-user < [email protected]> wrote: > I think that this is a sensor issue. If the sensor returns only a binary > (sun/no sun) value, which appears to be the case for this computed > 'sensor', then sampling it every 10 minutes will give results with a > granularity of 10 minutes, as the OP describes; if the sensor returns the > minutes (or seconds) of sunshine within the archive interval (similarly to > the way the Vantage Rain sensor works), then it doesn't matter (within > reason) how frequently or infrequently you sample it - the total will be > valid. For a Davis setup and this sort of computed 'sensor', the 'sensor' > will probably need to be sampled for each LOOP packet and the results > accumulated internally and the totals saved in each archive record. > > On Wednesday, June 1, 2022 at 9:50:47 AM UTC-4 [email protected] wrote: > >> My apologies, but I don't fully understand the problem. If the type you >> are trying to record is literally the amount of time the sun was out during >> the archive interval, then, in your example, why would no sunshine be >> recorded for the full 10 minutes? Wouldn't it be something less, but >> greater than zero. Say 8 minutes of sunshine? >> >> What, exactly, is the type that you are trying to put in the database? >> There is no type 'sunshine' within WeeWX. >> >> >> >> On Wed, Jun 1, 2022 at 5:33 AM Meteo Oberwallis <[email protected]> >> wrote: >> >>> Hello, everyone. >>> I have a question. Would it be possible to create a separate database >>> for sunshine time? The reason is actually that if the recording interval is >>> set to 10 minutes, the hours of sunshine are then only recorded at >>> intervals of 10 minutes. More precisely, if the solar value is too low in >>> minute 10 or 20 etc., but the value was higher during 8 minutes, then it >>> automatically takes the whole 10 minutes as no sunshine. But if you query >>> the solar value every minute via weewx and compare it with the "Sunshine >>> Time", you would have a much better record. If there was a separate sql for >>> the sunshine time, like e.g. the air quality sensor. In order to make the >>> whole thing even gentler, one could solve it in such a way that the >>> "automation" only becomes active as soon as the solar sensor delivers a >>> value. Is there any of that already? The graphics etc. can then be uploaded >>> normally every 5 or 10 minutes. But I would just like to have my own .sql >>> for the hours of sunshine, which reads the value every minute. The script " >>> https://github.com/Jterrettaz/sunduration" already exists. >>> >>> Thank you for your feedback >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "weewx-user" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/weewx-user/8ba76e85-40d0-4e20-84ea-a33b38120e3bn%40googlegroups.com >>> <https://groups.google.com/d/msgid/weewx-user/8ba76e85-40d0-4e20-84ea-a33b38120e3bn%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- > You received this message because you are subscribed to the Google Groups > "weewx-user" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/weewx-user/81f1fd56-ea21-4d69-9e9e-f76368201026n%40googlegroups.com > <https://groups.google.com/d/msgid/weewx-user/81f1fd56-ea21-4d69-9e9e-f76368201026n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "weewx-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/CAPq0zEAJRhyE-mhgKTiYRaREpD63-ebxRBoLAs8PjxtAyE2uSA%40mail.gmail.com.
