Re: [weewx-user] Determine archive interval from within weewx

2022-06-14 Thread Tom Keffer
Generally, yes they are the same.

Formally, the archive interval returned by the engine is the length of time
it waits before attempting to create an archive record, whether via
hardware, or via software.

The value 'interval' in a record is the aggregation time of the values in
the record.

Off hand, I can't imagine a scenario where they don't match, but I suppose
it's possible.

On Tue, Jun 14, 2022 at 1:14 PM 'Peter Fletcher' via weewx-user <
weewx-user@googlegroups.com> wrote:

> Thanks! I take it that the interval returned by the engine in this way is
> the same as that in the archive packet - i.e. the hardware interval, if it
> is longer that that specified in weewx.conf.
>
> On Tuesday, June 14, 2022 at 3:19:48 PM UTC-4 tke...@gmail.com wrote:
>
>> When you instantiate a service, one of the parameters is the engine
>> instance:
>>
>> def __init__(self, engine, config_dict):
>>
>> The archive interval used by the engine can be obtained from it as
>>
>> engine.console.archive_interval
>>
>> -tk
>>
>>
>>
>> On Fri, Jun 10, 2022 at 11:07 AM 'Peter Fletcher' via weewx-user <
>> weewx...@googlegroups.com> wrote:
>>
>>> Yes. This is potentially even more of a problem if you only determine
>>> whether the sun is shining when the radiation value changes, which is what
>>> I now do (with a timeout to deal with the instances when the 'gap' is a
>>> multiple of 50+ seconds). I have addressed it slightly differently - I
>>> accumulate seconds of sunshine and the total seconds elapsed between
>>> computations in the LOOP code and use the *ratio* of these (for each
>>> archive interval) to determine sunshine time for that interval.
>>>
>>> On Friday, June 10, 2022 at 10:40:09 AM UTC-4 jterr...@gmail.com wrote:
>>>
 The Davis VP2 archive are recorded in the datalogger at the exact
 archive interval.
 So even if for any reason a service bound to NEW_ARCHIVE_RECORD is
 running a little bit later that the time the record was captured by the
 VP2, the data will still be valid, and the "*event.record['interval']
 " *will be the interval between the two last recors received from the
 VP2.

 Concerning our context of doing sunshine duration measurements based
  on LOOP packets, these loop packets may be not always in phase with the
 archive  at the time an archive record is processed by weewx for our 
 service
 So for instance, I saw initially  with my archive interval of 5 min and
 during  a period of full sunshine, that the sunshine duration derived from
 loop packets during  an "archive" interval"  was a little bit higher that 5
 min, or sometimes a little bit lower :

 2022-06-06 11:30:19  weewx[4501] INFO user.sunduration: Sunshine
 duration from loop packets = 5.016667 min, last radiation = 828.00, and
 last threshold = 639.982068

 Given the context of "slow" update of solar radiation of the VP2
 compared to the LOOP interval, I decided to round up the sunshine duration
 to full minutes

 Le 10 juin 2022 à 15:52, 'Peter Fletcher' via weewx-user <
 weewx...@googlegroups.com> a écrit :

 Thanks to all! Granted that you are most likely to need to know the
 archive interval in the context of an archive interrupt service, where it
 is easily available and the returned value is reliable, it would be nice if
 the actual working value (rather than just the value from weewx.conf) were
 readily available in other contexts.

 On Friday, June 10, 2022 at 9:04:06 AM UTC-4 jterr...@gmail.com wrote:

> "Using the interval field from the current archive record should
> always give the correct value.".
>
> I use it in my extension and it works very well:
> *event.record['interval'] *
>
> Le vendredi 10 juin 2022 à 05:04:45 UTC+2, gjr80 a écrit :
>
>> Whilst in almost all cases the archive interval used by WeeWX will
>> match the archive_interval config option in weewx.conf [StdArchive] this
>> is not always the case. Installs that use software record generation 
>> always
>> use an archive interval that matches the archive_interval config
>> option; however, when using hardware record generation if the archive
>> interval set in the station hardware is different to the
>> archive_interval config option the archive_interval config option is
>> ignored and the station hardware archive interval is used instead. This 
>> is
>> most commonly seen with Davis stations used with a default WeeWX install.
>> The Davis station uses an out-of-the-box 30 minute archive interval and
>> that value overrides the default WeeWX archive interval of five minutes.
>>
>> Using the interval field from the current archive record should
>> always give the correct value.
>>
>> Gary
>>
>
 --
 You received this message because you are subscribed to a topic in the
 Google Groups 

