<?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[HTTP Sender Single Message]]></title><description><![CDATA[<p dir="auto">Hi All,<br />
I am publishing 2 data points to a 3rd party using HTTP Sender (Post). The sender is working but the data points are being sent as 2 separate messages at times. The customer wants the data in a single message every time.</p>
<p dir="auto"><strong>Sometimes it comes in like this -</strong></p>
<p dir="auto">Source: 83.147.156.26<br />
Device ID: -<br />
Time: Thursday, June 18th 2020, 9:51:31 am</p>
<p dir="auto">PPKW: 7.603125 - 2020-06-18T09:51:30.000+01:00</p>
<p dir="auto">Source: 83.147.156.26<br />
Device ID: -<br />
Time: Thursday, June 18th 2020, 9:51:31 am</p>
<p dir="auto">PPEnergy: 87871.265625 - 2020-06-18T09:51:30.000+01:00</p>
<p dir="auto"><strong>This is how I need it -</strong></p>
<p dir="auto">Source: 83.147.156.26<br />
Device ID: -<br />
Time: Thursday, June 18th 2020, 9:51:31 am</p>
<p dir="auto">PPKW: 7.603125 - 2020-06-18T09:51:30.000+01:00<br />
PPEnergy: 87871.265625 - 2020-06-18T09:51:30.000+01:00</p>
<p dir="auto">Is there anything I can do? Thanks.</p>
]]></description><link>https://forum.mango-os.com/topic/4849/http-sender-single-message</link><generator>RSS for Node</generator><lastBuildDate>Mon, 15 Jun 2026 23:29:03 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/4849.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 18 Jun 2020 08:56:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to HTTP Sender Single Message on Wed, 24 Jun 2020 06:48:19 GMT]]></title><description><![CDATA[<p dir="auto">I've made some amendments (copy from above) - sure enough the data we needed was inside the runtime property. BUT I found the solution!<br />
The sodding datapoint query doesn't work in 3.7 without setting the script permissions.<br />
Normally these were populated by default, but this is no longer the case. In this case, make the script permission run as superuser to get your points through, or at least the user allowed to read those points.</p>
<p dir="auto">Once you've done that you'll be away!</p>
<p dir="auto">Fox</p>
]]></description><link>https://forum.mango-os.com/post/25392</link><guid isPermaLink="true">https://forum.mango-os.com/post/25392</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Wed, 24 Jun 2020 06:48:19 GMT</pubDate></item><item><title><![CDATA[Reply to HTTP Sender Single Message on Tue, 23 Jun 2020 11:09:24 GMT]]></title><description><![CDATA[<p dir="auto">No problem. Thanks.</p>
]]></description><link>https://forum.mango-os.com/post/25390</link><guid isPermaLink="true">https://forum.mango-os.com/post/25390</guid><dc:creator><![CDATA[Robmalone]]></dc:creator><pubDate>Tue, 23 Jun 2020 11:09:24 GMT</pubDate></item><item><title><![CDATA[Reply to HTTP Sender Single Message on Tue, 23 Jun 2020 09:56:40 GMT]]></title><description><![CDATA[<p dir="auto">I can't remember if 3.7 lets you validate a script like 3.5 and earlier could... Thing is, that loop should be looping twice for those two data points. There has to be an error... Turn on logging and see what you can find.<br />
I'll do a quick test for you in the morning. It's 10:15pm here and I'm not much help right at this moment!</p>
<p dir="auto">Fox</p>
]]></description><link>https://forum.mango-os.com/post/25388</link><guid isPermaLink="true">https://forum.mango-os.com/post/25388</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Tue, 23 Jun 2020 09:56:40 GMT</pubDate></item><item><title><![CDATA[Reply to HTTP Sender Single Message on Tue, 23 Jun 2020 09:49:41 GMT]]></title><description><![CDATA[<p dir="auto">Still no luck with that. The RQL query is working fine in the watchlist builder, giving the correct 2 points back but still no data points or values when I validate the script, even after including print( allPoints ) at the end.</p>
]]></description><link>https://forum.mango-os.com/post/25387</link><guid isPermaLink="true">https://forum.mango-os.com/post/25387</guid><dc:creator><![CDATA[Robmalone]]></dc:creator><pubDate>Tue, 23 Jun 2020 09:49:41 GMT</pubDate></item><item><title><![CDATA[Reply to HTTP Sender Single Message on Tue, 23 Jun 2020 09:28:37 GMT]]></title><description><![CDATA[<p dir="auto">put a <code>print( allPoints )</code> under the query call. There's a chance my tag query doesn't agree with your tags and how you set them.</p>
<p dir="auto">EDIT: If you check the other post as I mentioned, you can check my query by pasting it into the RQL query builder in the watchlist builder page.</p>
]]></description><link>https://forum.mango-os.com/post/25386</link><guid isPermaLink="true">https://forum.mango-os.com/post/25386</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Tue, 23 Jun 2020 09:28:37 GMT</pubDate></item><item><title><![CDATA[Reply to HTTP Sender Single Message on Tue, 23 Jun 2020 08:46:56 GMT]]></title><description><![CDATA[<p dir="auto">Should I see the point values when I validate the script? What I get is -<br />
"Script result: Source: 83.147.156.26&lt;br&gt;Device ID: -&lt;br&gt;Time: Tue Jun 23 2020 10:06:04 GMT+0100 (BST)&lt;br&gt;&lt;br&gt;"</p>
]]></description><link>https://forum.mango-os.com/post/25385</link><guid isPermaLink="true">https://forum.mango-os.com/post/25385</guid><dc:creator><![CDATA[Robmalone]]></dc:creator><pubDate>Tue, 23 Jun 2020 08:46:56 GMT</pubDate></item><item><title><![CDATA[Reply to HTTP Sender Single Message on Tue, 23 Jun 2020 08:37:40 GMT]]></title><description><![CDATA[<p dir="auto">Yes inside the meta data point. Then when you return the value, it sets that as the point's value to be fired out of the publisher</p>
<p dir="auto">Fox</p>
]]></description><link>https://forum.mango-os.com/post/25384</link><guid isPermaLink="true">https://forum.mango-os.com/post/25384</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Tue, 23 Jun 2020 08:37:40 GMT</pubDate></item><item><title><![CDATA[Reply to HTTP Sender Single Message on Tue, 23 Jun 2020 08:34:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mattfox" aria-label="Profile: MattFox">@<bdi>MattFox</bdi></a> Thanks for the help but I'm a bit confused. Do I use this script in the Meta data point? I'm not seeing any points/point values?</p>
]]></description><link>https://forum.mango-os.com/post/25383</link><guid isPermaLink="true">https://forum.mango-os.com/post/25383</guid><dc:creator><![CDATA[Robmalone]]></dc:creator><pubDate>Tue, 23 Jun 2020 08:34:03 GMT</pubDate></item><item><title><![CDATA[Reply to HTTP Sender Single Message on Tue, 23 Jun 2020 20:11:23 GMT]]></title><description><![CDATA[<p dir="auto">OK! For your query/script:</p>
<pre><code>//First we need the correct format:
    function pad(number) {
      if (number &lt; 10) {
        return '0' + number;
      }
      return number;
    }

   var toISOString = function(d) {
      return d.getUTCFullYear() +
        '-' + pad(d.getUTCMonth() + 1) +
        '-' + pad(d.getUTCDate()) +
        'T' + pad(d.getUTCHours()) +
        ':' + pad(d.getUTCMinutes()) +
        ':' + pad(d) +
        '.' + (d.getUTCMilliseconds() / 1000).toFixed(3).slice(2, 5) +
        'Z';
    };

