Windy Community
    • Unread
    • Categories
    • Groups
    • Go to windy.com
    • Register
    • Login
    1. Home
    2. SnowSky
    S
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 1
    • Groups 0

    SnowSky

    @SnowSky

    1
    Reputation
    1
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    SnowSky Unfollow Follow

    Best posts made by SnowSky

    • RE: windbird

      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
      }
      
      posted in Windy Stations
      S
      SnowSky

    Latest posts made by SnowSky

    • RE: windbird

      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
      }
      
      posted in Windy Stations
      S
      SnowSky