Weather example: Create and populate PI points with weather data
- Last UpdatedOct 02, 2024
- 1 minute read
You can create both historical PI points such as "Current Temperature" and future PI points such as "Predicted Temperature" or "Predicted Precipitation". To generate values to populate PI points, you can use data generated by using standard methods that are used in your organization and that apply to your application.
For the weather example, you can use any web service to generate historical and predicted weather data. For example, the service on developer.worldweatheronline.com can generate predicted weather data in CSV (Comma Separated Values), JSON and other formats. We detail instructions on using this service, but you may use any other service instead.
-
Navigate to World Weather Online Developer Portal.
-
Select the Free Weather API service.
-
Select "Get local weather". Enter the zip code of the location you wish to monitor, and select a CSV file as output. You can select other options such as number of forecast days, time intervals of forecasts and so on.
-
Load the CSV file into Excel.
-
Select the columns that are of interest to you, and using PI DataLink, create a table of predicted PI point attribute values and time stamps. You may also have PI point attributes for historical data such as "Current Temperature", which you can later compare with "Predicted Temperature" data.
-
Configure your Data Archive with your weather PI points and values.
Note: To extend this model to many thousands of locations, use PI Builder to configure your PI points.