Você está na página 1de 45

How can I …

Import Weather Feed Data into Power


Monitoring Expert

System Technical Note


Power Monitoring Expert 8.0 - 9.0

V3.0
Legal Information
The Schneider Electric brand and any registered trademarks of Schneider Electric
Industries SAS referred to in this guide are the sole property of Schneider Electric SA and
its subsidiaries. They may not be used for any purpose without the owner's permission,
given in writing. This guide and its content are protected, within the meaning of the
French intellectual property code (Code de la propriété intellectuelle français, referred to
hereafter as "the Code"), under the laws of copyright covering texts, drawings and
models, as well as by trademark law. You agree not to reproduce, other than for your
own personal, noncommercial use as defined in the Code, all or part of this guide on any
medium whatsoever without Schneider Electric’s permission, given in writing. You also
agree not to establish any hypertext links to this guide or its content. Schneider Electric
does not grant any right or license for the personal and noncommercial use of the guide
or its content, except for a non-exclusive license to consult it on an "as is" basis, at your
own risk. All other rights are reserved.

Electrical equipment should be installed, operated, serviced and maintained only by


qualified personnel. No responsibility is assumed by Schneider Electric for any
consequences arising out of the use of this material.

As standards, specifications and designs change from time to time, please ask for
confirmation of the information given in this publication.
Safety information

Important information
Read these instructions carefully and look at the equipment to become
familiar with the device before trying to install, operate, service or maintain
it. The following special messages may appear throughout this manual or
on the equipment to warn of potential hazards or to call attention to
information that clarifies or simplifies a procedure.

The addition of either symbol to a “Danger” or “Warning” safety label indicates


that an electrical hazard exists which will result in personal injury if the
instructions are not followed.

This is the safety alert symbol. It is used to alert you to potential personal injury
hazards. Obey all safety messages that follow this symbol to avoid possible
injury or death.

DANGER
DANGER indicates a hazardous situation which, if not avoided, will result
in death or serious injury.

WARNING
WARNING indicates a hazardous situation which, if not avoided, could
result in death or serious injury.

CAUTION
CAUTION indicates a hazardous situation which, if not avoided, could
result in minor or moderate injury.

NOTICE
NOTICE is used to address practices not related to physical injury.

Please note
Electrical equipment should be installed, operated, serviced and maintained only
by qualified personnel. No responsibility is assumed by Schneider Electric for any
consequences arising out of the use of this material.

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 1 of 45
A qualified person is one who has skills and knowledge related to the
construction, installation, and operation of electrical equipment and has received
safety training to recognize and avoid the hazards involved.

Safety precautions
During installation or use of this software, pay attention to all safety messages
that occur in the software and that are included in the documentation. The
following safety messages apply to this software in its entirety.

WARNING
INACCURATE DATA RESULTS
• Do not incorrectly configure the software, as this can lead to
inaccurate reports and/or data results.
• Do not base your maintenance or service actions solely on
messages and information displayed by the software.
• Do not rely solely on software messages and reports to determine if
the system is functioning correctly or meeting all applicable
standards and requirements.
• Consider the implications of unanticipated transmission delays or
failures of communications links.
Failure to follow these instructions can result in death, serious
injury, equipment damage, or permanent loss of data.

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 2 of 45
Table of Contents
Legal Information i
Safety information 1

Safety precautions 2

1. Introduction 5
1.1. Purpose 5
1.2. Customer Challenges 5
1.3. Prerequisites 5
1.4. About this document 6
1.5. Glossary (terms you should be familiar with) 7

2. Selection 8

3. Design 10
3.1. XML Feeds 11
3.2. Web Access 11
3.3. The VIP 11

4. Configuration and Implementation 13


4.1. Step 1 - Subscribe to a Weather Feed to retrieve data. 13
4.2. Step 2 - Analyze the Weather Feed Response to create ‘Paths’ 16
4.3. Step 3 - Configure the VIP 18
4.4. Step 4 – Log the Temperature Data 21
4.5. Step 5 – Set up a Dashboard to View the Temperature Data 26
4.6. Step 6 – Make a Simple Temperature Report 30
4.7. Additional configuration 31

5. Operation and Maintenance 33

6. Validation 35
6.1. Validation Process 35
6.2. Results of the Validation 35

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 3 of 45
7. Conclusion 39

8. Appendix 40

9. Supplemental Information and Reference 41

10. Alternative Method - Weather Data Import 42


10.1. PME 8.x, PME 9.0 – PME Weather Tool 42

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 4 of 45
1. Introduction

1.1. Purpose
This document is a guide to the capabilities of the Power Monitoring Expert software to integrate
a third-party internet feed of weather data, and store this data in your database for future
analysis.

As a System Technical Note (STN), this document is not intended to recommend a specific
architecture, but to validate the capability to perform a function on a referenced system.

1.2. Customer Challenges