Re: [weewx-user] Determine archive interval from within weewx

2022-06-14 Thread 'Peter Fletcher' via weewx-user
Thanks! I take it that the interval returned by the engine in this way is 
the same as that in the archive packet - i.e. the hardware interval, if it 
is longer that that specified in weewx.conf.

On Tuesday, June 14, 2022 at 3:19:48 PM UTC-4 tke...@gmail.com wrote:

> When you instantiate a service, one of the parameters is the engine 
> instance:
>
> def __init__(self, engine, config_dict):
>
> The archive interval used by the engine can be obtained from it as
>
> engine.console.archive_interval
>
> -tk
>
>
>
> On Fri, Jun 10, 2022 at 11:07 AM 'Peter Fletcher' via weewx-user <
> weewx...@googlegroups.com> wrote:
>
>> Yes. This is potentially even more of a problem if you only determine 
>> whether the sun is shining when the radiation value changes, which is what 
>> I now do (with a timeout to deal with the instances when the 'gap' is a 
>> multiple of 50+ seconds). I have addressed it slightly differently - I 
>> accumulate seconds of sunshine and the total seconds elapsed between 
>> computations in the LOOP code and use the *ratio* of these (for each 
>> archive interval) to determine sunshine time for that interval.
>>
>> On Friday, June 10, 2022 at 10:40:09 AM UTC-4 jterr...@gmail.com wrote:
>>
>>> The Davis VP2 archive are recorded in the datalogger at the exact 
>>> archive interval. 
>>> So even if for any reason a service bound to NEW_ARCHIVE_RECORD is 
>>> running a little bit later that the time the record was captured by the 
>>> VP2, the data will still be valid, and the "*event.record['interval'] " 
>>> *will be the interval between the two last recors received from the VP2.
>>>
>>> Concerning our context of doing sunshine duration measurements based  on 
>>> LOOP packets, these loop packets may be not always in phase with the 
>>> archive  at the time an archive record is processed by weewx for our service
>>> So for instance, I saw initially  with my archive interval of 5 min and 
>>> during  a period of full sunshine, that the sunshine duration derived from 
>>> loop packets during  an "archive" interval"  was a little bit higher that 5 
>>> min, or sometimes a little bit lower :
>>>
>>> 2022-06-06 11:30:19  weewx[4501] INFO user.sunduration: Sunshine 
>>> duration from loop packets = 5.016667 min, last radiation = 828.00, and 
>>> last threshold = 639.982068
>>>
>>> Given the context of "slow" update of solar radiation of the VP2 
>>> compared to the LOOP interval, I decided to round up the sunshine duration 
>>> to full minutes
>>>
>>> Le 10 juin 2022 à 15:52, 'Peter Fletcher' via weewx-user <
>>> weewx...@googlegroups.com> a écrit :
>>>
>>> Thanks to all! Granted that you are most likely to need to know the 
>>> archive interval in the context of an archive interrupt service, where it 
>>> is easily available and the returned value is reliable, it would be nice if 
>>> the actual working value (rather than just the value from weewx.conf) were 
>>> readily available in other contexts.
>>>
>>> On Friday, June 10, 2022 at 9:04:06 AM UTC-4 jterr...@gmail.com wrote:
>>>
 "Using the interval field from the current archive record should always 
 give the correct value.".

 I use it in my extension and it works very well: 
 *event.record['interval'] *

 Le vendredi 10 juin 2022 à 05:04:45 UTC+2, gjr80 a écrit :

> Whilst in almost all cases the archive interval used by WeeWX will 
> match the archive_interval config option in weewx.conf [StdArchive] this 
> is not always the case. Installs that use software record generation 
> always 
> use an archive interval that matches the archive_interval config 
> option; however, when using hardware record generation if the archive 
> interval set in the station hardware is different to the 
> archive_interval config option the archive_interval config option is 
> ignored and the station hardware archive interval is used instead. This 
> is 
> most commonly seen with Davis stations used with a default WeeWX install. 
> The Davis station uses an out-of-the-box 30 minute archive interval and 
> that value overrides the default WeeWX archive interval of five minutes.
>
> Using the interval field from the current archive record should 
> always give the correct value.
>
> Gary
>

