• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    Import EnergyData from XML

    Development general discussion
    2
    19
    4.7k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • phildunlapP
      phildunlap
      last edited by

      @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....

      1 Reply Last reply Reply Quote 0
      • mircsiczM
        mircsicz
        last edited by mircsicz

        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 ;-)

        1 Reply Last reply Reply Quote 0
        • phildunlapP
          phildunlap
          last edited by

          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.

          1 Reply Last reply Reply Quote 0
          • mircsiczM
            mircsicz
            last edited by

            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}```
            1 Reply Last reply Reply Quote 0
            • mircsiczM
              mircsicz
              last edited by mircsicz

              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

              1 Reply Last reply Reply Quote 0
              • phildunlapP
                phildunlap
                last edited by

                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).

                1 Reply Last reply Reply Quote 0
                • mircsiczM
                  mircsicz
                  last edited by mircsicz

                  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
                  1 Reply Last reply Reply Quote 0
                  • phildunlapP
                    phildunlap
                    last edited by phildunlap

                    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));
                    
                    1 Reply Last reply Reply Quote 0
                    • phildunlapP
                      phildunlap
                      last edited by

                      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.

                      1 Reply Last reply Reply Quote 0
                      • mircsiczM
                        mircsicz
                        last edited by mircsicz

                        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!!!

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post