Hello,

We have in our office a wall of Monitoring Screens displaying Maps for our Monitoring Staff and Management.

I currently have setup the Status and Audible Alarm (if Alarms > 0) Object, but it seems this object doesn't wait any period of time before playing the alarm, and we just had a Ping Sensor go down for about 45 seconds, sudden spike in traffic.

The sensor returned to normal 5 seconds later, so the alarm was useless in this situation.

Is there any way to maybe go and add a wait for so many seconds before playing alarm? - Most likely assuming I will have to write my own Object for this.


Article Comments

Hello Evan,

Thank you very much for your knowledge base post.

The audible alarm is been triggered as soon as there is an Error on the map. There is no way of extending the time period or to set-up, that the audible signal is been triggered first after a second refresh of the page, I'm sorry.

Best,
Sebastian


Feb, 2017 - Permalink

It is possible,
Simply edit from the follow code, where mine is set to 30000ms = 30 seconds, default alarm object is set to 2000ms = 2 seconds.

if (errors > 0) {
		setTimeout(playalarm, 30000);
} 

Full Custom Object Code:

<!--Added Objects: Status and Delayed Audible Alert-->

<div class="map_object map_icon <#sensor type="colorclassofstate" prefix="map_iconcolor_" id="<@objectid>">" id="<@itemid>" objectid="<@objectid>" subid="<@subid>" style="<#mapobject type="topleftcoordinates" subid="<@subid>" mode="<@editmode>">">
<#mapobject type="objectgrip" mode="<@editmode>">
<#mapobject type="htmlbefore" subid="<@subid>">
  <span>
    <#objectstatus name="partialdownsens" id="<@objectid>">
    <#objectstatus name="downacksens"  id="<@objectid>">
    <#objectstatus name="warnsens" id="<@objectid>">
    <#objectstatus name="downsens"  id="<@objectid>">
    <#objectstatus name="upsens" id="<@objectid>">
    <#objectstatus name="pausedsens" id="<@objectid>">
    <#objectstatus name="unusualsens" id="<@objectid>">
    <#objectstatus name="undefinedsens" id="<@objectid>">
  </span>
<div id="alarmsound"></div>
<script type="text/javascript">

  function playalarm() {
    if($('#audiblealarm').length <= 0) {
      $("#alarmsound").empty().append('<audio id="audiblealarm"><source src="/sounds/beep.ogg" type="audio/ogg" /><source src="/sounds/beep.mp3" type="audio/mpeg3" /></audio>');
    }
    var audiblealarm = document.getElementById("audiblealarm");
    audiblealarm.load();
    audiblealarm.play();
  };

  var errors1="<#objectstatus name="downsens" id="<@objectid>" show="textraw">";
  var errors2="<#objectstatus name="partialdownsens" id="<@objectid>" show="textraw">";
  var errors=errors1*1.0+errors2*1.0;

	if (errors > 0) {
		setTimeout(playalarm, 30000);
	}
</script>
<#mapobject type="htmlafter" subid="<@subid>">
</div>

Feb, 2017 - Permalink

Hi Evan,

Thank you very much for your contribution. Honestly, I was not aware of that method. Thank you for submitting the corresponding code. I'm sure other customers will appreciate this.

Best,
Sebastian


Feb, 2017 - Permalink