Oh, wait. Forgot about the sensor map. Your version is correct.

On Sat, Sep 26, 2020 at 2:24 PM Tom Keffer <[email protected]> wrote:

> You're on the right track, but the correct key is 'UV', nor 'uv'.
>
> On Sat, Sep 26, 2020 at 11:39 AM Per Edström <[email protected]>
> wrote:
>
>> During debug of sensors (DEBUG_.. = 1 in wmr200.py):
>>
>> Sep 26 17:00:35 RPi-3Bp-Arelien weewx[3203] CRITICAL __main__: Caught
>> unrecoverable exception:
>> Sep 26 17:00:35 RPi-3Bp-Arelien weewx[3203] CRITICAL __main__:     ****
>> 'UV'
>> Sep 26 17:00:35 RPi-3Bp-Arelien weewx[3203] CRITICAL __main__:     ****
>> Traceback (most recent call last):
>> Sep 26 17:00:35 RPi-3Bp-Arelien weewx[3203] CRITICAL __main__:
>> ****    File "/usr/share/weewx/weewxd", line 154, in main
>> Sep 26 17:00:35 RPi-3Bp-Arelien weewx[3203] CRITICAL __main__:
>> ****      engine.run()
>> Sep 26 17:00:35 RPi-3Bp-Arelien weewx[3203] CRITICAL __main__:
>> ****    File "/usr/share/weewx/weewx/engine.py", line 158, in run
>> Sep 26 17:00:35 RPi-3Bp-Arelien weewx[3203] CRITICAL __main__:
>> ****      self.dispatchEvent(weewx.Event(weewx.STARTUP))
>> Sep 26 17:00:35 RPi-3Bp-Arelien weewx[3203] CRITICAL __main__:
>> ****    File "/usr/share/weewx/weewx/engine.py", line 224, in dispatchEvent
>> Sep 26 17:00:35 RPi-3Bp-Arelien weewx[3203] CRITICAL __main__:
>> ****      callback(event)
>> Sep 26 17:00:35 RPi-3Bp-Arelien weewx[3203] CRITICAL __main__:
>> ****    File "/usr/share/weewx/weewx/engine.py", line 530, in startup
>> Sep 26 17:00:35 RPi-3Bp-Arelien weewx[3203] CRITICAL __main__:
>> ****      self._catchup(self.engine.console.genStartupRecords)
>> Sep 26 17:00:35 RPi-3Bp-Arelien weewx[3203] CRITICAL __main__:
>> ****    File "/usr/share/weewx/weewx/engine.py", line 638, in _catchup
>> Sep 26 17:00:35 RPi-3Bp-Arelien weewx[3203] CRITICAL __main__:
>> ****      for record in generator(lastgood_ts):
>> Sep 26 17:00:35 RPi-3Bp-Arelien weewx[3203] CRITICAL __main__:
>> ****    File "/usr/share/weewx/weewx/drivers/wmr200.py", line 1858, in
>> genStartupRecords
>> Sep 26 17:00:35 RPi-3Bp-Arelien weewx[3203] CRITICAL __main__:
>> ****      self._process_packet_complete()
>> Sep 26 17:00:35 RPi-3Bp-Arelien weewx[3203] CRITICAL __main__:
>> ****    File "/usr/share/weewx/weewx/drivers/wmr200.py", line 1712, in
>> _process_packet_complete
>> Sep 26 17:00:35 RPi-3Bp-Arelien weewx[3203] CRITICAL __main__:
>> ****      self._pkt.packet_process()
>> Sep 26 17:00:35 RPi-3Bp-Arelien weewx[3203] CRITICAL __main__:
>> ****    File "/usr/share/weewx/weewx/drivers/wmr200.py", line 672, in
>> packet_process
>> Sep 26 17:00:35 RPi-3Bp-Arelien weewx[3203] CRITICAL __main__:
>> ****      self._record.update(decode_uvi(self,      self._pkt_data[27:28]))
>> Sep 26 17:00:35 RPi-3Bp-Arelien weewx[3203] CRITICAL __main__:
>> ****    File "/usr/share/weewx/weewx/drivers/wmr200.py", line 863, in
>> decode_uvi
>> Sep 26 17:00:35 RPi-3Bp-Arelien weewx[3203] CRITICAL __main__:
>> ****      log.debug("  UV index:%s\n" % record['UV'])
>> Sep 26 17:00:35 RPi-3Bp-Arelien weewx[3203] CRITICAL __main__:     ****  
>> KeyError:
>> 'UV'
>> Sep 26 17:00:35 RPi-3Bp-Arelien weewx[3203] CRITICAL __main__:     ****
>> Exiting.
>>
>>
>> Current code:
>>
>> def decode_uvi(pkt, pkt_data):
>>     """Decode the uvi portion of a wmr200 packet."""
>>     try:
>>         record = {'uv': pkt_data[0 & 0x0f]}
>>         if DEBUG_PACKETS_UVI:
>>             log.debug("  UV index:%s\n" % record['UV'])
>>         return record
>>
>> Suggested change:
>>
>> def decode_uvi(pkt, pkt_data):
>>     """Decode the uvi portion of a wmr200 packet."""
>>     try:
>>         record = {'uv': pkt_data[0 & 0x0f]}
>>         if DEBUG_PACKETS_UVI:
>>             log.debug("  UV index:%s\n" % record['uv'])
>>         return record
>>
>>
>>
>>
>>
>> --
>> 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/4dc338b5-9684-4cc0-8a0b-bf300c5ffbcco%40googlegroups.com
>> <https://groups.google.com/d/msgid/weewx-user/4dc338b5-9684-4cc0-8a0b-bf300c5ffbcco%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/CAPq0zEC5ECydasr7j%3DgDkVCPSZCLMGPUorrZTgfivyGf2D%3Da1A%40mail.gmail.com.

Reply via email to