Windy station Posting


  • | Premium

    Hi, this is my first go at posting to windy, I just want to make sure i've got this right.

    my station is based on a raspberry Pi zero and has temp, pressure and humidity
    (for now, wind speed and more to come!)
    I'm currently trying to send these values to my registered station with the API key using a python script

    edit
    forgot to mention this is controlled by Cron and posts every 5 minutes as per the windy guidelines

    the script is as follows :

    *omitted*
    URL = 'https://stations.windy.com./pws/update/*MY-API-HERE*?'
    #while running
    try:
            #read the humidity and temperature
            humidity, temperature = Adafruit_DHT.read_retry(sensor, sensor_pin)
            #read the pressure
            pressure = bmp280.get_pressure()
    
            #set up URL PARAMS
           PARAMS = "temp={temperature}&pressure={pressure}&rh={humidity}".format(**vars())
            #deterimine if the reading is valid, and only print valid readings
    
          if humidity is not None and temperature is not None and pressure is not None:
             #post to windy station
              requests.get(url = URL, params = PARAMS)
    
    *omitted*
    


  • Well you configured it really working. really thankful for you to as i was looking for the same script.

    Thanks a lot


Log in to reply
 

Windyty, S.E. - all rights reserved. Powered by excellent NodeBB
NodeBB & contributors, OSM & contributors, HERE maps
Terms and Conditions     Privacy Policy