• 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

    Device Name Filter with Exact Name

    User help
    2
    7
    1.9k
    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
      morris
      last edited by

      Hi, I was trying to filter with query="{devicename:'PM1'}" and in the result point list I also get points from the devicename 'PM10'. How do I make the query for the exact device name?

      Re: Multiple queries/array in ma-point-list

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

        Hi morris,

        Try query="'deviceName=PM1'" or query="'eq(deviceName,PM1)'"

        1 Reply Last reply Reply Quote 1
        • M
          morris
          last edited by

          @phildunlap said in Device Name Filter with Exact Name:

          eq(deviceName,PM1)

          Hi phildunlap, thanks for the response. I was using <ma-device-name-list> to filter a device name. My code is here

          <div layout="row">    
              <md-input-container>
              <label>Device</label>
              <ma-device-name-list ng-model="selectedDevice" contains="'PM'" ng-init="selectedDevice='PM1'"></ma-device-name-list>
              </md-input-container>
          </div>
          <ma-point-query query="{deviceName:selectedDevice}" sort="'name'" points="points"></ma-point-query>
          <ma-get-point-value points="points"></ma-get-point-value>
          <ma-calc input="points | filter:{name:'ActiveEnergy '} | maFirst" output="energy"></ma-calc>
          <ma-calc input="points | filter:{name:'AverageCurrent'} | maFirst" output="current"></ma-calc>
          <ma-calc input="points | filter:{name:'AverageVoltage'} | maFirst" output="voltage"></ma-calc>
          <ma-calc input="points | filter:{name:'ActivePower'} | maFirst" output="power"></ma-calc>
          <ma-calc input="points | filter:{name:'PF'} | maFirst" output="powerFactor"></ma-calc>
          <ma-calc input="points | filter:{name:'ApparentPower'} | maFirst" output="demand"></ma-calc>
          

          When the page is just loaded, it will list all datapoints regardless of ng-init value.
          Also when a device is selected, says PM1, it will return all datapoints from both PM1 and PM10.

          I tried to put
          query="'deviceName=selectedDevice'" or query="'eq(deviceName,selectedDevice)'"
          it wont work.
          when I tried
          query="'deviceName=PM1'" or query="'eq(deviceName,PM1)'"
          It is working for PM1. How can I make it work?

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

            Try query="'deviceName=' + selectedDevice"

            1 Reply Last reply Reply Quote 1
            • M
              morris
              last edited by

              Thanks phildunlap, that solves both issues, including initial page loading.

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

                Glad to hear it!

                1 Reply Last reply Reply Quote 0
                • M
                  morris
                  last edited by

                  Hi phildunlap, may you have a look on my other post? pointquery from a watchlist by watchlistname and do calculation

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