>>> -- 
>>> You received this message because you are subscribed to a topic in the 
>>> Google Groups "weewx-user" group.
>>> To unsubscribe from this topic, visit 
>>> https://groups.google.com/d/topic/weewx-user/W0jG1kElJ1k/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to 
>>> weewx-user+...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/weewx-user/87e7270c-2cbf-4438-a60b-638be2005049n%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>>
>>> -- 

Re: [weewx-user] Determine archive interval from within weewx

2022-06-14 Thread Tom Keffer
When you instantiate a service, one of the parameters is the engine
instance:

def __init__(self, engine, config_dict):

The archive interval used by the engine can be obtained from it as

engine.console.archive_interval

-tk



On Fri, Jun 10, 2022 at 11:07 AM 'Peter Fletcher' via weewx-user <
weewx-user@googlegroups.com> wrote:

> Yes. This is potentially even more of a problem if you only determine
> whether the sun is shining when the radiation value changes, which is what
> I now do (with a timeout to deal with the instances when the 'gap' is a
> multiple of 50+ seconds). I have addressed it slightly differently - I
> accumulate seconds of sunshine and the total seconds elapsed between
> computations in the LOOP code and use the *ratio* of these (for each
> archive interval) to determine sunshine time for that interval.
>
> On Friday, June 10, 2022 at 10:40:09 AM UTC-4 jterr...@gmail.com wrote:
>
>> The Davis VP2 archive are recorded in the datalogger at the exact archive
>> interval.
>> So even if for any reason a service bound to NEW_ARCHIVE_RECORD is
>> running a little bit later that the time the record was captured by the
>> VP2, the data will still be valid, and the "*event.record['interval'] " *will
>> be the interval between the two last recors received from the VP2.
>>
>> Concerning our context of doing sunshine duration measurements based  on
>> LOOP packets, these loop packets may be not always in phase with the
>> archive  at the time an archive record is processed by weewx for our service
>> So for instance, I saw initially  with my archive interval of 5 min and
>> during  a period of full sunshine, that the sunshine duration derived from
>> loop packets during  an "archive" interval"  was a little bit higher that 5
>> min, or sometimes a little bit lower :
>>
>> 2022-06-06 11:30:19  weewx[4501] INFO user.sunduration: Sunshine duration
>> from loop packets = 5.016667 min, last radiation = 828.00, and last
>> threshold = 639.982068
>>
>> Given the context of "slow" update of solar radiation of the VP2 compared
>> to the LOOP interval, I decided to round up the sunshine duration to full
>> minutes
>>
>> Le 10 juin 2022 à 15:52, 'Peter Fletcher' via weewx-user <
>> weewx...@googlegroups.com> a écrit :
>>
>> Thanks to all! Granted that you are most likely to need to know the
>> archive interval in the context of an archive interrupt service, where it
>> is easily available and the returned value is reliable, it would be nice if
>> the actual working value (rather than just the value from weewx.conf) were
>> readily available in other contexts.
>>
>> On Friday, June 10, 2022 at 9:04:06 AM UTC-4 jterr...@gmail.com wrote:
>>
>>> "Using the interval field from the current archive record should always
>>> give the correct value.".
>>>
>>> I use it in my extension and it works very well:
>>> *event.record['interval'] *
>>>
>>> Le vendredi 10 juin 2022 à 05:04:45 UTC+2, gjr80 a écrit :
>>>
 Whilst in almost all cases the archive interval used by WeeWX will
 match the archive_interval config option in weewx.conf [StdArchive] this
 is not always the case. Installs that use software record generation always
 use an archive interval that matches the archive_interval config
 option; however, when using hardware record generation if the archive
 interval set in the station hardware is different to the
 archive_interval config option the archive_interval config option is
 ignored and the station hardware archive interval is used instead. This is
 most commonly seen with Davis stations used with a default WeeWX install.
 The Davis station uses an out-of-the-box 30 minute archive interval and
 that value overrides the default WeeWX archive interval of five minutes.

 Using the interval field from the current archive record should always
 give the correct value.

 Gary