This document is designed to answer the following challenges:

• Our end-customers do not possess the ability to assess the impacts of weather on their
business.

• Schneider services and System Integrators are required to meet this need, and don’t know
how.

• Schneider services and System Integrators have no idea how much time it takes to meet the
need and cannot correctly quote it, resulting in loss of margin and end-customer frustration
with deployment delays.

1.3. Prerequisites

1.3.1. System Prerequisites

To complete the steps in this document, you will need

• Power Monitoring Expert version 9.0

• The VIP service (e.g. ensure it is running)

• Access to the internet (through port 80) from the primary server

• A web browser

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 5 of 45
1.3.2. Reference Material

There are no required documents needed to complete the procedures in this document,
however, please see the Supplemental Information and Reference Section for links to the
following resources that will assist you with the completion of procedures explained in this
document.

• Power Monitoring Expert User documentation for the Designer and Vista components.

• The ION Reference Manual.

• Optional – reference material for the API you plan to use (see below).

1.3.3. Competencies

This document is targeted at System Integrators, Application Engineers, and services personnel
who possess:

• A basic knowledge of internet feeds, and XML.

• Intermediate knowledge of Vista, Designer, and the VIP.

1.4. About this document


This document is structured as follows:

The Introduction gives an overview of the reason for the document and the prerequisites
necessary to follow the procedures within.

The Selection section explains when you would choose this as a solution for a customer need.

The Design section explains the architecture and data flow of system and procedure.

The Configuration and Implementation section describes how to set up the procedure, which
consists of:

• Subscribing to a web service API to get your temperature data.

• Understanding the XML response from the internet service.

• Configuring the VIP.

• Testing the system.

• Displaying this weather data in reports and dashboards.

The Operation and Maintenance section describes how to insure the solution continues to
function as desired.

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 6 of 45
The Validation section describes known issues and includes comments from the reviewers who
validated this procedure.

The Conclusion attempts to summarize the key aspects you should follow to achieve the
solution. Read this section if you want to quickly assess your capability to understand and follow
the procedures in the document.

The Appendix provides reference materials and additional instructions for advanced
configurations.

The final section provides an alternate approach for loading weather data into PME using a
custom weather data import tool.

1.5. Glossary (terms you should be familiar with)


Please see the Appendix for a list of terms you should be familiar with before reading this
document.

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 7 of 45
2. Selection
In order to assess whether the procedure outlined in this document is the one you want to use,
consider the following. There are several methods for importing and reporting on data in Power
Monitoring Expert. The customer requirements related to data might be summarized as:

1. The capture and reporting of data native to the Power Monitoring System

2. The capture and reporting of real-time data external to the Power Monitoring System

3. The capture and reporting of timestamped (logged) data external to the Power Monitoring
System.

The solution described in this document is best applied to scenario #2, defined more specifically
as when:

• The customer wants to report or view data which is not natively captured by the SPM system.

• The customer wishes to permanently store and report on the data;

• The data is not accessible in a stored format, and must be imported immediately when
posted.

• The data is available in an XML feed.

The alternate approach in the final section is more in line with Scenario #3. Outside of this
document and it’s linked references, if you would like more information about how to accomplish
scenario #3, please refer to the System Technical Note titled “How can I Import and Use KPI Data
in my Power Monitoring Expert System?”

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 8 of 45
Figure 1: Dashboard example of Weather Data Import

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 9 of 45
3. Design
The diagram here represents the critical components necessary for the realization of this solution.
Key to the implementation are:

1. A structured XML feed with reliable uptime.

2. Access to that feed, typically through http.

3. A VIP configured to consume and process the data.

4. Dashboards and/or Reports configured to display the data.

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 10 of 45
3.1. XML Feeds
An XML Feed provides data in a structured format that does not change over time. In evaluating
possible feeds, you must ensure that you are working with a feed and not trying to scrape html.
More information about XML Feeds and scraping can be found at
http://en.wikipedia.org/wiki/Web_feed.

There are several web feeds available on the internet to supply weather data. It is important to
research the available feeds, test out samples provided, and make sure you have reviewed the
terms of service if you plan an application for commercial use.

This document provides sample steps for implementing the Weather Underground API to
retrieve weather data. The Weather Underground API is used because it provides free feeds for
Developer use and supports 500 API calls per day. We need 96 calls to log in standard 15
minute intervals during a 24 hour period, so the 500 calls more than meet our need. Visit the
Weather Underground site for more information at: http://wunderground.com.

When you sign up for this service, an API key is supplied that must be inserted into the URL. This
will be discussed in the Configuration section.

3.2. Web Access


As it is possible to install Power Monitoring Expert in environments without access to the web,
you must ensure the server on which the VIP is hosted has access to the web.

3.2.1. Constraints due to Web Access

