• 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

    Turning devices on and off?

    How-To
    3
    9
    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.
    • J
      JNIEMI
      last edited by

      Hi all,

      Were a long time user of CATNET and are switching over to Mango and its going relatively smooth. But I was wondering how to make a settable point that acts like an on-off switch for a device.

      I would also like to make an interface screen where I can see my system and have the switches as little buttons on the screen. See the picture for what Im looking to make. In this particular setup, you can turn on the fan by clicking on it. I want to do something similar with Mango.

      Any help?

      Thanks,

      Jonathan

      Attachment: download link

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

        Hi Jonathan,

        Here is a service side script that should allow you to do what you want:

        var s = "";
        if (!value)
            s += "<img style='cursor:pointer;' src='graphics/Drinks/drink_empty.png' onclick='mango.view.setPoint("+ point.id +", \""+ pointComponent.id +"\", \"true\");return true;'/>";
        else if (value)
            s += "<img style='cursor:pointer;' src='graphics/Drinks/drink.png' onclick='mango.view.setPoint("+ point.id +", \""+ pointComponent.id +"\", \"false\");return false;'/>";
        return s;
        

        Add a server side script your graphic view using a biniary point that you want to turn on and off. Create two images that you want to use and install them in the graphics folder. Then modify the image URL in the script to point to your images "graphics/Drinks/drink_empty.png"

        Hopefully this is what you are asking about.

        Joel.

        1 Reply Last reply Reply Quote 0
        • V
          Victorino
          last edited by

          Joel,

          Could you elaborate a little, I'm trying to do a multistate button (on, off, disabled, etc. ) but this is the first step for me.

          The state of a device is received by mango using http receiver, but I can't figure out how to send user requests (button that was pressed) from mango to a server or a device.

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

            The problem here is that http receiver data points are not settable so you can't do this directly. One method that might work for you is to create a virtual point that you display on your dashboard with the button, then use a http publisher to push the data where you need it to go.

            Hope that helps,
            Joel.

            1 Reply Last reply Reply Quote 0
            • V
              Victorino
              last edited by

              Joel,

              On the example above, where can I find the point.id and pointComponent.id on a particular point?

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

                Sorry, I have no idea and not really sure what you mean. What do you need to know this?
                Joel.

                1 Reply Last reply Reply Quote 0
                • V
                  Victorino
                  last edited by

                  I assumed the point.id and the pointComponent.id has to be changed to their actual value.

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

                    No, not at all. This is script is to be used in a server side script on a graphic view. In the script you select the Datapoint you want to use from the drop down list.

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