>>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "weewx-user" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/weewx-user/W0jG1kElJ1k/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> weewx-user+...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/weewx-user/87e7270c-2cbf-4438-a60b-638be2005049n%40googlegroups.com
>> 
>> .
>>
>>
>> --
> 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 weewx-user+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/d030a216-4cfd-4df3-ad3c-55ae8df63cf8n%40googlegroups.com
> 

Re: [weewx-user] Determine archive interval from within weewx

2022-06-10 Thread 'Peter Fletcher' via weewx-user
Yes. This is potentially even more of a problem if you only determine 
whether the sun is shining when the radiation value changes, which is what 
I now do (with a timeout to deal with the instances when the 'gap' is a 
multiple of 50+ seconds). I have addressed it slightly differently - I 
accumulate seconds of sunshine and the total seconds elapsed between 
computations in the LOOP code and use the *ratio* of these (for each 
archive interval) to determine sunshine time for that interval.

On Friday, June 10, 2022 at 10:40:09 AM UTC-4 jterr...@gmail.com wrote:

> The Davis VP2 archive are recorded in the datalogger at the exact archive 
> interval. 
> So even if for any reason a service bound to NEW_ARCHIVE_RECORD is running 
> a little bit later that the time the record was captured by the VP2, the 
> data will still be valid, and the "*event.record['interval'] " *will be 
> the interval between the two last recors received from the VP2.
>
> Concerning our context of doing sunshine duration measurements based  on 
> LOOP packets, these loop packets may be not always in phase with the 
> archive  at the time an archive record is processed by weewx for our service
> So for instance, I saw initially  with my archive interval of 5 min and 
> during  a period of full sunshine, that the sunshine duration derived from 
> loop packets during  an "archive" interval"  was a little bit higher that 5 
> min, or sometimes a little bit lower :
>
> 2022-06-06 11:30:19  weewx[4501] INFO user.sunduration: Sunshine duration 
> from loop packets = 5.016667 min, last radiation = 828.00, and last 
> threshold = 639.982068
>
> Given the context of "slow" update of solar radiation of the VP2 compared 
> to the LOOP interval, I decided to round up the sunshine duration to full 
> minutes
>
> Le 10 juin 2022 à 15:52, 'Peter Fletcher' via weewx-user <
> weewx...@googlegroups.com> a écrit :
>
> Thanks to all! Granted that you are most likely to need to know the 
> archive interval in the context of an archive interrupt service, where it 
> is easily available and the returned value is reliable, it would be nice if 
> the actual working value (rather than just the value from weewx.conf) were 
> readily available in other contexts.
>
> On Friday, June 10, 2022 at 9:04:06 AM UTC-4 jterr...@gmail.com wrote:
>
>> "Using the interval field from the current archive record should always 
>> give the correct value.".
>>
>> I use it in my extension and it works very well: 
>> *event.record['interval'] *
>>
>> Le vendredi 10 juin 2022 à 05:04:45 UTC+2, gjr80 a écrit :
>>
>>> Whilst in almost all cases the archive interval used by WeeWX will match 
>>> the archive_interval config option in weewx.conf [StdArchive] this is 
>>> not always the case. Installs that use software record generation always 
>>> use an archive interval that matches the archive_interval config 
>>> option; however, when using hardware record generation if the archive 
>>> interval set in the station hardware is different to the 
>>> archive_interval config option the archive_interval config option is 
>>> ignored and the station hardware archive interval is used instead. This is 
>>> most commonly seen with Davis stations used with a default WeeWX install. 
>>> The Davis station uses an out-of-the-box 30 minute archive interval and 
>>> that value overrides the default WeeWX archive interval of five minutes.
>>>
>>> Using the interval field from the current archive record should always 
>>> give the correct value.
>>>
>>> Gary
>>>
>>
> -- 
> You received this message because you are subscribed to a topic in the 
> Google Groups "weewx-user" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/weewx-user/W0jG1kElJ1k/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> weewx-user+...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/weewx-user/87e7270c-2cbf-4438-a60b-638be2005049n%40googlegroups.com
>  
> 
> .
>
>
>

