Windy Community
    • Unread
    • Categories
    • Groups
    • Go to windy.com
    • Register
    • Login

    windbird

    Scheduled Pinned Locked Moved Windy Stations
    2 Posts 2 Posters 1.2k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • mattybicM Offline
      mattybic | Premium
      last edited by

      Hi, I've just set up a windbird (1605) which is on openwindmap.org. Will it automatically show up on windy.com or must i register it?Cheers,

      MB

      1 Reply Last reply Reply Quote 0
      • S Offline
        SnowSky | Premium
        last edited by SnowSky

        Hi, This is a bit late - but probably not too late.

        Years ago if i remember correct, it wasn't this hard.
        It was possible to setup the windbird pioupiou to send the data automatically to windy; or to setup windy to collect the data from openwindmap. Exchanging stationID was almost the only necessary thing.

        I do not remember at when the functionality got lost - I would guesstimate about a year not seeing my windbird on Windy.

        Today I investigated (That's also the reason why I'm replying today); and it seems that both services, OpenWindMap/pioupiou and Windy do only serve APIs to collect data - but there is no initiator anymore, this means - you have to create some kind of automatism on your own.

        In my point of view this has become far too technical for the general audience.

        Prerequisite:
        Your dataretrieval URL will be: https://api.pioupiou.fr/v1/live/1605
        You have to create a station on windy ( https://stations.windy.com/ )
        This will give you a station ID (8 characters) and a password (approx 40-60 characters) for the station.

        Now the technical part, and this can be done in may ways. Every way I know requires you to have a device or computer running non-stop 24/7.
        In my case I am using node-red on a raspberry pi to call every 5 minutes https://api.pioupiou.fr/v1/live/{myWindbirdNumber}
        convert the payload from JSON to javascript object
        move the msg.payload to msg.windbird
        set {windy station id} to msg.payload.id
        set {windy station password} to msg.payload.PASSWORD
        copy msg.windbird.data.measurements.date to msg.payload.time
        copy msg.windbird.data.measurements.wind_heading to msg.payload.winddir as integer
        copy msg.windbird.data.measurements.wind_speed_avg to msg.payload.wind divided by 3.6
        copy msg.windbird.data.measurements.wind_speed_max to msg.payload.gust divided by 3.6
        pass all this to a http request linked to https://stations.windy.com/api/v2/observation/update with the option to attach payload to query.

        If you have a Windows computer, you can take and adapt the following powershell code, and call it every 5 or 10 minutes with the task-scheduler:

        # Pioupiou / Windbird Station ID
        $windbirdStationId = 1605
        
        # Windy StationId + Password
        $windyStationId = "abcdefgh"
        $windyPassword = "approx 40-60 symbols password"
        
        # Nothing to adapt below this line
        
        # URLs
        $srcUrl = "http://api.pioupiou.fr/v1/live/$windbirdStationId"
        $windyUrl = "https://stations.windy.com/api/v2/observation/update"
        
        # Retrieve data
        try {
            $data = Invoke-RestMethod -Uri $srcUrl -Method GET -ErrorAction Stop
        } catch {
            Write-Host "Error retrieving data: $_"
            exit 1
        }
        
        # Extract data
        $winddir = [int]$data.data.measurements.wind_heading
        $wind = [string]::Format([System.Globalization.CultureInfo]::InvariantCulture, "{0}", $data.data.measurements.wind_speed_avg)
        $gust = [string]::Format([System.Globalization.CultureInfo]::InvariantCulture, "{0}", $data.data.measurements.wind_speed_max)
        $ts = $data.data.measurements.date
        
        # Form new Query-Parameters
        $params = @{
            id      = $windyStationId
            time    = $ts
            winddir = $winddir
            wind    = $wind / 3.6
            gust    = $gust / 3.6
            PASSWORD= $windyPassword
        }
        
        # GET-Request to Windy
        try {
            $upload_result = Invoke-RestMethod -Uri $windyUrl -Method GET -Body $params -ErrorAction Stop
            Write-Host "Data succesfully sent to Windy."
        } catch {
            Write-Host "Error sending to Windy: $_"
            $params.GetEnumerator() | Format-Table -AutoSize
        }
        
        1 Reply Last reply Reply Quote 1
        • First post
          Last post
        Windy Community  |  Powered by excellent NodeBB
        Terms of Use     Privacy Policy     Windy.com