cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Best practice for storing location data in a ThingWorx property

Do1
10-Marble
10-Marble

Best practice for storing location data in a ThingWorx property

What is the best practice for storing GPS Location data (Lon, Lat, Elevation) in a ThingWorx Location property of a thing using a subscription.

Scenario:

I receive an MQTT message with a JSON payload.  This is stored as a property in a thing based on the MQTT thing template (version 2.1).

When the data of the JSON property changes the subscription should parse the data and update the location property of the thing appropriately.

To test this I use http://owntracks.org/ and my own mosquito MQTT broker.

I have no problem parsing the JSON or extracting the lon, lat values. I can even push the data into the location property of the thing (this funnily tends to disappear after a few minutes even though it has been set as persistant), but it does not store the value of the location property in the value stream.

What am I doing wrong?

ACCEPTED SOLUTION

Accepted Solutions
A_Macierzynski
15-Moonstone
(To:Do1)

Hi Duan,

If the value of the Location property tends to disappear after some time it is probably overwritten by "undefined" value. You can log the lat. and long. in the subscription and check if it is always correctly parsed. Make sure that you property is marked as "Logged". It is required to push value to the Value Stream.

Best Regards,

Adam

View solution in original post

1 REPLY 1
A_Macierzynski
15-Moonstone
(To:Do1)

Hi Duan,

If the value of the Location property tends to disappear after some time it is probably overwritten by "undefined" value. You can log the lat. and long. in the subscription and check if it is always correctly parsed. Make sure that you property is marked as "Logged". It is required to push value to the Value Stream.

Best Regards,

Adam

Announcements


Top Tags