Import EnergyData from XML
-
Refresh that page, you should get some status information
-
@phildunlap said in Import EnergyData from XML:
Refresh that page, you should get some status information
That's all I get... :-(
-
@mircsicz said in Import EnergyData from XML:
Loading file ka-db failed: 1 counts of IllegalAnnotationExceptions
Oh, yeah, didn't look closely. You have the same error: Loading file ka-db failed: 1 counts of IllegalAnnotationExceptions
Did you see my note about adding member variables? Are you using the class I provided? I did test it using the XML you provided....
-
Yes I saw your note and all I added to the other two *.java files was the import part's you mentioned...
And yes copy/pasted the provided class ;-)
-
You can supply XML if you think something went awry with your sample data, but the snippet you posted I have imported successfully again just now, using a copy-paste of the class I supplied as RMCU.java and the TP.java / VALUES.java files that were generated (but I removed
package generated
from them, you didn't need to modify TP and VALUES any other way). The illegal annotation suggests to me something in that process didn't go right. -
Argghhh, I've removed the additional "import" line's from TP and VALUES.java but I still get no positive feedback:
{"resourceId":"DF_a963f6b1-51fe-445e-9d3e-d255342e2f58","progress":0,"finished":true,"cancelled":false,"errors":["Loading file ka-db failed: 1 counts of IllegalAnnotationExceptions"],"unfoundIdentifiers":[],"createdPoints":[],"failedPoints":[],"totalImported":0,"priority":2,"queueSize":0,"taskId":"TR_DF_a963f6b1-51fe-445e-9d3e-d255342e2f58","threadName":"Temporary Resource Timeout for : DF_a963f6b1-51fe-445e-9d3e-d255342e2f58","expires":1520371072215}```
-
THX to phil's support it's now importing and creating data point's
But it's so far not the correct data point seperation!
It needs to be seperated by TPID's
EDIT: Sorry was in a rush as my son woke up while I was typing...
The structur of the XML is as follow's:
RMCU TP ID=NAME-OF-METERING-POINT VALUES DATETIME EE (Electric Energy) TMP (Temperatur) PO (Power) HQ (Heat Quantity) VALUES TP ID NAME-OF-DATALOGGER ID SERIAL SERIAL-OF-DATALOGGER SERIAL IP IP-OF-DATALOGGER IP RMCU
Each TP-ID's VALUE tagged combined with DATETIME needs to become it's own Data Point
-
Glad you got it working. You probably want to get those TPIDs into the identifier for the NumericImportPoint (the first argument in creating these objects).
-
Hi Philip,
yeap that's exactly what I want! But I can't realize the change, I guess I've to change "This EE point xid" in
if(value.getEE() != null) result.add(new NumericImportPoint("This EE point xid", value.getEE().doubleValue(), sdf.parse(value.getDATETIME()).getTime(), extraParams));
But as I don't have any java experience I simply don't know how, So if you could phrase it for me once I'ld hopefully be done and gone... ;-)
EDIT: I just saw that the Data Point is literally named: "This EE point xid" so if you'ld be so kind to tell me how to parse the string behind the "tp" var into that place that would probably be it. It expect the DataPoint name to be something like:
- GHV1 3P6 5OG_EE
- Case-Temp_TMP
- or in other cases:
- GHV1 3P6 5OG_PO
- etc
-
Correct part of the code. I'm guessing you want the ID from the TP element and the EE/TMP nature of the value. Something like,
if(value.getEE() != null) result.add(new NumericImportPoint(tp.getID() + " EE value", value.getEE().doubleValue(), sdf.parse(value.getDATETIME()).getTime(), extraParams)); if(value.getTMP() != null) result.add(new NumericImportPoint(tp.getID() + " TMP value", value.getTMP().doubleValue(), sdf.parse(value.getDATETIME()).getTime(), extraParams));
-
Seeing you comment on the schema two posts ago, you also will need to add conditions for
if(value.getPO() != null)
and probably HQ as well. -
Yeap Phil, I'm aware of that. But with a working basic example like this one I can abstract the rest...
THX a ton Philip I reran the import on al 50k XML files and I now have the expected data point's.... I'll now start to adopt for other value type's!!!