• 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

    How to set a value using http

    How-To
    3
    9
    2.0k
    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.
    • M
      MarcBudie
      last edited by

      Hi,

      Just started to use Mango. I have not been able yet to find an example or explanation on how to configure a datapoint so it can be set from the dashboard using a URL like e.g. http://localhost/settemp.php?value=HERE I WOULD EXPECT THE VALUE ENTERED ON THE DASHBOARD.
      Everything I tried end up in a casting error after pressing the save button.

      Thanks,

      Marc

      1 Reply Last reply Reply Quote 0
      • CraigWebC
        CraigWeb
        last edited by

        Hi @MarcBudie

        Welcome to the forum. You can activate swagger in your env.properties file. As in the forum: https://forum.infiniteautomation.com/topic/2380/mangoapi-is-there-any-documentation-on-how-to-use-this-module

        I dont believe that there is a way to set a point as you describe using a query string. You could use the HTTP receiver and run a script on it to set your point.
        Could you maybe give more information on why you would want to do this? So we can advise better

        M 1 Reply Last reply Reply Quote 0
        • M
          MarcBudie @CraigWeb
          last edited by

          @craigweb That is what I mean. So I would like to setup a datpoint which can also be set. But it is not clear to me what to configure where. set point URL and/or set point name.

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

            Hi MarcBudie,

            I just updated the thread Craig linked to so that it's swagger URL also includes detail that as of Core 3.5 swagger moved to /swagger-ui.html if enabled before starting Mango.

            I am going to assume that you are writing your own dashboard from scratch, since a few of the angular components are capable of setting values to the point. But, there is also the HTTP Receiver (and JSON receiver), which would be the simplest was to get values into a data point via HTTP POST or GET. And there are /rest/v1/point-values endpoints that support using PUT to set values to one or more points, which you could explore via swagger.

            M 1 Reply Last reply Reply Quote 0
            • M
              MarcBudie @phildunlap
              last edited by

              @phildunlap Hi, I would like to use the HTTP receiver. I already did that to collect datapoint. But it is not clear how to use that to set datapoints.

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

                You would use a Point Link, or you could use a script or meta point if you need to parse apart the value (they have the .set() function for context points, or in a meta point you could return the extracted value to store it in the meta point).

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

                  Also note that you may want to create IP whitelist entries on the data source if any important control is going through an HTTP Receiver, as that is not authenticated. You can also white list devices, and then include parameters for that device as specified in the contextual help for the HTTP receiver data sources.

                  M 1 Reply Last reply Reply Quote 0
                  • M
                    MarcBudie @phildunlap
                    last edited by

                    @phildunlap I now got it working using http retriever. Configured the url in the data source and just put a name in set point name field in the data point. However, doing the same using a json retriever I get a casting error. Something is different between these two?

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

                      Yeah, the JSON receiver has two receive types, one for legacy support and one for the more intuitive way it works. The legacy (Parameter receive type) use is presented here: https://forum.infiniteautomation.com/topic/2642/how-to-use-http-json-receiever-to-receive-the-data-with-is-by-json-format

                      For the more intuitive format, where the whole POST body is JSON for instance and the content type is application/json, then the "HTTP parameter name" field needs to be a JSON pointer. Someone linked in this thread to a tool to help craft JSON pointers: https://forum.infiniteautomation.com/topic/3029/json-retriever-documentation-missing/5

                      But in short it's like a path, like
                      / on an alphanumeric point should catch the whole JSON object.
                      /key should get whatever is at {"key":...}
                      /keyToArray/5 should get the fifth index of the array at {"keyToArray":[...]}

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