<?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[Send multiple point value in alarm text]]></title><description><![CDATA[<p dir="auto">Hello, I have a question.</p>
<p dir="auto">I want to know if it's possible to send multiple points values when an alarm is triggered? For example let's say that I have a compressor which is in alarm and when the alarm is triggered I want to send in that email values for Low Pressure, High Pressure, Discharge Temperature and Suction Temperature.</p>
<p dir="auto">Thank you!</p>
]]></description><link>https://forum.mango-os.com/topic/3989/send-multiple-point-value-in-alarm-text</link><generator>RSS for Node</generator><lastBuildDate>Mon, 15 Jun 2026 23:26:07 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/3989.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 03 Jan 2019 12:18:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Send multiple point value in alarm text on Tue, 08 Jan 2019 14:30:55 GMT]]></title><description><![CDATA[<p dir="auto">I used that function because it will give a java.util.List which we could addAll to the other list acquired the same way. You could also use the lastValue function, as described in the JavaScript help, or simply use the .value and .time from the point (which actually wouldn't work quite right here because we need to go through the text renderer, and a .value is a primitive data type usually instead of a DataValue object.</p>
]]></description><link>https://forum.mango-os.com/post/20912</link><guid isPermaLink="true">https://forum.mango-os.com/post/20912</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Tue, 08 Jan 2019 14:30:55 GMT</pubDate></item><item><title><![CDATA[Reply to Send multiple point value in alarm text on Mon, 07 Jan 2019 19:44:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/phildunlap" aria-label="Profile: phildunlap">@<bdi>phildunlap</bdi></a> Yes, now works fine. And I found that if I want only one value, and that one to be the real time value I have to write like this:</p>
<pre><code>var rawValues = pressure.last(1, true);
</code></pre>
<p dir="auto">Thank you! Have a great day!</p>
]]></description><link>https://forum.mango-os.com/post/20906</link><guid isPermaLink="true">https://forum.mango-os.com/post/20906</guid><dc:creator><![CDATA[sky_watcher]]></dc:creator><pubDate>Mon, 07 Jan 2019 19:44:09 GMT</pubDate></item><item><title><![CDATA[Reply to Send multiple point value in alarm text on Mon, 07 Jan 2019 19:10:09 GMT]]></title><description><![CDATA[<p dir="auto">I presume you still want 10 values, and not 1 as in the image?</p>
<pre><code>var rawValues = temperature.last(9); //second argument is cache control. Default is false
rawValues.addAll(temperature.last(1, true)); //if omitted, as of 3.5
</code></pre>
]]></description><link>https://forum.mango-os.com/post/20905</link><guid isPermaLink="true">https://forum.mango-os.com/post/20905</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Mon, 07 Jan 2019 19:10:09 GMT</pubDate></item><item><title><![CDATA[Reply to Send multiple point value in alarm text on Mon, 07 Jan 2019 18:26:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/phildunlap" aria-label="Profile: phildunlap">@<bdi>phildunlap</bdi></a> Hi Phil, I made some test with some points. I have 3 points, one is the point which trigger the alarm and the other two points are a value for temperature and pressure. These two points are logged into my data base every 3 minutes. When the alarm is triggered it sends me in the email the last value that was recorded into my data base which is not the real time value because after the alarm the temperature and the pressure changed but the new values are not recorded into the data base yet.</p>
<p dir="auto"><img src="https://camo.nodebb.org/942f90ce40c4c708084cf67e4d6ea18deb1e9346?url=https%3A%2F%2Fi.imgur.com%2FYewTs05.jpg" alt="0_1546885986287_1111.jpg" class=" img-fluid img-markdown" /></p>
<p dir="auto">I think this line, line 7, get the last recorded value, it is a way to get instant value instead?</p>
<p dir="auto"><img src="https://camo.nodebb.org/83622d28c30c3dc9df5ceed4229f2ad258674a60?url=https%3A%2F%2Fi.imgur.com%2F7fMuqog.jpg" alt="0_1546886027759_222.jpg" class=" img-fluid img-markdown" /></p>
<p dir="auto">Thank you!</p>
]]></description><link>https://forum.mango-os.com/post/20903</link><guid isPermaLink="true">https://forum.mango-os.com/post/20903</guid><dc:creator><![CDATA[sky_watcher]]></dc:creator><pubDate>Mon, 07 Jan 2019 18:26:27 GMT</pubDate></item><item><title><![CDATA[Reply to Send multiple point value in alarm text on Fri, 04 Jan 2019 18:51:20 GMT]]></title><description><![CDATA[<p dir="auto">The answer has some to do with the configuration of the event detector. For instance, if you have a high limit detector and it does not have a duration, then the timestamp of the event should be the time that the polling got a value above the limit. If it did have a duration, then it should be the time that the polling was above the limit, provided it stayed above the reset limit for the duration, plus the duration. This is why the event text would include that the duration was exceeded.</p>
<p dir="auto">Interval logging is not the driver of the event detectors for the point they are on. If you wish to have event detectors on the interval logged average, you can use a meta point with its context event set to <code>Logged</code>.</p>
]]></description><link>https://forum.mango-os.com/post/20895</link><guid isPermaLink="true">https://forum.mango-os.com/post/20895</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Fri, 04 Jan 2019 18:51:20 GMT</pubDate></item><item><title><![CDATA[Reply to Send multiple point value in alarm text on Fri, 04 Jan 2019 18:46:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/phildunlap" aria-label="Profile: phildunlap">@<bdi>phildunlap</bdi></a> Ok, let say that my temperature point is recorded in my database every 3 minutes, but my point is updated form PLC at every 5 seconds, (the record at every 3 minutes is made by an average off all readings between those 3 minutes, correct?).</p>
<p dir="auto">If my alarm point occurs somewhere between those 3 minutes intervals which value is displayed for T0? Instant value or the last value recorded?</p>
<p dir="auto">I came with this problem when I saw that the timestamp for the alarm trigger point and T0 are different.</p>
<p dir="auto">I hope I was clear enough :)</p>
]]></description><link>https://forum.mango-os.com/post/20893</link><guid isPermaLink="true">https://forum.mango-os.com/post/20893</guid><dc:creator><![CDATA[sky_watcher]]></dc:creator><pubDate>Fri, 04 Jan 2019 18:46:36 GMT</pubDate></item><item><title><![CDATA[Reply to Send multiple point value in alarm text on Fri, 04 Jan 2019 18:36:13 GMT]]></title><description><![CDATA[<p dir="auto">Are you saying you put that in the loop?</p>
<blockquote>
<p dir="auto">But my question is the value in real time or is last value from my database?</p>
</blockquote>
<p dir="auto">I don't understand what you're asking.</p>
]]></description><link>https://forum.mango-os.com/post/20892</link><guid isPermaLink="true">https://forum.mango-os.com/post/20892</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Fri, 04 Jan 2019 18:36:13 GMT</pubDate></item><item><title><![CDATA[Reply to Send multiple point value in alarm text on Fri, 04 Jan 2019 18:27:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/phildunlap" aria-label="Profile: phildunlap">@<bdi>phildunlap</bdi></a> Thank's, if I put this line I get the same time for all the points.</p>
<pre><code>${evt.prettyActiveTimestamp}
</code></pre>
<p dir="auto">But my question is the value in real time or is last value from my database?</p>
<p dir="auto"><img src="https://camo.nodebb.org/d34cdc34e6f8ecaafcab8341303c64303e934c69?url=https%3A%2F%2Fi.imgur.com%2FIsiHIgV.jpg" alt="0_1546626888445_1111fdsfgr.jpg" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.mango-os.com/post/20891</link><guid isPermaLink="true">https://forum.mango-os.com/post/20891</guid><dc:creator><![CDATA[sky_watcher]]></dc:creator><pubDate>Fri, 04 Jan 2019 18:27:15 GMT</pubDate></item><item><title><![CDATA[Reply to Send multiple point value in alarm text on Fri, 04 Jan 2019 18:02:46 GMT]]></title><description><![CDATA[<p dir="auto">I think what you're looking for could be found in the Mango/ftl/ files. The eventData.ftl files shows you can do</p>
<pre><code>${evt.prettyActiveTimestamp}
</code></pre>
<p dir="auto"><code>evt</code> is a <a href="https://github.com/infiniteautomation/ma-core-public/blob/main/Core/src/com/serotonin/m2m2/rt/event/EventInstance.java" rel="nofollow ugc">https://github.com/infiniteautomation/ma-core-public/blob/main/Core/src/com/serotonin/m2m2/rt/event/EventInstance.java</a> so you can use those getter functions in the FTL, as prettyActiveTimestamp does.</p>
]]></description><link>https://forum.mango-os.com/post/20890</link><guid isPermaLink="true">https://forum.mango-os.com/post/20890</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Fri, 04 Jan 2019 18:02:46 GMT</pubDate></item><item><title><![CDATA[Reply to Send multiple point value in alarm text on Fri, 04 Jan 2019 14:54:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/phildunlap" aria-label="Profile: phildunlap">@<bdi>phildunlap</bdi></a> Hi Phil, I have to reopen this discussion, today when I played around with the email feature, I was trying to customize the email and I've noticed that the time when the alarm was triggered is not the same with the time for the values, and this make sense because I record that values in the database every minute.</p>
<p dir="auto">So I have a question, can I print there the instant value, not a recorded value from my data base? Because when the alarm is triggered that point can have another value that the one that is last recorded in my database.</p>
<p dir="auto"><img src="https://camo.nodebb.org/d3baca453e79257d09b0460500f784436dbae997?url=https%3A%2F%2Fi.imgur.com%2FTBdHD15.jpg" alt="0_1546614058426_11sadf.jpg" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.mango-os.com/post/20889</link><guid isPermaLink="true">https://forum.mango-os.com/post/20889</guid><dc:creator><![CDATA[sky_watcher]]></dc:creator><pubDate>Fri, 04 Jan 2019 14:54:12 GMT</pubDate></item><item><title><![CDATA[Reply to Send multiple point value in alarm text on Thu, 03 Jan 2019 20:48:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/phildunlap" aria-label="Profile: phildunlap">@<bdi>phildunlap</bdi></a> Yes, is working now.</p>
<p dir="auto">Thank you a lot! Have a great day!</p>
]]></description><link>https://forum.mango-os.com/post/20888</link><guid isPermaLink="true">https://forum.mango-os.com/post/20888</guid><dc:creator><![CDATA[sky_watcher]]></dc:creator><pubDate>Thu, 03 Jan 2019 20:48:06 GMT</pubDate></item><item><title><![CDATA[Reply to Send multiple point value in alarm text on Thu, 03 Jan 2019 20:41:36 GMT]]></title><description><![CDATA[<p dir="auto">Maybe you can try <code>${value.time?number_to_datetime}</code> in the FTL or you could use a SimpleDateFormatter in the script to store it in the format you want.</p>
]]></description><link>https://forum.mango-os.com/post/20887</link><guid isPermaLink="true">https://forum.mango-os.com/post/20887</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Thu, 03 Jan 2019 20:41:36 GMT</pubDate></item><item><title><![CDATA[Reply to Send multiple point value in alarm text on Thu, 03 Jan 2019 20:37:40 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/phildunlap" aria-label="Profile: phildunlap">@<bdi>phildunlap</bdi></a> Yes, now work perfect for value, but the time is still in that weird format.</p>
<p dir="auto"><img src="https://camo.nodebb.org/52762f75fab30c9616bed5ab56c3f8fd8ad283a0?url=https%3A%2F%2Fi.imgur.com%2F7gSUASP.jpg" alt="0_1546548324807_asdf.jpg" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.mango-os.com/post/20886</link><guid isPermaLink="true">https://forum.mango-os.com/post/20886</guid><dc:creator><![CDATA[sky_watcher]]></dc:creator><pubDate>Thu, 03 Jan 2019 20:37:40 GMT</pubDate></item><item><title><![CDATA[Reply to Send multiple point value in alarm text on Thu, 03 Jan 2019 20:32:51 GMT]]></title><description><![CDATA[<p dir="auto">Whoops, FTL issues,</p>
<pre><code>&lt;#if pressureValues??&gt;
  &lt;#list pressureValues as index, value&gt;
  ${additionalContext.pressure.deviceName} - ${additionalContext.pressure.name} - ${value.value} - ${value.time}&lt;br/&gt;
  &lt;/#list&gt;