As this design relies on web access to import the weather data, the customer needs to be made
aware that, in the event that the connection to the weather feed fails (through a network failure or
other event), gaps will appear in the logged data. It may be possible to fill the missing values via
a service engagement, but the Operation and Maintenance section should be reviewed before
guaranteeing this to the customer. It is recommended that the constraint be made clear to the
customer and action be taken to ensure the customer does not expect the missing data to be
recovered.

3.3. The VIP


The VIP is important to this design because the XML Import Module provides an out-of-the-box
means of consuming the Weather Feed data. As stated in the pre-requisites, you should be
familiar with the function of the VIP before proceeding with the Configuration of this solution.

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 11 of 45
In this design, we are constrained by one aspect of the VIP functionality; The XML Import module
can only read numeric values from your feed, not names or dates.

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 12 of 45
4. Configuration and Implementation
This section describes the steps necessary to import and utilize a Weather feed. From several
validations it is confirmed that these steps will take about an hour to implement. The summarized
steps are:

1. Subscribing to a Weather Feed

2. Analyzing the Weather feed response to Create Paths

3. Configuring the VIP

4. Logging the temperature data

5. Configuring 15 minute interval recording

6. Configuring a Dashboard which uses the temperature data.

7. Configuring a Report which uses the temperature data.

4.1. Step 1 - Subscribe to a Weather Feed to retrieve data.


As stated in the Design section, there are several web services available on the internet to supply
weather data. It is important to research the available feeds, test out samples provided, and make
sure you have reviewed the terms of service if you plan an application for commercial use. The
instructions that follow document the use of the Weather Underground site.

4.1.1. Sign up for an API key with Weather Underground

