• 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

    Mqtt datasource command

    How-To
    2
    4
    977
    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
      Mark
      last edited by

      Hi,

      I want to send the command below with mqtt with a binary switch. I only get the command correctly executed when I create the item as alphanumeric and manually enter the status. Does anyone know how I send the command off / on through a binary switch with mqtt?

      shellies/<model>-<deviceid>/relay/0/command accepts on, off or toggle and applies accordingly

      Mango mqtt.jpg
      Mango mqtt 1.jpg

      Can anyone help me?

      1 Reply Last reply Reply Quote 0
      • MattFoxM
        MattFox
        last edited by

        set the value with a meta datasource script or scripting datasource point based upon the true or false value of your binary switch point.
        Set the binary switch as your context point that fires the script and sets the value of your MQTT point.

        Fox

        Do not follow where the path may lead; go instead where there is no path.
        And leave a trail - Muriel Strode

        M 1 Reply Last reply Reply Quote 0
        • M
          Mark @MattFox
          last edited by

          @mattfox

          Do you have a example of this script?

          1 Reply Last reply Reply Quote 0
          • MattFoxM
            MattFox
            last edited by

            1)make a virtual datasource binary datapoint, add it to the script context points. Tick the checkbox that this point triggers the script.

            we shall call the context point switch.
            Then add your mqtt point to the context. We shall call it toggle. It does not need the checkbox to the right filled. Ensure the mqtt point is settable
            This is the script.

            if(switch.value===true)
            {
             toggle.set("on");
            }
            if(switch.value===false)
            {
             toggle.set("off");
            }
            
            

            See how you go. I do not use the mqtt client myself, but generally all points can be set - some which send the value back out the data source. I am hoping this is the latter...

            Hope this helps

            Fox

            Do not follow where the path may lead; go instead where there is no path.
            And leave a trail - Muriel Strode

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