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 FilesTable 6 shows the mapping of current weather variables to XML tags or JSON object names.
Control Variable | NWS XML tag | OpenWeather JSON objects |
---|---|---|
Station | station_id | - |
Location | location | Gen: lat,lon |
Lat | latitude | lat |
Long | longitude | lon |
ObservationTime | observation_time | Gen.: current:dt |
ObservationTimerfc822 | observation_time_rfc822 | Gen.: current:dt |
Weather | weather | current:weather:description |
WeatherId | - | current:weather:id |
Temp | temperature_string | Gen: current:temp |
TempF | temp_f | current:temp1 |
TempC | temp_c | current:temp1 |
Humidity | relative_humidity | current:humidity |
Uvi | - | current:uvi |
Clouds | - | current:clouds |
Wind | wind_string | Gen: current:wind_speed, wind_degrees, wind_gust |
WindDir | wind_dir | Gen: current:wind_degrees |
WindDegrees | wind_degrees | current:wind_degrees |
WindMPH | wind_mph | current:wind_speed1 |
WindKTS | wind_kts | Gen: current:wind_speed |
WindKPH | Gen: wind_mph | current:wind_speed1 |
WindBft | Gen: wind_mph | Gen: current:wind_speed |
WindGustMPH | wind_gust_mph | current:wind_gust1 |
WindGustKPH | wind_gust_kph | current:wind_gust1 |
WindGustKTS | wind_gust_kts | Gen: current:wind_gust |
Pressure | pressure_string | Gen: PressureMb |
PressureIn | pressure_in | Gen: PressureMb |
PressureMb | Gen: PressureIn | current:pressure |
PressureMm | Gen: PressureIn | Gen: PressureMb |
Dewpoint | dewpoint_string | Gen: DewpointF, DewpointC |
DewpointF | dewpoint_f | current:dew_point1 |
DewpointC | dewpoint_c | current:dew_point1 |
HeatIndex | heat_index_string | Gen: HeatIndexF, HeatIndexC |
HeatIndexF | heat_index_f | Gen: current:temp, humidity2 |
HeatIndexC | heat_index_c | Gen: current:temp, humidity2 |
Windchill | windchill_string | Gen: WindchillF, WindchillC |
WindchillF | windchill_f | Gen: current:temp, wind_speed2 |
WindchillC | windchill_c | Gen: current:temp, wind_speed2 |
VisibilityMi | visibility_mi | Gen: current:visibility3 |
VisibilityKm | visibility_km | current:visibility3 |
WeatherIcon | icon_url_name | current:weather:icon4 |
IconBase | icon_url_base | Config: "OpenWeather Icons" link |
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 FormatOpenWeather 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- Open the Configuration dialog: Plugins->Weather.
- Select the General Settings tab and make sure Enable Fetch is checked and a Read Interval is set as appropriate.
- Select the Data Source tab
- Select File as the Source.
- Click on Edit Web and File Links
- Enter (or browse for) the desired Current and/or Forecast files.
-
No Station ID is needed in the Stations Configuration dialog, as it should be contained in the file/filename.
(Note: In fact, the Stations tab is disabled in this mode.)
.
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