Navigate to the Weather Underground site (http://wunderground.com), and then:

1. Scroll down to the bottom of the page to find and click the Weather API for Developers links.

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 13 of 45
2. Find and Click the “Sign In to Get Started” button. After you sign up you will be required to
validate your email address, and can proceed to the next step.

3. You now need to “Purchase” a $0 (zero-dollar) Developer API Key (called a Stratus Plan at
the time this document was written).

a. Click the Pricing link and the Stratus Plan should be selected by default.

b. Click the Purchase Key button.

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 14 of 45
4. When you submit the request, you will be required to fill out another form. Fill this form out
and then hit the Purchase Key button.

5. At this point your key will appear. Your Key ID is used in URLs later on, so copy it to a
location where you can quickly reference it.

As an additional resource, the Weather Underground site provides Developers with


API documentation that is available if you wish to experiment with JSON in PHP or
Javascript. The link is http://www.wunderground.com/weather/api/d/docs.

4.1.2. Verify the Feed in your Browser

Once you have chosen a feed, and have an API Key, you should verify the results of the XML API
call in your browser as follows:

1. Enter the following string into the address bar in your browser:

http://api.wunderground.com/api/<<KEY_ID>>/conditions/q/CA/San_Francisco.xml

a. Note you will need to substitute your KEY ID into the string for this to function.

b. You can also use a different city if you want by substituting CA/San_Francisco with your
USState/City (/WA/Seattle), or country/city (France/Paris).

2. Upon hitting enter to submit the URL, you should see an XML output similar to the following.
The first image shows the first tags in the response.

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 15 of 45
The second image shows some of the data tags that are returned.

3. If you don't see results similar to the images above, double-check the URL you have entered.
One common mistake is to use spaces ' ' vs. underscores '_' between words.

Note that there’s a limit to the number of API calls you can make with your API Key
on any day. While testing, make sure to monitor your traffic, or you run the risk of a
Feed provider denying service. Weather Underground will track the API calls your
key makes every day; this data is available in the Analytics section of your Weather
Underground user profile. Other Weather Feed suppliers provide similar analytics.

4.2. Step 2 - Analyze the Weather Feed Response to create ‘Paths’


The next step is to locate the data you are interested in from the structured response that
appears in the browser. If you use the URL above, you will see the current conditions in San
Francisco. For this example, we are interested in only the temperature values in both degrees
Fahrenheit and Celsius.

To interpret what you will need to enter in the VIP later on you need to interpret the response
above, and determine the path and tags of the temperature values.

Many internet feeds do not have ‘user friendly’ labels in their documentation. The Weather
Underground format uses <temp_f> and <temp_c> as tags for the Fahrenheit and Celsius
Temperatures.

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 16 of 45
<temp_f>62.1</temp_f>
<temp_c>16.7</temp_c>
XML is structured with a tree of values, much like the file system on a computer. Within the parent
tag of <response> are a few layers of nested tags and values. Most modern browsers and XML
viewers will allow you to expand and collapse the parent tags to make it easier to analyze the
structure. When we collapse all the parent values we can, while keeping the temperature values
visible, the structured path to the temperature values is as follows:
<response>
<current_observation>
<temp_f>
<temp_c>

4.2.1. To translate XML to Paths

In order to create a path that defines these for the XML Import module, simply replace the '<'
characters with '/' characters, and remove all of the '>' characters. The following examples will
help:

XML tag tree Path

<yard>

<house> /yard/house/kitchen/light

<kitchen>

<light>

<response>

<current_observation> /response/current_observation/temp_f

<temp_f>

After analyzing the XML from the Weather Underground feed, the tag tree is as follows:
<response>
<current_observationb>
<temp_f>
<temp_c>
The Paths are therefore:

Path 1 (for Fahrenheit)


/response/current_observation/temp_f

Path 2 (for Celsius)


/response/current_observation/temp_c

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 17 of 45
4.3. Step 3 - Configure the VIP
To set up the VIP, you will need to

1. Create and configure an XML import module.

2. Create a temporary External Pulse module and Vista diagram for testing.

3. Create a Periodic Timer to control how frequently the weather data is fetched (i.e. what our
measurement intervals are).

4.3.1. Set up the XML Import Module

1. Run ION Designer, and from the Open command in the File menu open the
VIP.<computer_name> node.

2. From the Options menu, click Show Toolbox if it is not already visible.

3. From the Toolbox, create a new XML Import module

4. Right Click the new module to access the setup registers, and configure the following:

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 18 of 45
a. Modify the XIM1 URL Setup Register by double-clicking it, or selecting it and clicking the
Modify button. Enter the complete URL you used when you tested the XML feed in your
browser above.
http://api.wunderground.com/api/<<KEY_ID>>/conditions/q/CA/
San_Francisco.xml

b. Modify the xPath Query 1 Setup Register to match your Path 1 (degrees F) we
discovered earlier:

/response/current_observation/temp_f

c. Modify the xPath Query 2 (degrees C)

/response/current_observation/temp_c
5. Click OK to exit the Module Setup window.

4.3.2. Set up a test to verify that the XML import is working

Before proceeding further it is important to verify that the data is available to the system. This is
done by setting up and triggering a data retrieval and displaying the result in Vista.

Set up a test framework in your VIP

Continue working in the same node in Designer, and do the following:

1. From the Toolbox, create a new temporary External Pulse module.

2. Link the External Pulse Module’s Trigger output to the XML Import module’s Read Now input.

3. Send and Save the framework.

Set up the Vista Test

1. Open Vista and create a new diagram,

2. Make the Toolbox and create a new Control object.

3. Right-click the object, and configure it as follows:

a. Select the Link tab, then the Custom radio button, and click Edit.

b. Select the VIP from the Nodes listed, and double-click to open the Managers list.

c. Select and double-click the Ext Pulse Modules, and then do the same with Ext Pulse 1
when it is displayed.

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 19 of 45
d. Finally, select the Trigger output register of the External Pulse module created above,
and hit OK to exit the Create Link window. Click OK again to get back to your main
Vista window.

4. Next, create two new Numeric objects.

5. Right Click the first numeric object, and do the following:

a. Select the Link tab, and then click Custom and Edit Link.

b. From the VIP Node double-click and select XML Import Modules and then XML Import 1
(assuming this is the first such module you have configured) and then the XIM Data 1
Output Register, which is the Fahrenheit value. Click OK to exit the tab, then OK again.

c. For now, you are leaving the Label as the default; you will change this label later on
when you set up logging.

6. Right click the second numeric object and follow the same steps but this time select the XIM
Data 2 Output Register, for Celsius.

7. Save the Vista diagram.

Trigger the XML fetch, and display the values in Vista

1. Activate the Control Object (double-click it), and both values will appear in the numeric
object.

2. Refresh the XML page in your web browser, and compare the temperature values displayed
there with the ones displayed in Vista. Be sure and do it quickly as the values refresh often.

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 20 of 45
3. If the values are not the same, insure you have the same location specified in the URL Setup
Register in Designer as the location specified in the URL.

4. If no values appear, check that you have accurately followed the steps above. If you have
and there are still no values appearing, the issue may be that the VIP is not authorized to
access the feed. See the Validation section and the appendix for a possible cause and
workaround.

4.4. Step 4 – Log the Temperature Data


Now that you have imported the real time values from your weather feed, you can log these
values with data recorders, and utilize them in reports, or dashboards.

4.4.1. Adjust your Label names

In Power Monitoring Expert, there are standard quantities for temperatures in Fahrenheit and
Celsius. You will need to adjust the labels of the XML Import module’s outputs to match these
standard quantity names. These will then be logged in the ION Data database.

1. In Designer, open your VIP, and enable the Toolbox.

2. Right click the XML Import module to display the ION Module Setup dialog box. Find the
Data 1 Output Register in the list of Output Registers and double click on it to call up the
Modify Label dialog box.

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 21 of 45
3. In the Modify Label dialog box, select Use Custom Label and then change the label name to:
Weather Station Temperature (Fahrenheit).

4. Similarly, change the custom label for the Celsius Data 2 Output Register to: Weather Station
Temperature (Celsius).

Note! It is very important to use the above label names exactly. Do not use any
extra spaces at the end of the word, or change the case. This is the label that the
database will recognize as a standard temperature measurement. Copy and paste it
from above if required.

5. Save and send the framework.

6. Note that the label changes made in Designer may not appear immediately in Vista – you
can force them to appear by restarting Vista.

4.4.2. Create and Configure the Data Recorder

Create and Link a new Data Recorder module.

1. From the Toolbox, create a Data Recorder.

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 22 of 45
2. Right-click the Data Recorder, and set the Depth Setup Register to 100.

3. From your XML Import module, link the “Weather Station Temperature (Fahrenheit)” output
to a New Source input on your Data Recorder module.

4. From your XML Import module, link the “Weather Station Temperature (Celsius)” output to a
New Source input on your Data Recorder module.

5. From your XML Import module, link the “Load Complete” output to the “Record” input of the
Data Recorder module.

6. Send and Save your framework.

Test the Data Recorder

1. Close the VIP node in Designer.

a. NOTE: Closing the VIP is necessary to unlock the VIP node and allow the ION Log
Inserter service unhindered access so that it can find the newly established data
recording framework.

2. Open Vista and then open the diagram you created above.

3. Add a new Data Log Viewer object and then right-click it. Click the Query Tab, and click Edit
Query to enter the Query Wizard.

a. If the Edit Query is not available (greyed-out), you will need to set up the Query Server:

i. Click the Query Server tab, then select the Custom Query Server option and click
Edit Link.

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 23 of 45
ii. In the Create Link window, double-click your server node, then Query Modules,
Query 1 and QM Query Register.

iii. Finally click OK and you should be able to use the Edit Query button.

4. Select VIP.<COMPUTERNAME>, and click Add, and then click Next.

5. Select the Data Recorder you created, and click Add, and then click Next.

6. Under the Available columns, select the two Weather Station Temperature values, and click
‘Add’, and then click Finish. Click OK to exit the Data Log Viewer Configuration.

7. Double Click the control object created earlier to trigger a read of the weather feed. After
your values update on the Numeric Objects, double-click the new Data Log Viewer to see the
data.

8. If you wish you can quickly check the values against the Weather Underground web page.

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 24 of 45
Configure 15 minute Temperature Intervals

Once you have confirmed that the weather feed data can be accessed and stored, you need to
set up a periodic timer so that the data is recorder in regular 15 minute intervals.

To add and configure a Periodic Timer to Pulse your XML Import:

1. In Designer, Open the VIP diagram.

2. Create a new Periodic Timer module.

3. Link the Periodic Timer’s Trigger output to the Read Now input of the XML Import module.

4. Right Click the Periodic Timer module, and ensure the Period setup register is set to 900
(seconds). This will pulse every 15 minutes.

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 25 of 45
Note! If you want to have more timely updates, read the Terms of Service of the
provider you selected to ensure your license allows for more frequent API calls. Our
WeatherUnderground sample API calls are limited to only 500 per day, so one API
call every 15 minutes is well under the acceptable limit of transactions.

5. Send and Save your framework.

6. To verify that you are now logging the data in 15 minute intervals, you can either wait 15
minutes and check the Data Log Viewer in your Vista diagram, or proceed to the Dashboard
step below and verify values through the gadget you set up.

4.5. Step 5 – Set up a Dashboard to View the Temperature Data


To view the temperature as a trend in the Dashboard, you’ll need to add a new dashboard, and
set up a gadget to display the temperature quanitities. In this example, we will simply trend the
temperature values by interval.

1. Open the Power Monitoring Expert Web Applications module, and login with Supervisor
credentials.

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 26 of 45
2. In the main toolbar, click Dashboards.

3. From the Dashboard Library, create a New Dashboard with the name “Weather Trend”.

4. The following options can be changed at any time, but for simplicity enter them in the
Properties window as per the suggestions below:

a. Name: Weather Trend

b. Layout: 1 Gadget (be sure and click on the picture of the layout; if you don’t it will retain
the 6-gadget layout).

5. Click “Add Gadget”, select a “Trend Chart” type, and click Next.

6. Give the Gadget a title that reflects what it will represent. For example, the name of the city
you have chosen and the type of data - “San Francisco Weather”

7. Under the Data Series Tab:

a. Click the “Add” button.

b. In the Sources area of the Line Chart properties window you should see the VIP node
listed. Expand it and select the VIP you had open in Designer.

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 27 of 45
c. In the Measurements area of the Line Chart properties window, select show advanced to
see more options. Change the value in the Type dropdown to “Environment” and the
Show dropdown to “All”. This will reduce the number of results to choose from. You can
also select the checkbox called “Display only Measurements with historical data” to
further reduce the results.

d. You should see the two “Weather Temperature” measurements appear.

e. Select the measurement you want to see and add a series display name (e.g. Weather
Temperature in Celsius). Click OK.

You must add the display name because the base measurement name is the same for
both points - “Weather Temperature”, which is not allowed in a single gadget. The
display name ensures a unique entry.

8. Under the Viewing Period tab, choose “Last 12 Hours”, and select an Aggregation of “None”.

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 28 of 45
9. If it has been at least 15 minutes since you set up the periodic timer, your new gadget will
render with the temperature values gathered from the Weather Underground API.

10. If you do not see any available temperatures in the Data Series tab, double-check the
following:

a. Make sure the output labels of the XML Import module are specified exactly as “Weather
Station Temperature (Fahrenheit)” and “Weather Station Temperature (Celsius)”. If the
values are named differently, the software will not recognize them as standard
temperature measurements.

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 29 of 45
b. Test the Data Recorder with at least one manual pulse. This will ensure your database is
populated with at least one value with the correct label.

4.6. Step 6 – Make a Simple Temperature Report


To report on the stored temperature values in the database, we can create a simple Tabular
Report.

1. In the main toolbar, select Reports.

2. From the Report Library in the sidebar, select the General folder and then Tabular Report

3. In the Tabular Report Settings,

a. From the Sources selector, select the VIP you have configured

b. From the Measurements selector, select the Weather Temperature (°C) measurement.

i. Note that if this is the first time using Web Reporter for the web client you are using,
you may be prompted to accept a pop-up. If you don't notice or accept the pop-up
notification, the measurement selector will spin indefinitely.

c. For the Reporting Period, select "Today".

4. Click Generate Report and the tabular report will be generated with the temperature values
that have been logged since you enabled the Periodic Timer.

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 30 of 45
4.7. Additional configuration
You have now imported data from an internet feed into Power Monitoring Expert. You can now
use this temperature data to display in dashboards, or compare with energy consumption. The
following are possible areas to extend or modify the use of XML feeds, and the XML Import
module. These items have not been verified or validated, but are included to increase the
understanding of what is possible with the XML Import function.

• You can extend the VIP framework to do calculations for degree days, and make customer
recommendations.

• It’s possible to import XML files to your computer’s hard drive by using the path and file name
in the ‘URL’ setup register. Note that the XML Import module has problems with spaces in
the URL, so you will need to use 8.3 format to ensure the file can be reached, for example:
C:\PROGRA~1\SCHNEI~1\TEST.XML. This is a possible workaround if Power Monitoring
Expert does not have access to the web, but another program approved by the customer's IT
department does.

• To improve the overall fit and finish of the VIP, rename the VIP.<ComputerName> to a
customer friendly name.

• Try out advanced xPath queries and other Weather Feed providers. Another example to test
with is as follows:
URL: http://www.ims.gov.il/ims/PublicXML/isr_cities.xml

xPath Query:
/IsraelCitiesWeatherForecastEvening/Location[LocationMetaDa
ta[LocationNameEng='Jerusalem']]/LocationData/TimeUnitData[
1]/Element[ElementName='Maximum temperature']/ElementValue

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 31 of 45
• Advanced users can create more complex xPath queries (as above). There are several good
sources for xPath tutorials on the internet, and xPath test tools to give you feedback on your
query syntax before you enter them into the VIP. Be aware that the XML Import module is
case-sensitive when referring to elements by name. And, it can only read numeric values, not
names or dates.
xPath Tutorials:
http://www.w3schools.com/xpath/xpath_examples.asp
http://msdn.microsoft.com/en-us/library/ms256086.aspx
xPath Test Tools
http://www.xpathtester.com/
http://www.xmlme.com/XpathTool.aspx

• Once you have the XML Import working, you can link the temperature parameter to a
Distributed Numeric module, and connect to a register value on a metering network. The VIP
can push the temperature value to the meter if you want. Note the Distributed Numeric
module needs an 'activate' Boolean, so use an isolated Convert module to provide 'true' all
the time, and the values will be pushed to the meter when they change in the VIP.

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 32 of 45
5. Operation and Maintenance
The components that the XML Weather Feed import depends upon are for the most part native to
the Power Monitoring Expert system, and as such the Operation and Maintenance does not
require anything beyond normal system procedures. However, there are a couple areas that
should be noted for the long-term import of the data.

1. Disconnection from the XML feed

Gaps in the Weather Data will appear if the connection to the feed is lost during a scheduled
pulse. The longer the period is lost, the more data points will be missing. In the event this
happens:

a. Ensure the connection is reestablished, if it has not already been.

b. If it is important to the customer to have the data points filled, you will need to determine
if the feed provider can supply historical records. For example, Weather Underground
can supply hourly historical data, but the data is not provided chronologically, nor is it
recorded on the top of the hour. In addition to determining the values, you will have to
manually enter them into Power Monitoring Expert, the scope of which is beyond this
document.

Because issues related to connecting to the weather feed are typically unrelated to the
Power Monitoring Expert system, and are outside of the control of the system, it is
recommended the commercial agreement not include the recovery of weather data.

2. Modification to the Weather Feed API

Organizations that provide APIs are expected to maintain the API against changes that
would affect their customers; however it is possible a change to an API could occur. If the
connection seems to be working but data logging has failed, check the connection string in
the browser to determine:

a. Results are being returned, and

b. The results are in the same format they were in previously.

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 33 of 45
© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 34 of 45
6. Validation
This section details the Validation of this procedure, and the results of the Validation.

6.1. Validation Process


The Validation of the Weather Feed import was executed as follows:

1. The initial procedure was taken from an existing Knowledge Base article. The procedure
was modified to be more descriptive and include the Weather Underground example.

2. The modified procedure was initially reviewed by a member of Global Technical Support for
the Power Monitoring Expert product. Comments and edits were suggested.

3. The comments and edits were incorporated into the format of this document. In the course
of creating the document the TVD Lead worked through the procedure to further validate it.

4. When this document was complete, it was given to a different member of the Global
Technical Support team for a Final Validation.

5. Final edits and comments were integrated and the document was approved by the TVD Lead
and Quality Directors.

6.2. Results of the Validation

6.2.1. Time to complete the procedure

On average it took reviewers about 1 hour to complete the procedure.

6.2.2. Issues

RSS feed access issue

One reviewer experienced a known issue in which the VIP is unable to read an RSS feed. The
issue is documented in the KB article referenced below. The workaround is to run a service that
downloads the XML file to a local drive, where the VIP is able to load the file. The reviewer was
also unable to get the service in the workaround to work, however she was able to manually save
an xml file and get the VIP to read it.

Link: http://download.powerlogic.schneider-
electric.com/C125752300294538/All/EA2CB9FA25B13DA5C12579040028444E?Opendocument

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 35 of 45
A similar issue was experienced in the field, but was worked around by running the VIP under the
account of the logged-in user. Details can be found in the Solutions Expert Community at
https://powersolutionscommunity.schneider-electric.com/message/2784#2784, or by searching
for the title XML Import Module Hanging up the VIP Service. The image below shows the result
of editing the account the VIP service runs under.

The other reviewers did not experience this issue.

Measurement Labels

Measurement labels do not appear in the Data Log Viewer in Vista, and labels are displayed in an
inconsistent manner in the setup windows in Web Reporter and Dashboards. While the final
result displays the units in a usable manner, the issue with the inconsistency has been presented
to the development team for investigation.

Interval synchronization

As per the first comment below, it may be necessary to add the use of a One-Shot Timer module
to produce an interval which can be used for creating KPIs (values which are presenting an x/y
result), as the intervals in the weather feed data are not consistent with the common 15 minute
intervals used by Power Monitoring Expert.

6.2.3. Comments from Reviewers

• The basic framework or application logic suggested in this document may result in the
recording of temperatures that are not recently updated. This can be due to latency issues
with communications over the internet and/or computer cycles in parsing the XML file. As
such, the temperature values may ‘lag’ the interval data collected from devices in the system.
If this is important to have the temperature values recorded at exactly the same time, the
framework will need to be reworked.

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 36 of 45
One way to do this would be to introduce a One-Shot Timer module that adds a delay of 14
minutes and 45 seconds from the last periodic timer signal. This would provid a pulse output
that regularly occurs 15 seconds in advance of the signal to record the temperature data.

• The XML Import can only output numbers, not names nor dates.

• The XML Import read failure messages aren't very descriptive - you get the same error for a
file not found that you get for bad path syntax in a found file.

• For the reviewer in China, it took about 25 minutes to purchase the API Key.

• To see the status of the latest read attempt in Designer, look at the output register values
(shift+click on the output triangle) then scroll to the bottom of the list to find the "Load
Complete" and "XIM Event" fields. Load Complete is a counter of the successful loads.

• The observations from the Weather Feed service change frequently and you need to refresh
the page very close to the time you bring up the value in Vista.

• Without reading time, I'd say the procedure from start to finish took approximately one hour.
If an engineer was seeing this for the first time and had to read along with the document for
each and every step, I'd say 1.5-2 hours total (as long as they didn't run into any
complications).

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 37 of 45
• In section 4.1.1, it is not as simple (anymore, at least) to "purchase" a license from Weather
Underground. I had to sign up on the website and then figure out how to upgrade my
membership to a developer. There is a link on the bottom-most banner of the page for
"Weather API for Developers". After that, I was able to "purchase" the free membership
upgrade that the TVD document describes and receive my license key.

