A bit of further (I hope!) clarification: when the error occurs, the 
service is trying to read and save the value of the 'inTemp' record, as it 
exists (or should exist) in the dictionary that is passed into the 
service's event handler code. The service has, at that point, done nothing 
to the dictionary.

On Tuesday, April 8, 2025 at 10:23:16 PM UTC-4 Peter Fletcher wrote:

> My weather station is a Vantage Pro 2, using the standard weewx Vantage 
> driver, and I believe that the station is one which generates its own 
> archive records for weewx to process. The Davis documentation shows that 
> the archive record includes the inside temperature, and, indeed, almost all 
> the time, the service code finds the relevant key and value in 
> event.record. The error that I have described only occurs after the weewx 
> service has been stopped for a significant amount of time (not well 
> defined, but certainly more than a single 5-minute archive interval). The 
> problem, then, is not that the key:value pair is missing under *normal* 
> circumstances, but that it is missing under *certain* circumstances. 
>
> On Tuesday, April 8, 2025 at 7:21:21 PM UTC-4 Tom Keffer wrote:
>
>> Hello, Peter,
>>
>> Under normal circumstances, an archive record starts in one of two ways:
>>
>> 1. If hardware generation is supported, then the hardware provides it.
>> 2. If not, then it is extracted out of accumulated LOOP packets, which, 
>> in turn, come from the hardware.
>>
>> Either way, whether or not an observation type appears depends entirely 
>> on whether the hardware supplies it. If the device driver doesn't emit 
>> inTemp, then it will not appear in the archive records. There is no other 
>> source for it.
>>
>> Other types are synthesized (e.g., dewpoint) from measured observation 
>> types, but that's not the case with inTemp.
>>
>> Of course, I can't speak for a user supplied service. It may supply 
>> inTemp in some other way or, indeed, it could even delete it.
>>
>> Hope this answers your question.
>>
>> -tk
>>
>> On Tue, Apr 8, 2025 at 11:22 AM 'Peter Fletcher' via weewx-development <
>> [email protected]> wrote:
>>
>>> Are there any circumstances under which event.record in the event 
>>> structure passed to the NEW_ARCHIVE_RECORD handler would not be expected to 
>>> contain the key 'inTemp' (or, indeed, any other key corresponding to a 
>>> field in the database)? I ask because I am seeing some odd behavior in a 
>>> user-written Service. Basically, under certain rare circumstances (which 
>>> may be having to do with the service processing multiple Archive records 
>>> before any Loop records are processed), the service code errors out 
>>> reporting that the 'inTemp' key is not found in the dictionary. 
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "weewx-development" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected].
>>> To view this discussion visit 
>>> https://groups.google.com/d/msgid/weewx-development/eeefc048-1139-497f-9cf3-827c2df27b6cn%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/weewx-development/eeefc048-1139-497f-9cf3-827c2df27b6cn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/weewx-development/9d3f48f0-3768-4e1a-9084-1e9079e7f72an%40googlegroups.com.

Reply via email to