<?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[Event Detector - get point by XID]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">Is it possible to get the value of event detectors (I assume they return a binary 0 or 1) by XID?</p>
<p dir="auto">I tried ma-get-point for the XID of the event detector and it looks like it just returns an empty object.</p>
<p dir="auto">Thanks!</p>
]]></description><link>https://forum.mango-os.com/topic/3433/event-detector-get-point-by-xid</link><generator>RSS for Node</generator><lastBuildDate>Mon, 15 Jun 2026 17:40:39 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/3433.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 20 Apr 2018 19:26:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Event Detector - get point by XID on Mon, 23 Apr 2018 20:07:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/rshah" aria-label="Profile: rshah">@<bdi>rshah</bdi></a> said in <a href="/post/18134">Event Detector - get point by XID</a>:</p>
<blockquote>
<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> said in <a href="/post/18132">Event Detector - get point by XID</a>:</p>
<blockquote>
<p dir="auto">Any code you put in the user module will run in the browser so check browser compatibility tables to see if you can use async/await.</p>
</blockquote>
<p dir="auto">Thank you!</p>
</blockquote>
<p dir="auto">Oh, actually I just remembered - The promises used in Angular are not native ES6 promises so they probably wont work with async/await. See <a href="https://docs.angularjs.org/api/ng/service/$q" rel="nofollow ugc">https://docs.angularjs.org/api/ng/service/$q</a></p>
<p dir="auto">You could probably adapt them though.</p>
]]></description><link>https://forum.mango-os.com/post/18137</link><guid isPermaLink="true">https://forum.mango-os.com/post/18137</guid><dc:creator><![CDATA[Jared Wiltshire]]></dc:creator><pubDate>Mon, 23 Apr 2018 20:07:36 GMT</pubDate></item><item><title><![CDATA[Reply to Event Detector - get point by XID on Mon, 23 Apr 2018 18:18:35 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> said in <a href="/post/18132">Event Detector - get point by XID</a>:</p>
<blockquote>
<p dir="auto">Any code you put in the user module will run in the browser so check browser compatibility tables to see if you can use async/await.</p>
</blockquote>
<p dir="auto">Thank you!</p>
]]></description><link>https://forum.mango-os.com/post/18134</link><guid isPermaLink="true">https://forum.mango-os.com/post/18134</guid><dc:creator><![CDATA[rshah]]></dc:creator><pubDate>Mon, 23 Apr 2018 18:18:35 GMT</pubDate></item><item><title><![CDATA[Reply to Event Detector - get point by XID on Mon, 23 Apr 2018 18:06:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/rshah" aria-label="Profile: rshah">@<bdi>rshah</bdi></a> said in <a href="/post/18130">Event Detector - get point by XID</a>:</p>
<blockquote>
<p dir="auto">Is it in the development plan to introduce something which would allow us to get the value of an event detector similar to how we get the value of a point?</p>
</blockquote>
<p dir="auto">Its something I can look at making easier for sure. One thing to clarify is that an event detector does not have a value, it generates events which are active initially and can then become inactive. This is a completely different mechanism to point values.</p>
<p dir="auto">It sounds like you should setup a meta data source and follow <a class="plugin-mentions-user plugin-mentions-a" href="/user/phildunlap" aria-label="Profile: phildunlap">@<bdi>phildunlap</bdi></a> 's advise above for the meantime.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/rshah" aria-label="Profile: rshah">@<bdi>rshah</bdi></a> said in <a href="/post/18130">Event Detector - get point by XID</a>:</p>
<blockquote>
<p dir="auto">It looks like the component you wrote above actually does just that, except I'm not sure how it deals with multiple events for one point-- haven't tried it yet.<br />
Do we have to use promises? Or can we use async/await?</p>
</blockquote>
<p dir="auto">Its not a component, its a snippet of javascript, and it doesn't deal with anything. Its just returning an array of events for you to use as you please.</p>
<p dir="auto">Any code you put in the user module will run in the browser so check browser compatibility tables to see if you can use async/await.</p>
]]></description><link>https://forum.mango-os.com/post/18132</link><guid isPermaLink="true">https://forum.mango-os.com/post/18132</guid><dc:creator><![CDATA[Jared Wiltshire]]></dc:creator><pubDate>Mon, 23 Apr 2018 18:06:46 GMT</pubDate></item><item><title><![CDATA[Reply to Event Detector - get point by XID on Mon, 23 Apr 2018 17:35:15 GMT]]></title><description><![CDATA[<p dir="auto">Thank you, <a class="plugin-mentions-user plugin-mentions-a" href="/user/jared-wiltshire" aria-label="Profile: Jared-Wiltshire">@<bdi>Jared-Wiltshire</bdi></a> .</p>
<p dir="auto">Is it in the development plan to introduce something which would allow us to get the value of an event detector similar to how we get the value of a point?</p>
<p dir="auto">I see that event-detectors already have their own XID, so a way to get a binary 1 / 0 from that XID with something like <code>&lt;ma-point-values point-xid="eventDetectorXID"&gt;&lt;/ma-point-values&gt;</code>  would be great.</p>
<p dir="auto">Although I'm not sure how technically difficult it would be, or if it is even a good solution.</p>
<p dir="auto">It looks like the component you wrote above actually does just that, except I'm not sure how it deals with multiple events for one point-- haven't tried it yet.</p>
<p dir="auto">Do we have to use promises? Or can we use async/await?</p>
]]></description><link>https://forum.mango-os.com/post/18130</link><guid isPermaLink="true">https://forum.mango-os.com/post/18130</guid><dc:creator><![CDATA[rshah]]></dc:creator><pubDate>Mon, 23 Apr 2018 17:35:15 GMT</pubDate></item><item><title><![CDATA[Reply to Event Detector - get point by XID on Mon, 23 Apr 2018 16:22:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/rshah" aria-label="Profile: rshah">@<bdi>rshah</bdi></a> said in <a href="/post/18112">Event Detector - get point by XID</a>:</p>
<blockquote>
<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> said in <a href="/post/18110">Event Detector - get point by XID</a>:</p>
<blockquote>
<p dir="auto">An XID of an event detector is completely separate to that of a data point. They are not interchangeable.</p>
</blockquote>
<p dir="auto">Hi,</p>
<p dir="auto">yes we are trying to see if a certain event is active or not and based on that change the style of a div on our dashboard.</p>
</blockquote>
<p dir="auto">There is no support for this built into the components just yet. Please see <a class="plugin-mentions-user plugin-mentions-a" href="/user/phildunlap" aria-label="Profile: phildunlap">@<bdi>phildunlap</bdi></a> 's answer.</p>
<p dir="auto">You could write your own component and put it in the <a href="https://help.infiniteautomation.com/getting-started-with-a-user-module/" rel="nofollow ugc">user module</a>. To get events for a data point you would use the maEvents service using code like this</p>
<pre><code>maEvents.buildQuery()
        .eq('dataPointId', 123)
        .eq('active', true)
        .query().then(result =&gt; {
            // do something with events
        });