• Author's comment: After this and another similar comment from another reviewer, the
procedure was modified, with images added to simplify the sign-up process.

• In section 4.4.2, under the title "Test the Data Recorder", I was surprised to find that my
logged values were not the same as the outputs from the XML Import module. Instead, my
values of "Weather Station Temperature (Fahrenheit)" and "Weather Station Temperature
(Celsius)" ended up both translating to the ambiguous name "Weather Temperature". In
Vista (specifically the Data Log Viewer), there is no way to discriminate between the two
measurement names, though the real time data does have the names I expect (because they
are linked directly to the output of the XML Import module).

Additionally, Web Reports suffers from the same weather duplication (section 4.6). Instead of
just running the report for one of the measurements, I wanted to run it for both Fahrenheit
and Celsius. The measurement selector had the same ambiguous name for "Weather
Temperature", but it had the metadata tags for deg F and deg C. Once the report was run,
however, it grouped all of the data under just deg C. Attached to this email is my report for
reference. Web Reports cannot discriminate between which measurement is which (because
of the naming structure?) and groups them together.

• Author’s comment: After this comment the procedure was reviewed with particular focus
on the units, with the following conclusions:

• Vista’s data log viewer does not show the units.

• The author could not reproduce the grouping, nor did the other reviewers mention it.
When working in Designer, please be sure and select New Source for each
measurement you want to log.

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 38 of 45
7. Conclusion
This document provides a field-tested method for importing Weather Feed Data into Power
Monitoring Expert. This data is then available for use in Dashboards and Reports. Key points to
keep in mind regarding the solution are:

• If not using Weather Underground, verify the commercial conditions of the Feed you choose
to insure you can make the required number of calls per day.

• Insure that the customer is aware that, if the connection to the Feed is lost due to
circumstances outside of the control of the system, the Weather data will have unrecoverable
gaps. Conversely, if gaps must be filled, insure you understand how to recover the data, as
doing so is outside the scope of this document and will likely take time to configure each time
it happens.

• Test the implementation with a Power Monitoring Expert instance in your facility before
implementing it on the customer site, to make sure there are no issues with regional or
localized settings.

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 39 of 45
8. Appendix
Term Description

Application Programming Interface – typically a description of


API the way to structure calls to an application in order to obtain
data.

PME Power Monitoring Expert

Device A meter or a point of data collection

Measurement The quantity being measured

Source Same as Device

Quantity Same as Measurement

Source-Measurement Pair
Source-Quantity Pair
SM Pair or SQ Pair
An entity representing a data series by source and
measurement.

Extensible Markup Language (XML) is a markup language that


XML defines a set of rules for encoding documents in a format that is
both human-readable and machine-readable

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 40 of 45
9. Supplemental Information and Reference
Resource Description Link or Location

More information on the XML file format and


http://www.w3schools.com/xml/
terminology

Search for the title of the document on the Solutions


