2021年10月19日 星期二

Node-Red OpenWeather

 


JSON

Example of API response
                          
{
  "coord": {
    "lon": -122.08,
    "lat": 37.39
  },
  "weather": [
    {
      "id": 800,
      "main": "Clear",
      "description": "clear sky",
      "icon": "01d"
    }
  ],
  "base": "stations",
  "main": {
    "temp": 282.55,
    "feels_like": 281.86,
    "temp_min": 280.37,
    "temp_max": 284.26,
    "pressure": 1023,
    "humidity": 100
  },
  "visibility": 16093,
  "wind": {
    "speed": 1.5,
    "deg": 350
  },
  "clouds": {
    "all": 1
  },
  "dt": 1560350645,
  "sys": {
    "type": 1,
    "id": 5122,
    "message": 0.0139,
    "country": "US",
    "sunrise": 1560343627,
    "sunset": 1560396563
  },
  "timezone": -25200,
  "id": 420006353,
  "name": "Mountain View",
  "cod": 200
  }                         
                        

Fields in API response

  • coord
    • coord.lon City geo location, longitude
    • coord.lat City geo location, latitude
  • weather (more info Weather condition codes)
    • weather.id Weather condition id
    • weather.main Group of weather parameters (Rain, Snow, Extreme etc.)
    • weather.description Weather condition within the group. You can get the output in your language. Learn more
    • weather.icon Weather icon id
  • base Internal parameter
  • main
    • main.temp Temperature. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.
    • main.feels_like Temperature. This temperature parameter accounts for the human perception of weather. Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.
    • main.pressure Atmospheric pressure (on the sea level, if there is no sea_level or grnd_level data), hPa
    • main.humidity Humidity, %
    • main.temp_min Minimum temperature at the moment. This is minimal currently observed temperature (within large megalopolises and urban areas). Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.
    • main.temp_max Maximum temperature at the moment. This is maximal currently observed temperature (within large megalopolises and urban areas). Unit Default: Kelvin, Metric: Celsius, Imperial: Fahrenheit.
    • main.sea_level Atmospheric pressure on the sea level, hPa
    • main.grnd_level Atmospheric pressure on the ground level, hPa
  • wind
    • wind.speed Wind speed. Unit Default: meter/sec, Metric: meter/sec, Imperial: miles/hour.
    • wind.deg Wind direction, degrees (meteorological)
    • wind.gust Wind gust. Unit Default: meter/sec, Metric: meter/sec, Imperial: miles/hour
  • clouds
    • clouds.all Cloudiness, %
  • rain
    • rain.1h Rain volume for the last 1 hour, mm
    • rain.3h Rain volume for the last 3 hours, mm
  • snow
    • snow.1h Snow volume for the last 1 hour, mm
    • snow.3h Snow volume for the last 3 hours, mm
  • dt Time of data calculation, unix, UTC
  • sys
    • sys.type Internal parameter
    • sys.id Internal parameter
    • sys.message Internal parameter
    • sys.country Country code (GB, JP etc.)
    • sys.sunrise Sunrise time, unix, UTC
    • sys.sunset Sunset time, unix, UTC
  • timezone Shift in seconds from UTC
  • id City ID
  • name City name
  • cod Internal parameter

XML

Example of API response
                          
  <current>
  <city id="0" name="Mountain View">
    <coord lon="-122.09" lat="37.39" />
    <country>US</country>
    <timezone>-28800</timezone>
    <sun rise="2020-01-07T15:22:59" set="2020-01-08T01:05:37" />
  </city>
  <temperature value="278.07" min="273.15" max="282.59" unit="kelvin" />
  <feels_like value="275.88" unit="kelvin" />
  <humidity value="86" unit="%" />
  <pressure value="1026" unit="hPa" />
  <wind>
    <speed value="0.93" unit="m/s" name="Calm" />
    <gusts />
    <direction value="23" code="NNE" name="North-northeast" />
  </wind>
  <clouds value="1" name="clear sky" />
  <visibility value="16093" />
  <precipitation mode="no" />
  <weather number="800" value="clear sky" icon="01n" />
  <lastupdate value="2020-01-07T11:33:40" />
  </current>
  
  
Parameters:
  • city
    • city.id City ID
    • city.name City name
    • city.coord
      • city.coord.lon City geo location, longitude
      • city.coord.lat City geo location, latitude
    • city.country Country code (GB, JP etc.)
    • timezoneShift in seconds from UTC
    • city.sun
      • city.sun.rise Sunrise time
      • city.sun.set Sunset time
  • temperature
    • temperature.value Temperature
    • temperature.min Minimum temperature at the moment of calculation. This is minimal currently observed temperature (within large megalopolises and urban areas), use this parameter optionally.
    • temperature.max Maximum temperature at the moment of calculation. This is maximal currently observed temperature (within large megalopolises and urban areas), use this parameter optionally.
    • temperature.unit Unit of measurements. Possilbe valure is Celsius, Kelvin, Fahrenheit.
  • feels_like
    • feels_like.value Temperature. This temperature parameter accounts for the human perception of weather.
    • feels_like.unit Unit of measurements. Possilbe valure is Celsius, Kelvin, Fahrenheit. Unit Default: Kelvin
  • humidity
    • humidity.value Humidity value
    • humidity.unit Humidity units, %
  • pressure
    • pressure.value Pressure value
    • pressure.unit Pressure units, hPa
  • wind
    • wind.speed
      • wind.speed.value Wind speed
      • wind.speed.unit Wind speed units, m/s
      • wind.speed.name Type of the wind
    • wind.direction
      • wind.direction.value Wind direction, degrees (meteorological)
      • wind.direction.code Code of the wind direction. Possilbe value is WSW, N, S etc.
      • wind.direction.name Full name of the wind direction.
  • clouds
    • clouds.value Cloudiness
    • clouds.name Name of the cloudiness
  • visibility
    • visibility.value Visibility, meter
  • precipitation
    • precipitation.value Precipitation, mm
    • precipitation.mode Possible values are 'no", name of weather phenomena as 'rain', 'snow'
  • weather
    • weather.number Weather condition id
    • weather.value Weather condition name
    • weather.icon Weather icon id
  • lastupdate
    • lastupdate.value Last time when data was updated

沒有留言:

張貼留言

2024_09 作業3 以Node-Red 為主

 2024_09 作業3  (以Node-Red 為主  Arduino 可能需要配合修改 ) Arduino 可能需要修改的部分 1)mqtt broker  2) 主題Topic (發行 接收) 3) WIFI ssid , password const char br...