<?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[Bulk Event Detection Creation]]></title><description><![CDATA[<p dir="auto">We're deploying a new system and the data source has about 1,800 fault bits (200 in each subsystem and 9 subsystems).</p>
<p dir="auto">There are binary status bits that indicate faults or alarms of a subsystem. Creating the data points has been relatively automated through the CSV uploader, however, we cannot seem to find a method to automate the creation of level based event detection on each of these bits.</p>
<p dir="auto">Does anyone have suggestions or thoughts on how we could automate the creation of these event detectors?</p>
]]></description><link>https://forum.mango-os.com/topic/4415/bulk-event-detection-creation</link><generator>RSS for Node</generator><lastBuildDate>Wed, 10 Jun 2026 10:01:07 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/4415.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 22 Aug 2019 19:57:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Bulk Event Detection Creation on Mon, 26 Aug 2019 15:35:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chio" aria-label="Profile: chio">@<bdi>chio</bdi></a> That is a Python error, its not something coming from Mango. Without seeing the actual JSON reply from Mango I can't tell you much.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chio" aria-label="Profile: chio">@<bdi>chio</bdi></a> said in <a href="/post/23291">Bulk Event Detection Creation</a>:</p>
<blockquote>
<p dir="auto">Can you confirm the 'state' parameter should be set to the value that will trigger the event?</p>
</blockquote>
<p dir="auto">The state property is the integer value of the multistate state to detect.</p>
]]></description><link>https://forum.mango-os.com/post/23320</link><guid isPermaLink="true">https://forum.mango-os.com/post/23320</guid><dc:creator><![CDATA[Jared Wiltshire]]></dc:creator><pubDate>Mon, 26 Aug 2019 15:35:59 GMT</pubDate></item><item><title><![CDATA[Reply to Bulk Event Detection Creation on Sat, 24 Aug 2019 14:00:20 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/23286">Bulk Event Detection Creation</a>:</p>
<p dir="auto">when i try to use <code>/rest/v2-full-event-detectors</code> i get the below error</p>
<pre><code>raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
</code></pre>
<p dir="auto">however, <code>event-dectors</code>  still works.  Can you confirm the 'state' parameter should be set to the value that will trigger the event?</p>
]]></description><link>https://forum.mango-os.com/post/23291</link><guid isPermaLink="true">https://forum.mango-os.com/post/23291</guid><dc:creator><![CDATA[chio]]></dc:creator><pubDate>Sat, 24 Aug 2019 14:00:20 GMT</pubDate></item><item><title><![CDATA[Reply to Bulk Event Detection Creation on Fri, 23 Aug 2019 21:24:51 GMT]]></title><description><![CDATA[<p dir="auto">OK, use <code>/rest/v2/full-event-detectors</code> instead, this API is newer and allows you to link handlers to the event detector in one hit (set the <code>handlerXids</code> property to an array of handler XIDs, if it is null it will not update the linked handlers).</p>
<p dir="auto">Now onto your main question, you will have to link the event detector to the data point <strong>id</strong>. You set the <code>sourceId</code> property to the data point's <code>id</code>. I know this is weird, it really shouldn't be like this as everything else uses xids, I will try and get this changed.</p>
<p dir="auto">The JSON to POST to the endpoint will look like</p>
<pre><code>{
    "detectorType" : "MULTISTATE_STATE",
    "sourceId" : 995,
    "rtnApplicable" : true,
    "alarmLevel" : "CRITICAL",
    "sourceTypeName" : "DATA_POINT",
    "handlerXids" : [ ],
    "duration" : {
      "periods" : 5,
      "type" : "MINUTES"
    },
    "state" : 5,
    "detectorType" : "MULTISTATE_STATE",
    "name" : "PCS3 Has Faulted"
}
</code></pre>
]]></description><link>https://forum.mango-os.com/post/23286</link><guid isPermaLink="true">https://forum.mango-os.com/post/23286</guid><dc:creator><![CDATA[Jared Wiltshire]]></dc:creator><pubDate>Fri, 23 Aug 2019 21:24:51 GMT</pubDate></item><item><title><![CDATA[Reply to Bulk Event Detection Creation on Fri, 23 Aug 2019 20:56:07 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> do you have a data structure for creating an event detector? We're connected through the API and have been able to Get the existing even-detectors to look for a model as Swagger doesn't have a lot of information for POST  /v2/event-detectors</p>
<p dir="auto">Here is the response we get from /v2/event-detectors/data-point/{xid}</p>
<pre><code>[
  {
    "xid": "ED_e7f4ceb7-baca-4842-b22c-897a4e2d87fe",
    "name": "PCS3 Has Faulted",
    "duration": 5,
    "durationType": "MINUTES",
    "alarmLevel": "CRITICAL",
    "supportedDataTypes": [
      "MULTISTATE"
    ],
    "handlers": [
      "EH_43fde3cf-1c12-483b-820c-9392c38f114e"
    ],
    "description": "PCS3 Has Faulted",
    "eventType": {
      "dataSourceId": 2,
      "dataPointId": 995,
      "pointEventDetectorId": 110,
      "duplicateHandling": "IGNORE",
      "rateLimited": false,
      "typeName": "DATA_POINT"
    },
    "sourceId": 995,
    "rtnApplicable": true,
    "detectorSourceType": "DATA_POINT",
    "validationMessages": [],
    "detectorType": "MULTISTATE_STATE",
    "id": 110
  }
]
</code></pre>
<p dir="auto">What  i dont see from the return of the GET is how we set the XID of the data point and the level. For example the above is set by a data point on value 8. Im not seeing in the return the XID of the datapoint that triggers this event detector or to look for value 8.</p>
<p dir="auto">What are we missing?</p>
]]></description><link>https://forum.mango-os.com/post/23282</link><guid isPermaLink="true">https://forum.mango-os.com/post/23282</guid><dc:creator><![CDATA[chio]]></dc:creator><pubDate>Fri, 23 Aug 2019 20:56:07 GMT</pubDate></item><item><title><![CDATA[Reply to Bulk Event Detection Creation on Fri, 23 Aug 2019 15:38:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chio" aria-label="Profile: chio">@<bdi>chio</bdi></a> You could also use your favorite scripting language to create the event detectors via the REST API.</p>
]]></description><link>https://forum.mango-os.com/post/23278</link><guid isPermaLink="true">https://forum.mango-os.com/post/23278</guid><dc:creator><![CDATA[Jared Wiltshire]]></dc:creator><pubDate>Fri, 23 Aug 2019 15:38:05 GMT</pubDate></item><item><title><![CDATA[Reply to Bulk Event Detection Creation on Fri, 23 Aug 2019 12:35:14 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for these thoughts. We're review the JSON idea and Phili's last script.</p>
<p dir="auto">Our other thought was to use the real time values every x seconds through API and check if type = binary and name contains "fault" then do some task... this would be outside of Mango though so its not 100% desired but could be a scaleable work around.</p>
]]></description><link>https://forum.mango-os.com/post/23277</link><guid isPermaLink="true">https://forum.mango-os.com/post/23277</guid><dc:creator><![CDATA[chio]]></dc:creator><pubDate>Fri, 23 Aug 2019 12:35:14 GMT</pubDate></item><item><title><![CDATA[Reply to Bulk Event Detection Creation on Fri, 23 Aug 2019 00:07:36 GMT]]></title><description><![CDATA[<p dir="auto">This thread was my last go at simplest mass event detector creation, by leveraging watchlists: <a href="https://forum.infiniteautomation.com/topic/3708/a-script-jsonemport-example" rel="nofollow ugc">https://forum.infiniteautomation.com/topic/3708/a-script-jsonemport-example</a></p>
]]></description><link>https://forum.mango-os.com/post/23264</link><guid isPermaLink="true">https://forum.mango-os.com/post/23264</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Fri, 23 Aug 2019 00:07:36 GMT</pubDate></item><item><title><![CDATA[Reply to Bulk Event Detection Creation on Thu, 22 Aug 2019 21:48:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chio" aria-label="Profile: chio">@<bdi>chio</bdi></a> This is one area which is lacking at the moment, we have been discussing this recently in fact. We will probably be adding the ability to import / export the event detectors via CSV soon.</p>
<p dir="auto">In the meantime, the easiest way to bulk edit them would be to use the JSON import/export (Under Administration - Home - Configuration import/export). Use a script or tool to modify the JSON and re-import.</p>
]]></description><link>https://forum.mango-os.com/post/23263</link><guid isPermaLink="true">https://forum.mango-os.com/post/23263</guid><dc:creator><![CDATA[Jared Wiltshire]]></dc:creator><pubDate>Thu, 22 Aug 2019 21:48:12 GMT</pubDate></item><item><title><![CDATA[Reply to Bulk Event Detection Creation on Thu, 22 Aug 2019 20:09:54 GMT]]></title><description><![CDATA[<p dir="auto">Without writing your own component it will be difficult IMO.<br />
Iterate through each point,  create it, then use the event detector API to attach the required alarms to that newly created point. Rinse and repeat....</p>
<p dir="auto">Seeing how the CSV can be imported into the API you can still make your own CSV uploader then send one line at a time, so the callback gives you the info you need to make your detectors.</p>
<p dir="auto">Phil/Jared will likely be able to expand on this or provide a better solution.</p>
]]></description><link>https://forum.mango-os.com/post/23262</link><guid isPermaLink="true">https://forum.mango-os.com/post/23262</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Thu, 22 Aug 2019 20:09:54 GMT</pubDate></item></channel></rss>