--
--
You received this message because you are subscribed to the "energyos_espi" group.
To post to this group, send email to energy...@googlegroups.com
To unsubscribe from this group, send email to: energyos_esp...@googlegroups.com
http://www.energyos.org/espi/
---
You received this message because you are subscribed to the Google Groups "energyos_espi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to energyos_esp...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Ufuk,
The data format is described by a schema. The standard schema is available from http://www.naesb.org/ESPI_Standards.asp. It has some errors and there have been extensions based on lessons learned. There is a new proposed schema which I will provide a draft of if you ask me individually.
Please look at https://collaborate.nist.gov/twiki-sggrid/bin/view/SmartGrid/GreenButtonSDK which describes the tools for parsing and generating green button data files.
The example you saw on http://www.greenbuttondata.org/greendevelop.aspx was done using an xslt which is available – see the SDK user’s guide.
HTH,
Marty
Dr. Martin J. Burns, Hypertek Inc. for NIST
Technical Champion, Green Button
email: ma...@hypertek.us
Hi Marty,
Please can you provide me with an answer for this question?
If the value output to the XML has been multiplied by 1000 should the PowerOfTen be 3 to indicate that we multiplied by 1000 or should it be -3 to indicate that the value should be divided by 1000 to return to the original value?
Thank you,
Salma
--
K that doesn’t really match up with what the Green button XSLT is doing. If for example we have a kWh value of 1.34235 we will multiply it by 1000 to convert it to Wh and get 1342.35 we then multiply it by another 1000 to get rid of decimals and get 1342350. We then specify a multiplier of 3 in the XML file.
When we then apply the XSLT to the generated XML it is displaying 1,342,350 kWh.
If we change the multiplier to -3, then applying the XSLT correctly converts the value to 1.34235 kWh.
Looking into the code of the XSLT we’ve found that when the kind is specified as electricity it will automatically multiply the value by 0.001 to convert to kWh it then looks at the multiplier and for a multiplier of 3 multiplies the value by another 1000 which results in going back to the original 1342350 that was specified in the XML. Is there something wrong with the XSLT or are we doing something wrong?
Thank you
Salma
From: energy...@googlegroups.com [mailto:energy...@googlegroups.com]
On Behalf Of Marty Burns
Sent: March-19-13 8:30 PM
To: energy...@googlegroups.com
Cc: energyos_espi
Subject: Re: [ESPI] Parsing Green Button Data
Right you are on both counts, John!
Salma,
The Green Button data describes the measurement. So there is a number x 10^ powerOfTen. It is up to the xslt to present this to the consumer in a helpful way. There is no inherent notion of kWh in the data file. The UOM is Wh. If you want to get rid of decimals to provide more precision, you have to subtract from the exponent for every shift to the left of a decimal place.
So if we have a measurement that represents 1.34235 kWh, and if we don’t want to lose precision because “value” is an integer, and the units of measure (uom) for this measurement is Wh, then:
1.34235 kWh = 1342.35 Wh = 1342350 x 10^-3 Wh.
So this says that the powerOfTen multiplier should be -3. This is consistent with your analysis I think.
Note that in the sample xslt, there is a variable called gl_PresentationMultiplierElectricy:
<xsl:variable name="gl_PresentationMultiplierElectricy" select="3"/>
The purpose of this constant is that we expect that we want to present to the viewer units of kWh. So the xslt takes the measurement as represented by the value and the powerOfTen multiplier and and scales it so that it is in kWh (this involves subtracting exponents).
Did I answer your question or did I miss something?
Cheers,
Marty
Dr. Martin J. Burns, Hypertek Inc. for NIST
Technical Champion, Green Button
email: ma...@hypertek.us
FYI…
Sorry sent it by mistake.
Thanks a lot Marty for your response.
Actually, you answered my question perfectly.
Cheers,
Ufuk,
A Green Button data set can have any number of resources: UsagePoints, MeterReadings …. The order of entrys in the Atom feed is not fixed. The linking is the key to understanding what is associated with what. See https://collaborate.nist.gov/twiki-sggrid/bin/view/SmartGrid/GreenButtonSDK#Linking_of_Entries for description. The sample xslt presented in the SDK illustrates how to navigate the links to determine the associated resources.
As you can see from the xslt, the links are navigated through XPath statements. The tricky point is that for those resources that have a multiplicity of 0..* the links point to a “collection”. Thus you need to determine who points to the common collection which is not itself explicitly present in the feed.
HTH,
Marty
Dr. Martin J. Burns, Hypertek Inc. for NIST
Technical Champion, Green Button
email: ma...@hypertek.us
From: energy...@googlegroups.com [mailto:energy...@googlegroups.com] On Behalf Of Ufuk Yilmaz
Sent: Sunday, March 31, 2013 7:51 AM
To: energy...@googlegroups.com
Subject: Re: [ESPI] Parsing Green Button Data
Hi all again, I have a little question,
--
Yes, but note you will want to use a document object model in java for parsing the XML which will support XPath. Then it will be essentially the same XPath strings as in XSLT.
HTH,
Marty
This is actually similar to what the xslt does. You'll have to learn some sort of XML parsing language, but in my opinion this will be easier and more future-proof than parsing your HTML, where you'll likely end up having to learn something very similar. I used a built-in library in C# (.NET) which does much of the heavy lifting with XPath, but look around and I'm sure you can find something in Java (or whatever language you're using.) You seem to want to avoid to compute the time adjustments and admittedly these are non-trivial, but since you'll be using some form of XPath library, just re-use what's already in the existing xslt.
Regards,
Kevin