&lt;/#if&gt;
</code></pre>
<p dir="auto">There were related messages in the log file.</p>
]]></description><link>https://forum.mango-os.com/post/20883</link><guid isPermaLink="true">https://forum.mango-os.com/post/20883</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Thu, 03 Jan 2019 20:32:51 GMT</pubDate></item><item><title><![CDATA[Reply to Send multiple point value in alarm text on Thu, 03 Jan 2019 20:13:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/phildunlap" aria-label="Profile: phildunlap">@<bdi>phildunlap</bdi></a> Still doesn't work, I don't receive any email after this modification.</p>
<p dir="auto"><img src="https://camo.nodebb.org/964862fecb65a0a5cc1c2a149749718e7aacb5d6?url=https%3A%2F%2Fi.imgur.com%2FrZfJvxX.jpg" alt="0_1546546860524_ddddd.jpg" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.mango-os.com/post/20882</link><guid isPermaLink="true">https://forum.mango-os.com/post/20882</guid><dc:creator><![CDATA[sky_watcher]]></dc:creator><pubDate>Thu, 03 Jan 2019 20:13:20 GMT</pubDate></item><item><title><![CDATA[Reply to Send multiple point value in alarm text on Thu, 03 Jan 2019 19:56:02 GMT]]></title><description><![CDATA[<p dir="auto">My mistake! The function probably should be doing,</p>
<pre><code>function getRenderedValues(variableName, limit) {
    var renderedValues = [];
    var textRenderer = CONTEXT_POINTS[variableName].getVO().getTextRenderer();
    if(textRenderer === null || textRenderer === undefined)
        return renderedValues;

    var rawValues = p.last(10);
    for(var k = 0; k &lt; rawValues.length; k+=1) {
        //See com.serotonin.m2m2.view.text.TextRenderer 
        //  for understanding the second argument in getText
        renderedValues.push( {"value": textRenderer.getText(rawValues[k], 2), 
            "time": rawValues[k].time} );
    }
    return renderedValues;
}
</code></pre>
<p dir="auto">It was making rendered values as a list of strings, so there was not a .value or .time property for the FTL to refer to. Instead will make it a list of objects with those properties.</p>
]]></description><link>https://forum.mango-os.com/post/20880</link><guid isPermaLink="true">https://forum.mango-os.com/post/20880</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Thu, 03 Jan 2019 19:56:02 GMT</pubDate></item><item><title><![CDATA[Reply to Send multiple point value in alarm text on Thu, 03 Jan 2019 19:51:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/phildunlap" aria-label="Profile: phildunlap">@<bdi>phildunlap</bdi></a> I tried this before, but without removing print statement and did not worked. I tried again now after I've removed the print statement and is not working.</p>
]]></description><link>https://forum.mango-os.com/post/20879</link><guid isPermaLink="true">https://forum.mango-os.com/post/20879</guid><dc:creator><![CDATA[sky_watcher]]></dc:creator><pubDate>Thu, 03 Jan 2019 19:51:44 GMT</pubDate></item><item><title><![CDATA[Reply to Send multiple point value in alarm text on Thu, 03 Jan 2019 19:44:56 GMT]]></title><description><![CDATA[<p dir="auto">Remove the print statement and do,</p>
<pre><code>model.put("temperatureValues", getRenderedValues("temperature", 5));</code></pre>
]]></description><link>https://forum.mango-os.com/post/20878</link><guid isPermaLink="true">https://forum.mango-os.com/post/20878</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Thu, 03 Jan 2019 19:44:56 GMT</pubDate></item><item><title><![CDATA[Reply to Send multiple point value in alarm text on Thu, 03 Jan 2019 19:41:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jared-wiltshire" aria-label="Profile: jared-wiltshire">@<bdi>jared-wiltshire</bdi></a> I've seen your post after writing to Phil...</p>
<p dir="auto">I'll look into the docs and come with an answer.</p>
<p dir="auto">Thank you Jared!</p>
]]></description><link>https://forum.mango-os.com/post/20877</link><guid isPermaLink="true">https://forum.mango-os.com/post/20877</guid><dc:creator><![CDATA[sky_watcher]]></dc:creator><pubDate>Thu, 03 Jan 2019 19:41:25 GMT</pubDate></item><item><title><![CDATA[Reply to Send multiple point value in alarm text on Thu, 03 Jan 2019 19:37:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/phildunlap" aria-label="Profile: phildunlap">@<bdi>phildunlap</bdi></a> Thanks Phil, I see that the script works grate but I'm not quite sure how to transfer the result of the function to the model.put("temperatureValues", temperature.last(5));</p>
<p dir="auto"><img src="https://camo.nodebb.org/08bb2c4562ebf3ab0e2663dbba9a14a39f0c9f50?url=https%3A%2F%2Fi.imgur.com%2FZm1FjHp.jpg" alt="0_1546544387778_2019-01-03_21-35-21.jpg" class=" img-fluid img-markdown" /></p>
<p dir="auto">And how can I render the time?</p>
<p dir="auto">Thank you!</p>
]]></description><link>https://forum.mango-os.com/post/20876</link><guid isPermaLink="true">https://forum.mango-os.com/post/20876</guid><dc:creator><![CDATA[sky_watcher]]></dc:creator><pubDate>Thu, 03 Jan 2019 19:37:58 GMT</pubDate></item><item><title><![CDATA[Reply to Send multiple point value in alarm text on Thu, 03 Jan 2019 19:30:18 GMT]]></title><description><![CDATA[<p dir="auto">Alternatively look into Freemarkers format options<br />
<a href="https://freemarker.apache.org/docs/ref_builtins_date.html" rel="nofollow ugc">https://freemarker.apache.org/docs/ref_builtins_date.html</a><br />
<a href="https://freemarker.apache.org/docs/ref_builtins_number.html" rel="nofollow ugc">https://freemarker.apache.org/docs/ref_builtins_number.html</a></p>
]]></description><link>https://forum.mango-os.com/post/20875</link><guid isPermaLink="true">https://forum.mango-os.com/post/20875</guid><dc:creator><![CDATA[Jared Wiltshire]]></dc:creator><pubDate>Thu, 03 Jan 2019 19:30:18 GMT</pubDate></item><item><title><![CDATA[Reply to Send multiple point value in alarm text on Thu, 03 Jan 2019 19:03:17 GMT]]></title><description><![CDATA[<p dir="auto">You'll have to manually get the values rendered as desired. Presumably that'll be the point's text renderer, so you could have a function like this, perhaps in a global script:</p>
<pre><code>function getRenderedValues(variableName, limit) {
    var renderedValues = [];
    var textRenderer = CONTEXT_POINTS[variableName].getVO().getTextRenderer();
    if(textRenderer === null || textRenderer === undefined)
        return renderedValues;

    var rawValues = p.last(10);
    for(var k = 0; k &lt; rawValues.length; k+=1) {
        //See com.serotonin.m2m2.view.text.TextRenderer 
        //  for understanding the second argument
        renderedValues.push(textRenderer.getText(rawValues[k], 2));
    }
    return renderedValues;
}
//Remove the print portion if a global script, or after testing
print(getRenderedValues("p", 10));
</code></pre>
]]></description><link>https://forum.mango-os.com/post/20873</link><guid isPermaLink="true">https://forum.mango-os.com/post/20873</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Thu, 03 Jan 2019 19:03:17 GMT</pubDate></item><item><title><![CDATA[Reply to Send multiple point value in alarm text on Thu, 03 Jan 2019 18:29:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/phildunlap" aria-label="Profile: phildunlap">@<bdi>phildunlap</bdi></a> Thank you Phil, your example works but it is a way to format the value?<br />
For value I have to many decimals and for time it in a wired format.</p>
<p dir="auto"><img src="https://camo.nodebb.org/114956e33666aeb4bb7331e30b51b0b3ac33d6cf?url=https%3A%2F%2Fi.imgur.com%2FWzrT82g.jpg" alt="0_1546540613156_2019-01-03_20-32-38.jpg" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.mango-os.com/post/20872</link><guid isPermaLink="true">https://forum.mango-os.com/post/20872</guid><dc:creator><![CDATA[sky_watcher]]></dc:creator><pubDate>Thu, 03 Jan 2019 18:29:12 GMT</pubDate></item><item><title><![CDATA[Reply to Send multiple point value in alarm text on Thu, 03 Jan 2019 20:32:11 GMT]]></title><description><![CDATA[<p dir="auto">Hi sky_watcher,</p>
<p dir="auto">That is because the list you are iterating in the FTL is the <code>renderedHtmlPointValues</code> which is included in the model for the point that triggered the event. Instead, you would want to iterate over the lists you added to the model (and probably separately), so</p>
<pre><code>&lt;#if pressureValues??&gt;
  &lt;#list pressureValues as index,value&gt;
  ${additionalContext.pressure.deviceName} - ${additionalContext.pressure.name} - ${value.value} - ${value.time}&lt;br/&gt;
  &lt;/#list&gt;
&lt;/#if&gt;
</code></pre>
<p dir="auto">We have to &lt;#list&gt; over <code>index, value</code> because a JavaScript list is backed by a Map with the natural numbers as the keys, so it's more like looping over a map.</p>
]]></description><link>https://forum.mango-os.com/post/20871</link><guid isPermaLink="true">https://forum.mango-os.com/post/20871</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Thu, 03 Jan 2019 20:32:11 GMT</pubDate></item></channel></rss>