2 Replies Latest reply on Nov 3, 2017 9:29 AM by pjoly RSS
    pjoly Apprentice

    One property (type "location") not recorded into the value stream with others

    hello

     

    i am recording location of devices into a value stream

    all other data are well recorded and I'm able to retriev except one , the GPS position , type "Location"

     

    the real time location (last one) is well displayed but not the history despite I have activated the "logged" option :

     

    real time :

     

    history :

     

    Any reason not to have the Location recorded with other properties ?

     

    Thanks

        • Re: One property (type "location") not recorded into the value stream with others
          pjoly Apprentice

          I tried the method to update all properties in one time but the location is still not recorded with the other properties

           

                  var mylocation = new Object();
                  mylocation.latitude = parseFloat(position.latitude);
                  mylocation.longitude= parseFloat(position.longitude);
                  mylocation.elevation= parseFloat(position.altitude);       
                  logger.debug( logprefix + JSON.stringify(mylocation));
                  var newField = new Object();
                  newField.name = 'LastPosition';
                  newField.baseType = 'LOCATION';
                  myUpdate.AddField(newField);
                  myUpdate.AddRow({LastPosition:mylocation});
          
                 var params = { 
                      values: myUpdate /* INFOTABLE */ 
                  }; 
                  // Finally, update my thing with the properties in the table 
                  Things[mything].UpdatePropertyValues(params); 
          

           

          the log for the new location :

          M2TrackGetData:M2trackMonitoring:{"latitude":48.91365,"longitude":2.2523333333333335,"elevation":0}
          

           

          the new location is not recorded (updated)  :

           

          If I use

                  Things[mything].LastPosition = mylocation;
          

           

          it works but I got a separate record in the value stream.