Popup window with camera feed when motion is detected and auto close after time or item state OFF

Hi,
I would like to make widget that would popup when a Switch MotionAlarmON is set to ON and it autocloses when Switch MotionAlarmON sets to OFF or a specifit amount of time will pass.
I guess this needs some play with [HABPanel Development & Advanced Features: Start Here!], however i have no Idea how to implement autoclose. Is there anybody who maybe already have implemented this kind of popup window?
I’ve used some example for carousel

<script type="text/ng-template" id="myModalContent.html">
  <div class="container" style="padding: 30px; border: 1px solid #456;">
    <a ng-click="$close()" class="pull-right btn btn-danger">X</a>
    <h3 style="color: white">Motion has been detected!</h3>
			<div style="height: 610px">
  			<div uib-carousel active="0" interval="5000" no-wrap="false">
    			<div uib-slide index="0">
      			<img src="http://192.168.1.181:54320/ipcamera.mjpeg" style="margin:auto;"/>
   	 			</div>
    		</div>
  		</div>
  </div>   
</script>
<button class="btn btn-default btn-lg"
        ng-click="openModal('myModalContent.html', true, 'lg')">
  Open Modal
</button>

I have this working and will be releasing a widget for it shortly after I tidy it up with a few extra features.

3 Likes

Would be very interested to use it.

You can find it here and in the widget gallery of habpanel.

1 Like