Custom Widget: Camera History and Live Popup

Tags: #<Tag:0x00007f616f9a6aa0> #<Tag:0x00007f616f9a61e0>

This Widget is very hard to explain what it does as it is designed to take up not much space in a Panel and give lots of features. Hopefully the picture explains it more clearly than my writing.

It can be used to:

  1. Auto popup (modal) a live view of the camera when an item triggers the view to open. Auto closes back to your Habpanel when the trigger turns off. You can choose to popup the video only over the widget if your don’t want the whole screen taken over.
  2. Gives you a history of recent recordings, indicated by the red dot and number. Update to the latest ipCamera binding for all the new features that allow this to work. You can manually create the history with rules if you wish as it is just comma separated values (CSV).
  3. Allows you to clear the history without deleting the files so you can keep track of the recordings you have not yet had time to review.
  4. The history feature supports GIF or MP4 with gif being the more compatible. You can change the play back speed to get an idea faster of what the camera has captured with gif. MP4 is higher frame rate, supports audio and can be paused.


Camera-History.widget.json (6.5 KB)

Some example rules for using with the ipCamera binding and this widget will then have a history of the recordings tracked by the new channels the binding just got…


rule "Auto Front doorbell"
	Item Doorbell_PIRAlarm changed to ON
		Doorbell_MP4Filename.sendCommand(new DateTimeType().toString ) //Use the current time as the filename.
		Doorbell_RecordMP4.sendCommand(5)//Record mp4 for 5 seconds

rule "Doorbell Mp4 recording done"
	Item Doorbell_RecordMP4 changed to 0
	var TimeStamp = Doorbell_MP4Filename.state
    logInfo("Doorbell.rules", "Mp4 recording "+ TimeStamp.toString +".mp4 is ready to be used.")
//You could use the Telegram API to send this Mp4 recording to your phone.


Switch Doorbell_PIRAlarm "PIR Motion" { channel="ipcamera:ONVIF:Doorbell:cellMotionAlarm" }
String Doorbell_MP4Filename "MP4 Filename" { channel="ipcamera:ONVIF:Doorbell:mp4Filename" }
Number Doorbell_RecordMP4 "MP4 Record" { channel="ipcamera:ONVIF:Doorbell:recordMp4" }
String Doorbell_MP4History "MP4 History" { channel="ipcamera:ONVIF:Doorbell:mp4History" }
Number Doorbell_MP4HistoryLength "MP4 History Length" { channel="ipcamera:ONVIF:Doorbell:mp4HistoryLength" }