Comments and community feedback related to
Expert Community:
this document
https://powersolutionscommunity.schneider-
electric.com/welcome

KB link (accessible if you are viewing this document


The ION Reference Manual electronically. If reading this document in hardcopy, a
search on the KB portal, or even Google, will find the
document.

© 2018 Schneider Electric. All rights reserved. Controlled Copy. Do Not Distribute Page 41 of 45
10. Alternative Method - Weather Data Import
There is alternative method for importing weather data into PME that involves using a custom tool
called “PME Weather Tool“. This tool provides a single user interface that connects to Weather
Underground web content and retrieves historical data. It has the following functions:
- Uses the same API key as described in the previous sections of this document
- Locate weather stations of interest by keyword search or by map
- Download historical weather data for selected weather stations
- View and analyze weather data prior to insertion into PME
- Alter weather data prior to insertion into PME (clean the entries – snap to timestamp, roll
up to 15 minute or hourly timebase)
- Create new sources in PME for weather data
- Import weather data to specified PME source

Note: This tool is not officially supported, and there are no plans to further develop it at this time.

10.1. PME 8.x, PME 9.0 – PME Weather Tool


You can find an entry in the Exchange Community for the PME Weather Tool here:

https://exchangecommunity.schneider-electric.com/message/80564

Note that the contents of the Exchange post are somewhat dated compared to the actual “PME
Weather Tool” due to the lack of official support, but the instructions provided are generally
accurate. Embedded in the above Exchange post are a PowerPoint file and a video that give
good instructions on how to use the tool (both files are located on Box, and are linked from within
the Exchange post).
StruxureWare™ Power Monitoring Expert™ is a trademark of Schneider Electric. Other trademarks used herein
are the property of their respective owners.

Schneider Electric Industries SAS Due to evolution of standards and equipment,


Head Office characteristics indicated in texts and images in this
document are binding only after confirmation by our
35, rue Joseph Monier
departments.
92506 Rueil-Malmaison Cedex
FRANCE
Print:

www.schneider-electric.com

Você também pode gostar