-- 
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/d030a216-4cfd-4df3-ad3c-55ae8df63cf8n%40googlegroups.com.


Re: [weewx-user] Determine archive interval from within weewx

2022-06-10 Thread Jacques Terrettaz
The Davis VP2 archive are recorded in the datalogger at the exact archive 
interval. 
So even if for any reason a service bound to NEW_ARCHIVE_RECORD is running a 
little bit later that the time the record was captured by the VP2, the data 
will still be valid, and the "event.record['interval'] " will be the interval 
between the two last recors received from the VP2.

Concerning our context of doing sunshine duration measurements based  on LOOP 
packets, these loop packets may be not always in phase with the archive  at the 
time an archive record is processed by weewx for our service
So for instance, I saw initially  with my archive interval of 5 min and during  
a period of full sunshine, that the sunshine duration derived from loop packets 
during  an "archive" interval"  was a little bit higher that 5 min, or 
sometimes a little bit lower :

2022-06-06 11:30:19  weewx[4501] INFO user.sunduration: Sunshine duration from 
loop packets = 5.016667 min, last radiation = 828.00, and last threshold = 
639.982068

Given the context of "slow" update of solar radiation of the VP2 compared to 
the LOOP interval, I decided to round up the sunshine duration to full minutes

> Le 10 juin 2022 à 15:52, 'Peter Fletcher' via weewx-user 
>  a écrit :
> 
> Thanks to all! Granted that you are most likely to need to know the archive 
> interval in the context of an archive interrupt service, where it is easily 
> available and the returned value is reliable, it would be nice if the actual 
> working value (rather than just the value from weewx.conf) were readily 
> available in other contexts.
> 
> On Friday, June 10, 2022 at 9:04:06 AM UTC-4 jterr...@gmail.com wrote:
> "Using the interval field from the current archive record should always give 
> the correct value.".
> 
> I use it in my extension and it works very well: event.record['interval'] 
> 
> Le vendredi 10 juin 2022 à 05:04:45 UTC+2, gjr80 a écrit :
> Whilst in almost all cases the archive interval used by WeeWX will match the 
> archive_interval config option in weewx.conf [StdArchive] this is not always 
> the case. Installs that use software record generation always use an archive 
> interval that matches the archive_interval config option; however, when using 
> hardware record generation if the archive interval set in the station 
> hardware is different to the archive_interval config option the 
> archive_interval config option is ignored and the station hardware archive 
> interval is used instead. This is most commonly seen with Davis stations used 
> with a default WeeWX install. The Davis station uses an out-of-the-box 30 
> minute archive interval and that value overrides the default WeeWX archive 
> interval of five minutes.
> 
> Using the interval field from the current archive record should always give 
> the correct value.
> 
> Gary
> 
> -- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "weewx-user" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/weewx-user/W0jG1kElJ1k/unsubscribe 
> .
> To unsubscribe from this group and all its topics, send an email to 
> weewx-user+unsubscr...@googlegroups.com 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/weewx-user/87e7270c-2cbf-4438-a60b-638be2005049n%40googlegroups.com
>  
> .

-- 
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/74E37573-89E3-476D-AC38-1BFFAD723E5F%40gmail.com.


Re: [weewx-user] Determine archive interval from within weewx

2022-06-10 Thread Karen K
In website templates you can use $current.interval to access or display the 
interval.

Peter Fletcher schrieb am Freitag, 10. Juni 2022 um 15:52:46 UTC+2:

> Thanks to all! Granted that you are most likely to need to know the 
> archive interval in the context of an archive interrupt service, where it 
> is easily available and the returned value is reliable, it would be nice if 
> the actual working value (rather than just the value from weewx.conf) were 
> readily available in other contexts.
>
> On Friday, June 10, 2022 at 9:04:06 AM UTC-4 jterr...@gmail.com wrote:
>
>> "Using the interval field from the current archive record should always 
>> give the correct value.".
>>
>> I use it in my extension and it works very well: 
>> *event.record['interval'] *
>>
>> Le vendredi 10 juin 2022 à 05:04:45 UTC+2, gjr80 a écrit :
>>
>>> Whilst in almost all cases the archive interval used by WeeWX will match 
>>> the archive_interval config option in weewx.conf [StdArchive] this is 
>>> not always the case. Installs that use software record generation always 
>>> use an archive interval that matches the archive_interval config 
>>> option; however, when using hardware record generation if the archive 
>>> interval set in the station hardware is different to the 
>>> archive_interval config option the archive_interval config option is 
>>> ignored and the station hardware archive interval is used instead. This is 
>>> most commonly seen with Davis stations used with a default WeeWX install. 
>>> The Davis station uses an out-of-the-box 30 minute archive interval and 
>>> that value overrides the default WeeWX archive interval of five minutes.
>>>
>>> Using the interval field from the current archive record should always 
>>> give the correct value.
>>>
>>> Gary
>>>
>>

-- 
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/80966769-5730-4202-b592-58723a75c1fan%40googlegroups.com.


Re: [weewx-user] Determine archive interval from within weewx

2022-06-10 Thread 'Peter Fletcher' via weewx-user
Thanks to all! Granted that you are most likely to need to know the archive 
interval in the context of an archive interrupt service, where it is easily 
available and the returned value is reliable, it would be nice if the 
actual working value (rather than just the value from weewx.conf) were 
readily available in other contexts.

On Friday, June 10, 2022 at 9:04:06 AM UTC-4 jterr...@gmail.com wrote:

> "Using the interval field from the current archive record should always 
> give the correct value.".
>
> I use it in my extension and it works very well: 
> *event.record['interval'] *
>
> Le vendredi 10 juin 2022 à 05:04:45 UTC+2, gjr80 a écrit :
>
>> Whilst in almost all cases the archive interval used by WeeWX will match 
>> the archive_interval config option in weewx.conf [StdArchive] this is 
>> not always the case. Installs that use software record generation always 
>> use an archive interval that matches the archive_interval config option; 
>> however, when using hardware record generation if the archive interval set 
>> in the station hardware is different to the archive_interval config 
>> option the archive_interval config option is ignored and the station 
>> hardware archive interval is used instead. This is most commonly seen with 
>> Davis stations used with a default WeeWX install. The Davis station uses an 
>> out-of-the-box 30 minute archive interval and that value overrides the 
>> default WeeWX archive interval of five minutes.
>>
>> Using the interval field from the current archive record should always 
>> give the correct value.
>>
>> Gary
>>
>

-- 
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/87e7270c-2cbf-4438-a60b-638be2005049n%40googlegroups.com.


Re: [weewx-user] Determine archive interval from within weewx

2022-06-10 Thread jterr...@gmail.com
"Using the interval field from the current archive record should always 
give the correct value.".

I use it in my extension and it works very well: *event.record['interval'] *

Le vendredi 10 juin 2022 à 05:04:45 UTC+2, gjr80 a écrit :

> Whilst in almost all cases the archive interval used by WeeWX will match 
> the archive_interval config option in weewx.conf [StdArchive] this is not 
> always the case. Installs that use software record generation always use an 
> archive interval that matches the archive_interval config option; 
> however, when using hardware record generation if the archive interval set 
> in the station hardware is different to the archive_interval config 
> option the archive_interval config option is ignored and the station 
> hardware archive interval is used instead. This is most commonly seen with 
> Davis stations used with a default WeeWX install. The Davis station uses an 
> out-of-the-box 30 minute archive interval and that value overrides the 
> default WeeWX archive interval of five minutes.
>
> Using the interval field from the current archive record should always 
> give the correct value.
>
> Gary
>

-- 
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/5000bcff-7e75-4229-a2e8-d2f4f524f529n%40googlegroups.com.


Re: [weewx-user] Determine archive interval from within weewx

2022-06-09 Thread gjr80
Whilst in almost all cases the archive interval used by WeeWX will match 
the archive_interval config option in weewx.conf [StdArchive] this is not 
always the case. Installs that use software record generation always use an 
archive interval that matches the archive_interval config option; however, 
when using hardware record generation if the archive interval set in the 
station hardware is different to the archive_interval config option the 
archive_interval config option is ignored and the station hardware archive 
interval is used instead. This is most commonly seen with Davis stations 
used with a default WeeWX install. The Davis station uses an out-of-the-box 
30 minute archive interval and that value overrides the default WeeWX 
archive interval of five minutes.

