Skip to the content.
Weather Plug-in - Local Weather Data Files Local Weather Data Files

The plug-in can also read locally stored files that may have been produced by another program, as long as the data in the file follows the XML (NWS), METAR, or JSON (OpenWeather) formats.

XML/JSON/METAR Current Weather Formatted Files

Table 6 shows the mapping of current weather variables to XML tags or JSON object names.


Table 6 - Current Weather Tags
Control VariableNWS XML tagOpenWeather JSON objects
Stationstation_id-
LocationlocationGen: lat,lon
Latlatitudelat
Longlongitudelon
ObservationTimeobservation_timeGen.: current:dt
ObservationTimerfc822observation_time_rfc822Gen.: current:dt
Weatherweathercurrent:weather:description
WeatherId-current:weather:id
Temptemperature_stringGen: current:temp
TempFtemp_fcurrent:temp1
TempCtemp_ccurrent:temp1
Humidityrelative_humiditycurrent:humidity
Uvi-current:uvi
Clouds-current:clouds
Windwind_stringGen: current:wind_speed, wind_degrees, wind_gust
WindDirwind_dirGen: current:wind_degrees
WindDegreeswind_degreescurrent:wind_degrees
WindMPHwind_mphcurrent:wind_speed1
WindKTSwind_ktsGen: current:wind_speed
WindKPHGen: wind_mphcurrent:wind_speed1
WindBftGen: wind_mphGen: current:wind_speed
WindGustMPHwind_gust_mphcurrent:wind_gust1
WindGustKPHwind_gust_kphcurrent:wind_gust1
WindGustKTSwind_gust_ktsGen: current:wind_gust
Pressurepressure_stringGen: PressureMb
PressureInpressure_inGen: PressureMb
PressureMbGen: PressureIncurrent:pressure
PressureMmGen: PressureInGen: PressureMb
Dewpointdewpoint_stringGen: DewpointF, DewpointC
DewpointFdewpoint_fcurrent:dew_point1
DewpointCdewpoint_ccurrent:dew_point1
HeatIndexheat_index_stringGen: HeatIndexF, HeatIndexC
HeatIndexFheat_index_fGen: current:temp, humidity2
HeatIndexCheat_index_cGen: current:temp, humidity2
Windchillwindchill_stringGen: WindchillF, WindchillC
WindchillFwindchill_fGen: current:temp, wind_speed2
WindchillCwindchill_cGen: current:temp, wind_speed2
VisibilityMivisibility_miGen: current:visibility3
VisibilityKmvisibility_kmcurrent:visibility3
WeatherIconicon_url_namecurrent:weather:icon4
IconBaseicon_url_baseConfig: "OpenWeather Icons" link
Notes:
1 For OpenWeather, the plug-in's "Temp Scale" is used to have temperature and wind-related items reported in either Imperial/English units ("Temp Scale" = "F") or metric units ("Temp Scale" = "C"). The other related items will be generated from them accordingly.
2 Heat Index and Wind Chill items are generated from temp, humidity and temp, wind_speed, respectively.
3 VisibilityKm is in meters, max 10000. When converted to miles, max is 10.
4 WeatherIcon is set to "{current:weather:icon}.png".

NWS XML Format

NWS current weather tags should be enclosed with the following tags:

   <current_observation>
       current weather tags
   </current_observation>

Each current weather tag should be in the form:

   <tag>data</tag>

Example:

   <current_observation>
       <temp_f>46</temp_f>
       <temperature_string>46 F (8 C)</temperature_string>
   </current_observation>

Some weather data is available in both string and numeric formats, as in the examples above.

If used as a substitute for loading a local file into the HomeVision Controller Weather Variables, tags should be restricted to those found in Table 4 and must use the numeric format.

The suggested naming convention for NWS XML current weather files is {StationID}.xml, where StationID is the 4 or 5 character station ID. For XML files, this convention is optional.

NWS Forecast files are more complex. Examples can be found at the appropriate web site.

OpenWeather JSON Format

OpenWeather weather data follows the JSON format and should be in the "current" section or the "daily" section, as noted above. Example:

{
    "lat": 40.36,
    "lon": -74.13,
    "current": {
        "dt": 1632374554,
        "temp": 73.33,
        "feels_like": 74.55,
        "pressure": 1015,
        "humidity": 89,
        "dew_point": 69.89,
        "uvi": 0,
        "clouds": 1,
        "visibility": 10000,
        "wind_speed": 1.01,
        "wind_deg": 240,
        "wind_gust": 5.99,
        "weather": [
            {
                "id": 800,
                "main": "Clear",
                "description": "clear sky",
                "icon": "01n"
            }
        ]
    },
    "daily": [
        {
            "dt": 1632412800,
            "temp": {
                "day": 76.14,
                "min": 69.28,
                "max": 77.36,
                "night": 69.28,
                "eve": 73.58,
                "morn": 73.65
            },
            "feels_like": {
                "day": 77.25,
                "night": 70.27,
                "eve": 74.73,
                "morn": 74.52
            },
            "pressure": 1013,
            "humidity": 81,
            "dew_point": 69.91,
            "wind_speed": 21.14,
            "wind_deg": 153,
            "wind_gust": 33.46,
            "weather": [
                {
                    "id": 501,
                    "main": "Rain",
                    "description": "moderate rain",
                    "icon": "10d"
                }
            ],
            "clouds": 76,
            "pop": 1,
            "rain": 12.26,
            "uvi": 4.06
        },
       ...
    ]
}
METAR Formatted Files

Local METAR files should contain exactly ONE line of METAR formatted weather data. Details of METAR format can be found in Federal Meteorological Handbook No. 1 - Surface Weather Observations and Reports

The naming convention for METAR files is {StationID}.met, where StationID is the 4 character station ID that is also contained in the METAR data within the file. {StationID} is REQUIRED to match that in the file itself.

Configuring for Local Data

Next:
Speaking Weather Data
Triggering Weather Fetches
Weather Websockets
Custom Objects and Websockets
Weather Info for NetIO
Weather with MQTT
See Also:
Introduction to the Weather Plug-in
Web-Based Weather Data
Using Weather Control Variables
Forecast Examples
HomeVision Controller Weather Variables
Disclaimer