Docs about packet properties

22 views
Skip to first unread message

HA3MAK

unread,
Jul 31, 2025, 3:22:46 PMJul 31
to weewx-development
Hi,

I'm new to weewx development so maybe I missed what I'm looking for but I can't find it in the docs. I'm building a weather station with a Bosch BME280 sensor for temperature, humidity and pressure, a TechnoLine TX-20 anemometer and a technoline WS2307RAIN sensor. My driver works fine but I have became uncertain aboout properties of the packet in genLoopPackets(). I send the following packets:


In case of the following metrics I'm sure that I use the correct metrics and units:

#Time of the packet: int(time.time() + 0.5)
_packet['dateTime']

#Type of metrics. I use weewx.METRIC
_packet['usUnits']

# Wind speed in km/h
_packet['windSpeed']

# Wind direction in degrees
_packet['windDir']

#Outdoor temperature in celsius
_packet['outTemp']

#Outdoor humidity in %
_packet['outHumidity']

#Pressure in hPa/mbar; "barometer" is the "relative pressure" at the altitude of my station
_packet['pressure']


Here's the part I'm unsure with:

#Rain quantity between packets in cm/h?
_packet['rain']

My rain sensor gives impulses. 1 impulse equals to 0.518 mm rain. If I detect an impulse I send a packet with "_packet['rain'] = 0.518/10" and if I didn't detect new impulse the next packet reports "_packet['rain'] = 0". Is it correct?

So, is there any documentation where I can see the accepted packet properties with units and functions?

Thanks, HA3MAK

Tom Keffer

unread,
Jul 31, 2025, 3:38:58 PMJul 31
to HA3MAK, weewx-development
See the section Porting to new hardware in the docs. I think it answers all of your questions.

-tk

--
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 weewx-developm...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/weewx-development/6fdc09ab-9202-41f0-a1dd-d790bf9a7856n%40googlegroups.com.

HA3MAK

unread,
Jul 31, 2025, 3:43:52 PMJul 31
to weewx-development
I know this doc I started my work with this and the FileParse example code. I can't find about anything about packet structure, especially about rain packets. I'd like to add an UV sensor later also. I saw in the sqlite database structure weewx can handle UV also but no mention about units and packet properti name in the docs or maybe I'm careless.

Tom Keffer

unread,
Jul 31, 2025, 3:57:03 PMJul 31
to HA3MAK, weewx-development
Not sure if this answers your question, but there is no "rain packet", only LOOP packets and archive records. A LOOP packet can include many different observation types, including rain. The only requirement is that they all be in the same unit system given by field "usUnits". Valid values for usUnits are given in the Units appendix. More details under the Porting to new hardware section.

If you look at the database structure, you will see that it is very similar. There is a column "usUnits" which gives the unit system used by all the types in the row. (Unfortunately, due to processing limits, the same value of usUnits has to be used for all rows.)

As for the packet names, if they are to be stored in the database, they must be the same as the name used in the database schema.

Hope that helps. If not, perhaps you can be more specific about your question.

Reply all
Reply to author
Forward
0 new messages