Hello everyone!

I'm currently developing a custom weather station (a microcontroller 
collecting data from custom sensors and forwarding it to a RaspberryPi).
I already read the customization guide multiple times and started to 
develop a custom weewx-driver for my custom weather station.
The customization guide offers some very valuable insights. However, I 
still have some questions and misunderstandings I guess, so I hope some 
experienced users/developers can help me out. :)

As already stated I started developing my own driver, I also edited the 
weewx.conf and my custom driver is loaded when I start weewx with: sudo 
./bin/weewxd weewx.conf (it yields/prints packets)
I checked the sql table structures in the documentation and now I'm not 
sure how to save my custom sensors values.
For example: I have a windsensor (measuring windspeed only), a temperature 
sensor and 4 pyranometer sensors of different kind measuring the sun 
irradiation.
Now in my custon driver I know that I can store/assign the windspeed and 
temperature like this for example:

data = dict()


data['dateTime'] = int(data_array[0])  # unix timestamp
data['usUnits'] = weewx.METRIC
data['windSpeed'] = float(data_array[1])  # Anemometer measuring windspeed only
data['outTemp'] = float(data_array[0])  # PT100 measuring temperature outside


yield data  


So this should be straight forward if I understand correctly.
But how do I store my irradiation values from the various pyranomerters?

It seems that in the expected database structure there is only one column 
for irradiation available.
How can I store it so WeeWx can use it in its reports and archives?
I have smth. like this in mind:

data['radiation'] = float(dataset_array_sensor[2])  # pyranometer 1
data['radiation1'] = float(dataset_array_sensor[3])  # pyranometer 2
data['radiation2'] = float(dataset_array_sensor[4])  # pyranometer 3
data['radiation3'] = float(dataset_array_sensor[5])  # pyranometer 4


Would this work?
Do I have to change the sql database structure for it to work? (I plan to 
use sqlite for it as its easier to use it out of the box)
If so, how would I do it?

I did read the customization guide multiple times but I'm really confused 
regarding this.
I hope you can give me a hint into the right direction (I think I'm 
probably way overthinking this and just missing a small detail)
Thank you very much in advance! :)

Best regards, Henry.

Reply via email to