Using the interval field from the current archive record should always give 
the correct value.

Gary

-- 
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/fe088665-ed01-4dde-9558-8578a86b53f8n%40googlegroups.com.


Re: [weewx-user] Determine archive interval from within weewx

2022-06-09 Thread Glenn McKechnie
On 10/06/2022, 'Peter Fletcher' via weewx-user
 wrote:
> I know what my current archive interval is (Davis's default of 5 minutes)
> and I don't have any plans to change it, but, in writing user
> services/extensions, which others may conceivably use in the future, I
> don't like to hard-code a value which may be different in a different
> setup. I am sure that the current value of the parameter is accessible to
> code running 'within' weewx (but not within an archive record handler), but
>
> I couldn't find how to access it.

If you are using StdService then config_dict is available.

In UradMon I've used that to fetch the default value along the lines of

sf_int = to_int(config_dict['StdArchive'].get('archive_interval', 300))

Full code from line 292. Adjust to fit.

(Hopefully the following link can be recreated if it gets mangled)

https://github.com/glennmckechnie/weewx-uradmon/blob/73fc63371944d3b5480c1cca0e9fa35feb68c649/bin/user/uradmon.py#L292


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAAraAzjkt63QnVF%3D-5cu6z_bS%2BKP03P74LpKwLGAXdK6X8gmoQ%40mail.gmail.com.


Re: [weewx-user] Determine archive interval from within weewx

2022-06-09 Thread 'Peter Fletcher' via weewx-user
I know what my current archive interval is (Davis's default of 5 minutes) 
and I don't have any plans to change it, but, in writing user 
services/extensions, which others may conceivably use in the future, I 
don't like to hard-code a value which may be different in a different 
setup. I am sure that the current value of the parameter is accessible to 
code running 'within' weewx (but not within an archive record handler), but 
I couldn't find how to access it.

On Thursday, June 9, 2022 at 4:55:36 PM UTC-4 lang@googlemail.com wrote:

> Not sure what you are exactly looking for,
> but you can see your current archive interval in the syslog (usually in 
> /var/log/syslog - just see two subsequent archiving log items) 
>
> or 
>
> in your weewx.conf (/etc/weewx/weewx.conf or /home/weewx/weewx.conf)
>
> [StdArchive]
>
> # If the station hardware supports data logging then the archive 
> interval
> # will be downloaded from the station. Otherwise, specify it (in 
> seconds).
> archive_interval = 300  #example
>
> Am 09.06.2022 um 21:40 schrieb 'Peter Fletcher' via weewx-user:
>
> This may seem like a very stupid question, but I have not been able to 
> google an answer. Is there a method or parameter that is accessible from 
> within (e.g.) a user extension which gives the current archive interval?
>
> -- 
> 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 weewx-user+...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/weewx-user/7ac93a73-ba27-4599-b30b-ff20d26e6970n%40googlegroups.com
>  
> 
> .
>
>

-- 
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/52fcc7c6-c222-4dbc-8f2a-aa7443910c48n%40googlegroups.com.


Re: [weewx-user] Determine archive interval from within weewx

2022-06-09 Thread 'Rainer Lang' via weewx-user

Not sure what you are exactly looking for,
but you can see your current archive interval in the syslog (usually in 
/var/log/syslog - just see two subsequent archiving log items)


or

in your weewx.conf (/etc/weewx/weewx.conf or /home/weewx/weewx.conf)

[StdArchive]

    # If the station hardware supports data logging then the archive 
interval
    # will be downloaded from the station. Otherwise, specify it (in 
seconds).

    archive_interval = 300  #example

Am 09.06.2022 um 21:40 schrieb 'Peter Fletcher' via weewx-user:
This may seem like a very stupid question, but I have not been able to 
google an answer. Is there a method or parameter that is accessible 
from within (e.g.) a user extension which gives the current archive 
interval?

--
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/7ac93a73-ba27-4599-b30b-ff20d26e6970n%40googlegroups.com 
.


--
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/f60ceaba-c3e0-fb62-b245-aa8427d312e7%40gmail.com.