Best practice for storing location data in a ThingWorx property
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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?
Solved! Go to Solution.
- Labels:
-
Troubleshooting
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
