Skip to the content.
Weather Plug-in - NetIO Interface Weather Info for NetIO

The Weather plug-in supplies built-in "custom" procedures (netio, netioaction and get_update) to support NetIO.

Triggering a Weather Fetch via NetIO

A weather fetch can be triggered in the NetIO application by the netioaction command:

    netioaction wx|fc|wxfc|fcwx update
wx fetches new current weather only, fc fetches new forecast weather only, wxfc or fcwx fetches both (the order is not significant). When this command is executed, the NetIO Server plug-in calls the netioaction procedure which the Weather plug-in recognizes. The requested weather data is fetched immediately.

Note 1: When wx or fc is used, older data for the opposite type may exist.
Note 2: The command does not reset the current Read Interval.

This is the preferred way to explicitly update weather data.

Example:

Fetch the latest current and forecast data.

sends: netioaction wxfc update

The Weather plug-in can also fetch weather data by providing a weather specifier as one of the "objects" in the events command:

    events wx|fc|wxfc|fcwx
Other object types (standard or custom) can be combined with weather objects. When this command is executed, the NetIO Server plug-in calls the get_update procedure which the Weather plug-in recognizes. Otherwise, this command works identically to the netioaction command above.

Getting Weather Items via NetIO

The Weather plug-in provides a netio procedure to return weather information in response to NetIO get commands.

Possible weather items for NetIO use are the same as those for the Control and Web plug-ins. However, there is no need to configure which items are available - all are.
The get command for weather has the following format:
get wx|fc weather_item ?best? ?;?get? wx|fc weather_item ?best? ...?
Where:
wx|fc
Choose wx or fc. Either will work for both current or forecast weather items, although for clarity you may want to use wx for current weather items and fc for forecast items.
weather_item
Can be any item in Table 2, or Table 3, but is case-insensitive.
best
Optional. If present, must be best. Only valid for FcDay, FcSc, FcLc, FcPop, FcImg items. Ignored otherwise. Both "day" and "night" forecasts are available for any specific day. However, sometimes only one of the "day" and "night" sets of information for the first or last day are provided. For example, a weather fetch in the evening will usually have only the "night" forecast for that day. For these situations, best chooses the best information (either the day or the night data) for a specified day.
The get command may consist of several separate commands. Multiple commands are separated with semi-colons. The keyword get is only needed once but could be present for each command. Each command can be a different object type.

Examples:
Get current temperature in Celsius (TempC).
    reads:          get wx tempc 
    parseResponse:  \d+
    formatResponse: {0}°

    Result:         21° 
Get forecast location (Fcloc).
    reads:          get fc fcloc

    Result:         New York, NY, US
Get forecast night day name for day 2 (Fcdayn2).
    reads:          get fc fcdayn2

    Result:         Thu Night
Get forecast High and Low temps for day 3 (FcHi3, FcLo3).
    reads:          get fc FcHi3; fc fclo3
    parseResponse:  [^|]+
    formatResponse: High/Low: {0}/{1}

    Result:         High/Low: 43/21
Get either the day (preferred) or night short forecast for day one, depending on which is available:
    reads:          get fc fcday1 best; fc fcsc1 best
    parseResponse:  [^|]+
    formatResponse: {0}: {1}

    Result:         Wed Night: Mostly Cloudy
A Note about weather icons: Getting a weather icon (img) returns an image name, complete with its extension (i.e., cond001.png), not the image itself. For the image to be displayed, you must manually download image files from the appropriate weather web site and pre-load them into the NetIO application's data space. Since there are dozens of possible weather icons, getting icons may not be worth the effort.

Next:
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
Local Weather Data Files
Speaking Weather Data
Triggering Weather Fetches
Weather Websockets
Custom Objects and Websockets
Disclaimer