• 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 values from python script?

    User help
    2
    21
    8.3k
    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.
    • H
      Holzatelier
      last edited by

      Phil, I simply searched the installation folder for "CSV" and found this example of a csv-file:
      ../web/modules/dataFile/web/CompilingGrounds/CSV/multiColumnCsv.csv
      I then adjusted my python script to output the csv file in the appropriate format.

      Now I wonder if there is a way to have mango start my python script automatically since I have not been able to get crontab to start it periodically for me....

      1 Reply Last reply Reply Quote 0
      • H
        Holzatelier
        last edited by

        Ok, after a few hours of poking around and following various suggestions I actually managed to fumble my way to a working solution and my python script actually runs through cron.
        So now I wonder if there is a way to change the time format in Mango to 24 hrs.
        Is there some setting to display 2:00:00 PM as 14:00:00 ?

        Thanks

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

          Now I wonder if there is a way to have mango start my python script automatically since I have not been able to get crontab to start it periodically for me....

          Certainly. I suspect you'll find the Process Event Handler, perhaps on something like the System startup event, can do this for you.

          So now I wonder if there is a way to change the time format in Mango to 24 hrs.
          Is there some setting to display 2:00:00 PM as 14:00:00 ?

          Yes, it's a simple change. Go to Mango/web/modules/dataFile/web/CompilingGrounds/CSV/ and edit MultiColumnCsvImporter.java . Change,

          private DateTimeFormatter dtf = DateTimeFormat.forPattern("MM/dd/yyyy hh:mm:ss");
          

          to

          private DateTimeFormatter dtf = DateTimeFormat.forPattern("MM/dd/yyyy HH:mm:ss");
          

          Then edit the data source edit page to recompile the importer class:

          0_1535642816422_compileTemplates.png

          And restart the data source.

          1 Reply Last reply Reply Quote 0
          • H
            Holzatelier
            last edited by

            Phil, I was thinking of changing the time format for all data points in Mango. So for example Modbus and Bacnet. Can I change the Time formatter for those modules as well?

            Thanks

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

              I'm not really sure what you mean. There isn't time formatting in Modbus, for instance. The timestamps for a poll on Modbus is the time that the poll occurred measured in elapsed milliseconds, this is then converted for display using the locale set on your user. If you change your user's locale, you should see the new UI use an appropriate time format. It is not currently possible to explicitly control the time format.

              1 Reply Last reply Reply Quote 0
              • H
                Holzatelier
                last edited by

                I meant the Times given in the UI. For example in the "data point details" page the windows "point history values", "point statistics" and "chart" all give the Time in 12 hrs AM/PM format. I tought maybe there is a setting to change that format to 24 hrs (military time format).
                But now I'm nit picking ...

                Thank again for the help.

                1 Reply Last reply Reply Quote 0
                • H
                  Holzatelier
                  last edited by

                  Just set my locale and bingo I'm a happy camper! There's just so much to explore!
                  Cool !! Thanks!

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

                    Sweet! Glad to hear it!

                    I'm not sure this would be easy to change on the data point details page or other pages we provided, but if you find yourself using <ma-point-value></ma-point-value> components in your custom dashboards and wanting to provide a time format, the API docs (enable in Administration --> Edit menu) suggest,

                    display-type
                    (optional)
                    string	
                    Changes how the data point value is rendered on the page. Options are:
                    
                    rendered (Displays live value in point's text rendered format) *Default
                    converted (Displays live value in point's unit converted format)
                    dateTime (Displays the time the of the point's last update)
                    
                    date-time-format
                    (optional)
                    string	
                    If dateTime is used with display-type then you can pass in a momentJs string to format the timestamp. (Defaults to Mango default date format set in system settings)
                    

                    where the data point details page is displaying time in that element with the settings,

                    display-type="dateTime" flash-on-change="true" same-day-date-time-format="timeSeconds"
                    

                    where timeSeconds is one of the shorthands for normal formats one may find around Mango, defined: https://github.com/infiniteautomation/ma-dashboards/blob/bf9f8ba49754a1a93d59d1f3bd562b69b8523680/UI/web-src/ngMango/ngMangoServices.js#L151

                    1 Reply Last reply Reply Quote 0
                    • H
                      Holzatelier
                      last edited by

                      I haven't yet started with the custom dashboards, so I will keep this in mind for future reference.
                      Another thing I having difficulty with is the spline setting for the charts.
                      I've set my data points "point properties/Plot type" to "Spline" but the chart in the "Data Point Page" is never a smooth spline. The Bar and Step entries in the dropdown menu in the Chart window work nicely, the Line and Smooth entries don't seem to change anything, there are always steps.
                      I'm obviously missing something here again but what?

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

                        I'm obviously missing something here again but what?

                        The plot type setting applies to the old UI pages, such as /data_point_details.shtm

                        On charts in the new UI, such as /ui/data-point-details/ , there is a selector in the top right portion of the chart to toggle between smooth, line, step, or bar styles.

                        1 Reply Last reply Reply Quote 0
                        • H
                          Holzatelier
                          last edited by

                          Phil, I' ll try to upload some screenshots. Whatever I choose in the selector in the top right portion of the chart the outcome seems the same to me. Except for "Bar", then the area below the graph is filled in solid:

                          3_1535714143001_Mango_chart_bar.png 2_1535714143001_Mango_chart_line.png 1_1535714143001_Mango_Chart_smooth.png 0_1535714143001_Mango_chart_step.png

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

                            Hmm. I was not able to replicate. Can you share the JSON for the point you're seeing that with? Are there any errors in the browser developer console?

                            1 Reply Last reply Reply Quote 0
                            • H
                              Holzatelier
                              last edited by Holzatelier

                              Hi, I've got myself a litte confused with this one. I only just realized how to zoom into the chart and it turns out that the steps I'm seeing are actually a result of the data aquisition. Although I poll the devices every minute the data sources do not seem to update the data that fast. So I might get back constant values for several minutes and then record a change from one poll to the next.
                              So then of course the spline is only 1 minute segment long and does not seem to be there at all when I'm looking at the whole chart.
                              Sorry about that, don't know where my brain was...

                              Nevertheless another question came up (of course). Please see next Post.

                              1 Reply Last reply Reply Quote 0
                              • H
                                Holzatelier
                                last edited by Holzatelier

                                I've been playing around with the dashboard designer and I can't delete any pages.
                                I'm admin and I think I've got all the permissions:
                                0_1535812809428_admin settings.png
                                Then I try to delete this page called "Testpage" by clicking on the trashcan symbol but nothing happens.

                                0_1535812754166_dasdesignerpermission.png

                                I try the same thing in "edit pages". The page is empty but I can't delete it.

                                0_1535812918446_editpagesdelete.png

                                But I noticed this error in the Browser console:

                                0_1535813209364_BrowserConsole error.png

                                So I checked Mango on my Windows installation and the exact same thing happens there.
                                This is the java version I'm running:
                                0_1535813691032_java version.png

                                I hate to pepper you with questions, but I'm still hoping I just overlooked something really obvious.

                                Thanks for your patience.

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

                                  Hi Holzatelier,

                                  You should see a confirm dialogue. What browser are you using? I was not able to reproduce in Chrome on the latest.

                                  I hate to pepper you with questions, but I'm still hoping I just overlooked something really obvious.

                                  No worries. But, this particular thread has strayed quite far from its topic. Don't hesitate to make more topics, it is ultimately a better question-answer or discussion style than threads twisting to new topics.

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