• 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

    Importing lots of data points

    User help
    5
    9
    3.4k
    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.
    • R
      Rodrigo
      last edited by

      Hi guys,

      In the past I've seen a video (or couple of them) around here explaining how to import lots of data points using an excel + word combination.
      I wanted to try that but I can't seem to find those videos anywhere anymore.

      Can someone give me a hand please?
      Regards
      Rodrigo

      1 Reply Last reply Reply Quote 0
      • JoelHaggarJ
        JoelHaggar
        last edited by

        I think this is the video you are thinking of but it is quite dated: http://infiniteautomation.com/forum/topic/1150/importing-large-numbers-of-data-points-from-an-excel-spreadsheet

        I suggest you look at this for a better method: https://help.infiniteautomation.com/support/solutions/articles/14000022512-using-data-point-templates

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

          I've also offered a few python scripts from time to time that can do this effectively. They're all based on having the base JSON for something and some kind of input (like a CSV or formula) to populate the JSON.

          import json
          from StringIO import StringIO
          
          baseItem = """{"xid":"DP_12345", "name":"%(name)s", "someKey":"%(someValue)s"}"""
          
          csvFile = open("/path/to/csv")
          output = {"items":[]}
          for line in csvFile :
            data = line.replace("\r", "").replace("\n", "").split(",")
            output["items"].append( json.load( StringIO( baseItem % {"name": data[1], "someValue": data[2]} ) ) )
          
          csvFile.close()
          
          outputFile = open("/path/to/output.json", "w+")
          outputFile.write(json.dumps(output, sort_keys=False, indent=4, separators=(",",": ")))
          outputFile.close()
          
          1 Reply Last reply Reply Quote 0
          • R
            Rodrigo
            last edited by Rodrigo

            I answer more than a month late, but thanks (better late, than never).

            I'll check on your sugestions now.

            Regards
            Rodrigo

            1 Reply Last reply Reply Quote 0
            • R
              Rodrigo
              last edited by

              Hi Joel,
              In the video you recommended, you say that in a future video you are going to explain how to use CSV files to import lots of data points, you haven't made that video yet, right?
              In this video you explain how to use the property template, I found this tool to be extremely useful, but my lack of imagination :) doesn't let me understand how to use that to import lots of data points, are you trying to tell me that I should create the points one by one, and use the property template to assign the same properties to all of them?

              Hi Phil
              I thank you for your attempt to help me, but I know nothing about coding, so for me, what you wrote may well be chinese :$
              I really appreciate your message though.

              Regards,
              Rodrigo

              1 Reply Last reply Reply Quote 0
              • JoelHaggarJ
                JoelHaggar
                last edited by

                Looks like you are correct. I'll try to do a video on that soon. Basically, you can export a data source as csv using the csv icon on the data source page next to each data source. You can then modify the file and import the csv again on the Configuration Import Export page but be sure to change the drop down from json to csv when importing.

                When importing csv you have to specify the xid of each data point and you also need to assign a template to each data point in the csv.

                Hope that helps.

                R 1 Reply Last reply Reply Quote 0
                • R
                  Rodrigo @JoelHaggar
                  last edited by

                  @JoelHaggar

                  Thanks Joel, I'll try that, now I'm trying to use the json import export.
                  I have 70 fan coils on a building an each fan coil controller has 10 points or so, I created all the points for one controller, exported this in json format and now I'm modifying that file and adding the points of the rest, let's see how it goes.

                  Regards,
                  Rodrigo

                  1 Reply Last reply Reply Quote 0
                  • Jim BetsingerJ
                    Jim Betsinger @JoelHaggar
                    last edited by

                    @joelhaggar - This link no longer works.

                    Jared WiltshireJ 1 Reply Last reply Reply Quote 0
                    • Jared WiltshireJ
                      Jared Wiltshire @Jim Betsinger
                      last edited by

                      @jim-betsinger

                      https://forum.mango-os.com/topic/1150/importing-large-numbers-of-data-points-from-an-excel-spreadsheet

                      https://docs-v3.mango-os.com/using-data-point-templates

                      Developer at Radix IoT

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