</code></pre>
]]></description><link>https://forum.mango-os.com/post/18129</link><guid isPermaLink="true">https://forum.mango-os.com/post/18129</guid><dc:creator><![CDATA[Jared Wiltshire]]></dc:creator><pubDate>Mon, 23 Apr 2018 16:22:41 GMT</pubDate></item><item><title><![CDATA[Reply to Event Detector - get point by XID on Mon, 23 Apr 2018 14:42:20 GMT]]></title><description><![CDATA[<p dir="auto">Hi rshah,</p>
<p dir="auto">You may find this thread interesting: <a href="https://forum.infiniteautomation.com/topic/3368/how-to-include-an-event-detector-value-into-a-function" rel="nofollow ugc">https://forum.infiniteautomation.com/topic/3368/how-to-include-an-event-detector-value-into-a-function</a></p>
<p dir="auto">So you could do something similar, and store the resulting aggregate value into a point for use on the dashboard.</p>
<p dir="auto">If it's only one point though, you can have a set point handler set a binary true / false on the active / inactive actions.</p>
]]></description><link>https://forum.mango-os.com/post/18124</link><guid isPermaLink="true">https://forum.mango-os.com/post/18124</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Mon, 23 Apr 2018 14:42:20 GMT</pubDate></item><item><title><![CDATA[Reply to Event Detector - get point by XID on Fri, 20 Apr 2018 20:10:02 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> said in <a href="/post/18110">Event Detector - get point by XID</a>:</p>
<blockquote>
<p dir="auto">An XID of an event detector is completely separate to that of a data point. They are not interchangeable.</p>
</blockquote>
<p dir="auto">Hi,</p>
<p dir="auto">yes we are trying to see if a certain event is active or not and based on that change the style of a div on our dashboard.</p>
]]></description><link>https://forum.mango-os.com/post/18112</link><guid isPermaLink="true">https://forum.mango-os.com/post/18112</guid><dc:creator><![CDATA[rshah]]></dc:creator><pubDate>Fri, 20 Apr 2018 20:10:02 GMT</pubDate></item><item><title><![CDATA[Reply to Event Detector - get point by XID on Fri, 20 Apr 2018 19:47:50 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/rshah" aria-label="Profile: rshah">@<bdi>rshah</bdi></a> said in <a href="/post/18100">Event Detector - get point by XID</a>:</p>
<blockquote>
<p dir="auto">Is it possible to get the value of event detectors (I assume they return a binary 0 or 1) by XID?</p>
</blockquote>
<p dir="auto">Event detectors do not have a value. I assume you are trying to ascertain if an event is active or not?</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/rshah" aria-label="Profile: rshah">@<bdi>rshah</bdi></a> said in <a href="/post/18100">Event Detector - get point by XID</a>:</p>
<blockquote>
<p dir="auto">I tried ma-get-point for the XID of the event detector and it looks like it just returns an empty object.</p>
</blockquote>
<p dir="auto">An XID of an event detector is completely separate to that of a data point. They are not interchangeable.</p>
]]></description><link>https://forum.mango-os.com/post/18110</link><guid isPermaLink="true">https://forum.mango-os.com/post/18110</guid><dc:creator><![CDATA[Jared Wiltshire]]></dc:creator><pubDate>Fri, 20 Apr 2018 19:47:50 GMT</pubDate></item></channel></rss>