<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Json timstamp pattern (MQTT data source)]]></title><description><![CDATA[<p dir="auto">Hi</p>
<p dir="auto">I'm trying to setup MQTT data source to recive time-stamped value. My Json example is as follows:</p>
<p dir="auto">{<br />
"post":[20191223131022, 10]<br />
}</p>
<p dir="auto">Where <em>20191223131022</em> is the timestamp and <em>10</em> is the value.</p>
<p dir="auto">I've setup my DS as follows:<br />
<img src="https://camo.nodebb.org/18ff8426f00fc5d0b9c7d915b715e10cc4109ebf?url=https%3A%2F%2Fi.imgur.com%2FDvmRfAv.png" alt="0_1577104728149_9cab462b-e434-4a67-9445-8c8474e2f962-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">However I'm not getting the value, though I'm not getting any error message either.</p>
<p dir="auto">When I change subscription topic type from <em>Jason with Timestamp</em> to <em>Jason</em> (no other changes made) I receive the data (timestamped to time when recived) so the issue seems to be only that it does not get the timestamp pattern or timestamp in Json right.</p>
<p dir="auto">Thankful for assistance to get the timestamp issue right.</p>
]]></description><link>https://forum.mango-os.com/topic/4650/json-timstamp-pattern-mqtt-data-source</link><generator>RSS for Node</generator><lastBuildDate>Wed, 13 May 2026 18:48:03 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/4650.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 23 Dec 2019 12:26:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Json timstamp pattern (MQTT data source) on Tue, 24 Dec 2019 17:45:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/nathanrona" aria-label="Profile: nathanRona">@<bdi>nathanRona</bdi></a> I just did a quick test against <a href="http://test.mosquitto.org" rel="nofollow ugc">test.mosquitto.org</a> and was able to publish and receive JSON with Timestamp based values.  I'm posting the JSON config so you can import it and see for yourself.  I can't see exactly what is wrong with your setup but this confirms that it does in fact work.  In the configuration I'm providing there are 2 data points, when you set the value for one it will publish to the receiving topic of the other.</p>
<pre><code>{
  "dataSources":[
    {
      "xid":"DS_b911d1a5-dcfd-424d-ab07-77134185f2a8",
      "name":"Test.Mosquitto.ORG Client",
      "enabled":true,
      "type":"MqttClient",
      "alarmLevels":{
        "DATA_SOURCE_EXCEPTION_EVENT":"URGENT",
        "MQTT_CONNECTION_FAILURE_EVENT":"URGENT",
        "MQTT_PUBLISH_FAILURE_EVENT":"URGENT",
        "POINT_READ_EXCEPTION_EVENT":"URGENT",
        "MQTT_UNKNOWN_TOPIC":"IGNORE",
        "POINT_WRITE_EXCEPTION_EVENT":"URGENT"
      },
      "purgeType":"YEARS",
      "brokerUri":"tcp:\/\/test.mosquitto.org:1883",
      "x509CaCrt":"",
      "clientId":"Mango Automation MQTT Client 148709547341099",
      "userName":"",
      "userPassword":"",
      "topicFilters":"infiniteautomation\/test\/#",
      "autoReconnect":true,
      "cleanSession":true,
      "keepAliveInterval":60,
      "connectionTimeout":30,
      "qosType":"EXACTLY_ONCE",
      "editPermission":"",
      "purgeOverride":false,
      "purgePeriod":1
    }
  ],
  "dataPoints":[
    {
      "xid":"DP_ba31c77f-9c4f-4f02-802c-afcfae830441",
      "name":"number",
      "enabled":true,
      "loggingType":"ALL",
      "intervalLoggingPeriodType":"MINUTES",
      "intervalLoggingType":"AVERAGE",
      "purgeType":"YEARS",
      "pointLocator":{
        "dataType":"NUMERIC",
        "subscribeTopicType":"JSON_WITH_TIMESTAMP",
        "subscribeJsonTimestampPath":"\/ts",
        "subscribeJsonTimestampPattern":"yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSSX",
        "subscribeJsonValuePath":"\/d",
        "subscribeTopic":"infiniteautomation\/test\/number",
        "publishTopicType":"JSON_WITH_TIMESTAMP",
        "publishJsonTimestampName":"ts",
        "publishJsonTimestampPattern":"yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSSX",
        "publishJsonTimestampZone":"UTC",
        "publishJsonValueName":"d",
        "publishTopic":"infiniteautomation\/test\/set\/number"
      },
      "eventDetectors":[
      ],
      "plotType":"STEP",
      "rollup":"NONE",
      "unit":"s",
      "simplifyType":"NONE",
      "chartColour":"",
      "chartRenderer":{
        "type":"IMAGE",
        "timePeriodType":"DAYS",
        "numberOfPeriods":1
      },
      "dataSourceXid":"DS_b911d1a5-dcfd-424d-ab07-77134185f2a8",
      "defaultCacheSize":1,
      "deviceName":"Test.Mosquitto.ORG Client",
      "discardExtremeValues":false,
      "discardHighLimit":1.7976931348623157E308,
      "discardLowLimit":-1.7976931348623157E308,
      "intervalLoggingPeriod":1,
      "intervalLoggingSampleWindowSize":0,
      "overrideIntervalLoggingSamples":false,
      "preventSetExtremeValues":false,
      "purgeOverride":false,
      "purgePeriod":1,
      "readPermission":"",
      "setExtremeHighLimit":1.7976931348623157E308,
      "setExtremeLowLimit":-1.7976931348623157E308,
      "setPermission":"",
      "tags":{
      },
      "textRenderer":{
        "type":"ANALOG",
        "useUnitAsSuffix":true,
        "format":"0.00"
      },
      "tolerance":0.0
    },
    {
      "xid":"DP_0460c207-8a22-4b7c-92b6-ab70c1c41d1c",
      "name":"number-recieve",
      "enabled":true,
      "loggingType":"ALL",
      "intervalLoggingPeriodType":"MINUTES",
      "intervalLoggingType":"INSTANT",
      "purgeType":"YEARS",
      "pointLocator":{
        "dataType":"NUMERIC",
        "subscribeTopicType":"JSON_WITH_TIMESTAMP",
        "subscribeJsonTimestampPath":"\/ts",
        "subscribeJsonTimestampPattern":"yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSSX",
        "subscribeJsonValuePath":"\/d",
        "subscribeTopic":"infiniteautomation\/test\/set\/number",
        "publishTopicType":"JSON_WITH_TIMESTAMP",
        "publishJsonTimestampName":"ts",
        "publishJsonTimestampPattern":"yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSSX",
        "publishJsonTimestampZone":"UTC",
        "publishJsonValueName":"d",
        "publishTopic":"infiniteautomation\/test\/number"
      },
      "eventDetectors":[
      ],
      "plotType":"STEP",
      "rollup":"NONE",
      "unit":"s",
      "simplifyType":"NONE",
      "chartColour":"",
      "chartRenderer":{
        "type":"IMAGE",
        "timePeriodType":"DAYS",
        "numberOfPeriods":1
      },
      "dataSourceXid":"DS_b911d1a5-dcfd-424d-ab07-77134185f2a8",
      "defaultCacheSize":1,
      "deviceName":"Test.Mosquitto.ORG Client",
      "discardExtremeValues":false,
      "discardHighLimit":1.7976931348623157E308,
      "discardLowLimit":-1.7976931348623157E308,
      "intervalLoggingPeriod":15,
      "intervalLoggingSampleWindowSize":0,
      "overrideIntervalLoggingSamples":false,
      "preventSetExtremeValues":false,
      "purgeOverride":false,
      "purgePeriod":1,
      "readPermission":"",
      "setExtremeHighLimit":1.7976931348623157E308,
      "setExtremeLowLimit":-1.7976931348623157E308,
      "setPermission":"",
      "tags":{
      },
      "textRenderer":{
        "type":"ANALOG",
        "useUnitAsSuffix":true,
        "format":"0.00"
      },
      "tolerance":0.0
    }
  ]
}
</code></pre>
]]></description><link>https://forum.mango-os.com/post/24389</link><guid isPermaLink="true">https://forum.mango-os.com/post/24389</guid><dc:creator><![CDATA[terrypacker]]></dc:creator><pubDate>Tue, 24 Dec 2019 17:45:06 GMT</pubDate></item><item><title><![CDATA[Reply to Json timstamp pattern (MQTT data source) on Tue, 24 Dec 2019 08:06:05 GMT]]></title><description><![CDATA[<p dir="auto">Changed is at described but still same result, i.e. if I set type to <em>Jason with Timestamp</em> I don't get any values and if I set to <em>Jason</em> I get the value.</p>
<p dir="auto"><img src="https://camo.nodebb.org/179bfe990383019669fede9923d4f81f7fffd9d8?url=https%3A%2F%2Fi.imgur.com%2Fk48Glvx.png" alt="0_1577175581187_d175da4c-b16e-45b2-98b4-32e5ee204c5a-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><img src="https://camo.nodebb.org/33437b80ffc954978cfd32cf0c68cc35a8ebea4f?url=https%3A%2F%2Fi.imgur.com%2FT104OML.png" alt="0_1577175619487_46f71fa8-7578-4ef6-a6a0-d4dca9d41647-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Btw the array handling that I used is according to example give in help for MQTT ds<br />
<img src="https://camo.nodebb.org/142c87180f177e349d717797258c4277318e13a2?url=https%3A%2F%2Fi.imgur.com%2FsBbCoap.png" alt="0_1577175699363_012bbea5-a1d2-4f62-9247-d82148effbce-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">In addition I would like if possible to get multiple samples in single MQTT message (with diffrent time-stamps). Is that possible? How should JSON be formatted?</p>
]]></description><link>https://forum.mango-os.com/post/24388</link><guid isPermaLink="true">https://forum.mango-os.com/post/24388</guid><dc:creator><![CDATA[nathanRona]]></dc:creator><pubDate>Tue, 24 Dec 2019 08:06:05 GMT</pubDate></item><item><title><![CDATA[Reply to Json timstamp pattern (MQTT data source) on Mon, 23 Dec 2019 20:52:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/nathanrona" aria-label="Profile: nathanRona">@<bdi>nathanRona</bdi></a> your JSON format doesn't seem right.  I'm not 100% sure how to handle arrays but if you can change the format to this it will work:</p>
<pre><code>{
  "post": {
     "0": "20191223131022",
     "1": 10  
  }
}
</code></pre>
<p dir="auto">I would suggest this as it makes more sense:</p>
<pre><code>{
  "post": {
     "date": "20191223131022",
     "value": 10  
  }
}
</code></pre>
<p dir="auto">and then set your JSON pointer for value to <code>/post/value</code> and the time pointer to <code>post/date</code>.</p>
]]></description><link>https://forum.mango-os.com/post/24387</link><guid isPermaLink="true">https://forum.mango-os.com/post/24387</guid><dc:creator><![CDATA[terrypacker]]></dc:creator><pubDate>Mon, 23 Dec 2019 20:52:27 GMT</pubDate></item></channel></rss>