My apologies, you said windDir and windGustDir and I read windGust and 
windGustDir. Vince is exactly right; the MQTT uploader ignores fields whose 
value is None. If you want to change this behaviour you need to modify the 
MQTT uploader code. If you convert to ordinal compass points None values 
will come back as a string 'N/A'.

Gary

On Monday, 29 May 2023 at 11:34:22 UTC+10 HoracioDos wrote:

> Hello Vince.
> I think it should work if I want to convert to ordinal_compass. This a 
> section from ZBX-Sender plugin where windir and winGustDir values are 
> converted to ordinal_compass.  I get  "N/A" = None
> My knowledge is quite limited to analize this problem in depth. I'm going 
> to connect things again and report back.  
>
>     def send_data(self, packet):
>          pu = packet.get(self.unit_system)
>          s = ""
>          f = Formatter()
>          for key,value in packet.items():
>              if key == 'windDir':
>                 vt = ValueTuple(value, 'degree_compass', 'group_direction')
>                 new_value = f.to_ordinal_compass(vt)
>              elif key == 'windGustDir':
>                 vt = ValueTuple(value, 'degree_compass', 'group_direction')
>                 new_value = f.to_ordinal_compass(vt)
>              else:
>                 new_value = str(value)
>              l=self.host + " " + self.prefix+key + " " + new_value + "\n"
>              s+=l
>              if weewx.debug >= 1:
>                 logdbg(l)
>
> Thanks!!
>
> On Sunday, May 28, 2023 at 10:05:15 PM UTC-3 vince wrote:
>
> Kinda impossible to convert 'None' to a number.  That's your issue.
>
> On Sunday, May 28, 2023 at 6:02:32 PM UTC-7 HoracioDos wrote:
>
> Hello gjr80.
> These are loop and archive packets for a WS3080 (FineoffsetUSB driver). I 
> replaced batteries for the external unit today and the anemometer and the 
> vane are not connected right now. But measurements (winGustDir and winDir 
> are there) Perhaps mqqt uploader dismisses them because of their None 
> value, but it used to show degree_compass or ordinal_compass values.
>
> ........
>
>

-- 
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/bbd793aa-1010-4bcf-b1af-81df16f0a76bn%40googlegroups.com.

Reply via email to