//Make your RQL query up:
var ts = Number(CONTEXT.timestamp);
var d = new Date();
d.setTime(ts);
var RQL = "eq(tags.Sender,EETest)&amp;sort(deviceName,name)&amp;limit(2)";
var allPoints = DataPointQuery.query(RQL);
var body = "Source: 83.147.156.26&lt;br&gt;";
body += "Device ID: -&lt;br&gt;";
body += "Time: " + d.toString() + "&lt;br&gt;&lt;br&gt;"; //Two newlines

//print(DataPointQuery);
print(allPoints)
for(var i=0; i&lt;allPoints.length;i++)
{
    var value = -99; //if there's an error we'll know
   var dp = allPoints[ i ];
       print(dp)
    d.setTime(dp.runtime.time);
    value = dp.runtime.last(1,true); //or pointValueAt(ts,true)
    if(value[0]){value = value[0].value;}
   body+= dp.xid+":"+value+" - "+toISOString(d)+"&lt;br&gt;";
}
return body;//Send as post 
</code></pre>
<p dir="auto">Hope this gives you something to build from. Might be beneficial if you can fire a test post into <a href="https://webhook.site" rel="nofollow ugc">https://webhook.site</a> so you can check the format of your message. If you can do that, you can share the post link so others can see the format you want to achieve and how it comes from mango.</p>
]]></description><link>https://forum.mango-os.com/post/25372</link><guid isPermaLink="true">https://forum.mango-os.com/post/25372</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Tue, 23 Jun 2020 20:11:23 GMT</pubDate></item><item><title><![CDATA[Reply to HTTP Sender Single Message on Fri, 19 Jun 2020 20:50:42 GMT]]></title><description><![CDATA[<p dir="auto">Nope that's good. I'll come back to you soon. I've got a busy day ahead!</p>
<p dir="auto">Hope it's not too urgent!</p>
<p dir="auto">Fox</p>
]]></description><link>https://forum.mango-os.com/post/25364</link><guid isPermaLink="true">https://forum.mango-os.com/post/25364</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Fri, 19 Jun 2020 20:50:42 GMT</pubDate></item><item><title><![CDATA[Reply to HTTP Sender Single Message on Fri, 19 Jun 2020 10:52:50 GMT]]></title><description><![CDATA[<p dir="auto">Great <a class="plugin-mentions-user plugin-mentions-a" href="/user/mattfox" aria-label="Profile: MattFox">@<bdi>MattFox</bdi></a>. Thank you.<br />
I have tagged both points with a Tag Key of "Sender" and Tag Value of "EETest"</p>
<p dir="auto">Point 1 - device name: Powerpoint Main Incomer, point name: Active Energy, Tag - Sender: EETest<br />
Point 2- device name: Powerpoint Main Incomer, point name: Active Power, Tag - Sender: EETest<br />
Alphanumeric Meta Data Point - device name:HTTPSenderTest, point name:SenderPoints<br />
Added the 2 points above as external context points. Keys are<br />
Point 1 Active Energy - PPAE<br />
Point 2 Active Power - PPKW</p>
<p dir="auto">Do you need any more info?</p>
]]></description><link>https://forum.mango-os.com/post/25362</link><guid isPermaLink="true">https://forum.mango-os.com/post/25362</guid><dc:creator><![CDATA[Robmalone]]></dc:creator><pubDate>Fri, 19 Jun 2020 10:52:50 GMT</pubDate></item><item><title><![CDATA[Reply to HTTP Sender Single Message on Thu, 18 Jun 2020 23:09:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/robmalone" aria-label="Profile: robmalone">@<bdi>robmalone</bdi></a> said in <a href="/post/25360">HTTP Sender Single Message</a>:</p>
<blockquote>
<p dir="auto">I could give all points a common device name for each MangoGT. Hopefully that should make things a bit easier.</p>
</blockquote>
<p dir="auto">Sure let's get this sorted. Give what information you can and I'll teach you how to piece it together. I'd recommend learning to tag points though as it gives you more control over your point queries...</p>
<p dir="auto">Fox</p>
]]></description><link>https://forum.mango-os.com/post/25361</link><guid isPermaLink="true">https://forum.mango-os.com/post/25361</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Thu, 18 Jun 2020 23:09:23 GMT</pubDate></item><item><title><![CDATA[Reply to HTTP Sender Single Message on Thu, 18 Jun 2020 22:58:17 GMT]]></title><description><![CDATA[<p dir="auto">Thanks <a class="plugin-mentions-user plugin-mentions-a" href="/user/mattfox" aria-label="Profile: MattFox">@<bdi>MattFox</bdi></a>. Sounds good but I don't have much experience in scripting, would very much appreciate some help with it.<br />
I could give all points a common device name for each MangoGT. Hopefully that should make things a bit easier.</p>
]]></description><link>https://forum.mango-os.com/post/25360</link><guid isPermaLink="true">https://forum.mango-os.com/post/25360</guid><dc:creator><![CDATA[Robmalone]]></dc:creator><pubDate>Thu, 18 Jun 2020 22:58:17 GMT</pubDate></item><item><title><![CDATA[Reply to HTTP Sender Single Message on Thu, 18 Jun 2020 20:27:47 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto">Would I have to combine all 30-40 points?</p>
</blockquote>
<p dir="auto">Not necessarily as context points!<br />
If you know what points they are and are able to tag them or if you know they have a distinct deviceName/name pattern then we can utilise an rql query, pull them in, get their latest pointvalues (ie pointvaluebefore current context runtime) sort them how you would like them to be formatted then simply return it to the metaPoint. From there that will trigger as a context point in your publisher and allow you to send the whole batch in one go. Use a timer to make it fire every fifteen minutes and you're away!</p>
<p dir="auto">Fox</p>
]]></description><link>https://forum.mango-os.com/post/25358</link><guid isPermaLink="true">https://forum.mango-os.com/post/25358</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Thu, 18 Jun 2020 20:27:47 GMT</pubDate></item><item><title><![CDATA[Reply to HTTP Sender Single Message on Thu, 18 Jun 2020 11:54:31 GMT]]></title><description><![CDATA[<p dir="auto">Thanks <a class="plugin-mentions-user plugin-mentions-a" href="/user/mattfox" aria-label="Profile: MattFox">@<bdi>MattFox</bdi></a>. Im not sure if that will work. I am working with a 3rd party on a project, the 2 data points above are for testing how the 3rd party server receives and parses the data from Mango.<br />
The plan is to install a number of MangoGTs and publish that data to their server. They want all data points in one message. Some of the sites may have 30-40 data points. Would I have to combine all 30-40 points?</p>
]]></description><link>https://forum.mango-os.com/post/25356</link><guid isPermaLink="true">https://forum.mango-os.com/post/25356</guid><dc:creator><![CDATA[Robmalone]]></dc:creator><pubDate>Thu, 18 Jun 2020 11:54:31 GMT</pubDate></item><item><title><![CDATA[Reply to HTTP Sender Single Message on Thu, 18 Jun 2020 11:43:43 GMT]]></title><description><![CDATA[<p dir="auto">No, combine your values into a alphanumeric metapoint value, thus allowing you to format your text how you'd like then fire that out as your publisher point instead rather than two individual points.<br />
If that's a bit confusing I'll help you with a script when I am near my computer tomorrow.</p>
<p dir="auto">Fox</p>
]]></description><link>https://forum.mango-os.com/post/25355</link><guid isPermaLink="true">https://forum.mango-os.com/post/25355</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Thu, 18 Jun 2020 11:43:43 GMT</pubDate></item><item><title><![CDATA[Reply to HTTP Sender Single Message on Thu, 18 Jun 2020 11:48:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mattfox" aria-label="Profile: MattFox">@<bdi>MattFox</bdi></a>  I have the Update Event set to "Logged only" and I have "Publish Attribute Change" ticked. It is polling every second but logging every 15 mins. They both log at the same time so I assumed they would update at the same time.<br />
Should I have "Publish Attribute Change" ticked?</p>
]]></description><link>https://forum.mango-os.com/post/25354</link><guid isPermaLink="true">https://forum.mango-os.com/post/25354</guid><dc:creator><![CDATA[Robmalone]]></dc:creator><pubDate>Thu, 18 Jun 2020 11:48:00 GMT</pubDate></item><item><title><![CDATA[Reply to HTTP Sender Single Message on Thu, 18 Jun 2020 09:51:43 GMT]]></title><description><![CDATA[<p dir="auto">Question!<br />
Do these both update at the same time all the time? And if so, at what rate?</p>
]]></description><link>https://forum.mango-os.com/post/25351</link><guid isPermaLink="true">https://forum.mango-os.com/post/25351</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Thu, 18 Jun 2020 09:51:43 GMT</pubDate></item></channel></rss>