HomeSeer Message Board

HomeSeer Message Board (http://board.homeseer.com/index.php)
-   HS3 / HS3PRO Discussion (http://board.homeseer.com/forumdisplay.php?f=1172)
-   -   DoorBird Beta Plugin Release (http://board.homeseer.com/showthread.php?t=182629)

mrhappy July 9th, 2016 05:51 AM

DoorBird Plugin for HS3 - Release
 
All,

Following on from http://forums.homeseer.com/showthread.php?t=181427 I have written a plugin for the DoorBird doorbell units (https://www.doorbird.com/).

The plugin has been tested by some and appears to work, it is reasonably simple and will exploit most of the available commands from the LAN API.

It is beta so any issues/concerns/suggestions please post them to this thread and I will try and resolve, please read the documentation however.

The plugin is and always will be FREE, however if you do wish to donate you are more than welcome to (absolutely no obligation to do so) - if only so I can buy more HA related stuff :) - Donation Link - https://www.paypal.me/krang

Plugin is now in the updater

Documentation & Release Notes: Link

AndroidDev01 July 9th, 2016 08:23 AM

Quote:

Originally Posted by mrhappy (Post 1254009)
All,

Following on from http://forums.homeseer.com/showthread.php?t=181427 I have written a BETA plugin for the DoorBird doorbell units (https://www.doorbird.com/).

The plugin has been tested by some and appears to work, it is reasonably simple and will exploit most of the available commands from the LAN API.

The plugin is a simple installation and is not available through the updater, download the zip file in this post and place it in the HS directory. It has been briefly tested on Linux (via a VM) so should work there.

It is beta so any issues/concerns/suggestions please post them to this thread and I will try and resolve, please read the documentation however.

The plugin will be free but it will be opened up for donation in due course if anyone wishes to do so.

Thank you!

Sent from my moto x

reidfo July 9th, 2016 11:01 AM

Wonderful! Thanks for developing this. I've been considering purchasing a Doorbird and think I'll go ahead and do it now. Will this plugin run on Linux?

mrhappy July 9th, 2016 11:41 AM

Quote:

Originally Posted by reidfo (Post 1254051)
Wonderful! Thanks for developing this. I've been considering purchasing a Doorbird and think I'll go ahead and do it now. Will this plugin run on Linux?

I've tested it on an Ubuntu VM and it looks to work fine, I don't have anything else to test it on like a Zee or anything but I can't see it not working on that if it works on Ubuntu.

Duc998 July 9th, 2016 09:00 PM

awesome works great already setup an event to pulse the lifx light bulbs and speak Someones at the door. Plan to setup speak to Amazon Echo via Bluetooth.

Many thanks mate where do I donate?

mrhappy July 10th, 2016 03:43 AM

Quote:

Originally Posted by Duc998 (Post 1254143)
awesome works great already setup an event to pulse the lifx light bulbs and speak Someones at the door. Plan to setup speak to Amazon Echo via Bluetooth.

Many thanks mate where do I donate?

I've put the donation link in the first post and thanks for the feedback - please let me know if you have any issues/ideas for the plugin.

skarragallagher July 10th, 2016 11:07 PM

Nice, thanks for this!

Eman July 13th, 2016 02:08 PM

KODI Integration
 
Hi mrhappy,

Before I get excited, can you please add the option to integrate with Spud's Kodi plugin like this here :http://forums.homeseer.com/showthread.php?p=1213403 It would be nice to add an extra setting to choose the Kodi IP address/addresses on the network. Imagine that!:cool:
Shouldn't everything got to be inter connected or seamless in HomeSeer? :D

And on another note, here http://www.htpcbeginner.com/kodi-sec...ance-software/ is the link with extra scripts for more cameras.



Eman.

skarragallagher July 13th, 2016 02:25 PM

Honestly what your asking for is out side of the scope of the plugin and already possible. I use Kodi and the securitycam overlay to show cameras from BlueIris.

From what I understand the you can integrate the feed from the camera with blue iris or any other NVR and using events trigger that add-on and pass a parameter to show that specific camera based on a trigger from the plugin.

Basically it's all there already

mrhappy July 13th, 2016 02:29 PM

Quote:

Originally Posted by Eman (Post 1254693)
Hi mrhappy,

Before I get excited, can you please add the option to integrate with Spud's Kodi plugin like this here :http://forums.homeseer.com/showthread.php?p=1213403 It would be nice to add an extra setting to choose the Kodi IP address/addresses on the network. Imagine that!:cool:
Shouldn't everything got to be inter connected or seamless in HomeSeer? :D

And on another note, here http://www.htpcbeginner.com/kodi-sec...ance-software/ is the link with extra scripts for more cameras.



Eman.

I'm sorry but I am not going to add specific options for specific plugins. Inter-connectivity is what the HomeSeer application is for, making calls between plugins means I have to contact authors, come to agreements over how data is exchanged, be wary in my plugin when I make changes to determine if it breaks anything else (and yes I have been here before) etc. I also don't own the plugin in question and would have to buy it.

Providing you can link to a static image from Kodi (which I imagine you can) then the functionality already exists in the plugin, when you download an image from the device it will sit in the HS HTML directory and you can link Kodi to this image and it should display.

Edit: Beaten to it with the same information!

Pete July 13th, 2016 04:15 PM

Relating to KODI wrote about a custom IP Camera script over on Cocoontech in 2014 for XBMC ==>

XBMC Security Cam Overlay Script

It will need a bit of adjustments for current KODI.

Just tested a new IP camera script that works with RTSP and MJPEG just fine.

IE using Zoneminder.
RTSP==> rtsp://www.xxx.yyy.zzz/4?tcp
MJPEG ==> hxxp://www.xxx.yyy.zzz/zm/?view=watch&mid=5

It is located here:

IPCam

You can just download the script zip file and install it, configure it using RTSP in about 5 minutes.

For multiple cameras just change the name of the IP camera in the configuration and the name of the zip file to match your camera.

Eman July 13th, 2016 06:22 PM

Quote:

Originally Posted by Pete (Post 1254713)
Relating to KODI wrote about a custom IP Camera script over on Cocoontech in 2014 for XBMC ==>

XBMC Security Cam Overlay Script

It will need a bit of adjustments for current KODI.

Just tested a new IP camera script that works with RTSP and MJPEG just fine.

IE using Zoneminder.
RTSP==> rtsp://www.xxx.yyy.zzz/4?tcp
MJPEG ==> hxxp://www.xxx.yyy.zzz/zm/?view=watch&mid=5

It is located here:

IPCam

You can just download the script zip file and install it, configure it using RTSP in about 5 minutes.

For multiple cameras just change the name of the IP camera in the configuration and the name of the zip file to match your camera.


Nice one Pete,

I think it's the same script discused about here :http://forum.kodi.tv/showthread.php?tid=182540.
It's been kept alive (recycled) over the years. Credits still go to you.


Eman.

Eman July 13th, 2016 06:52 PM

Quote:

Originally Posted by mrhappy (Post 1254699)
I'm sorry but I am not going to add specific options for specific plugins. Inter-connectivity is what the HomeSeer application is for, making calls between plugins means I have to contact authors, come to agreements over how data is exchanged, be wary in my plugin when I make changes to determine if it breaks anything else (and yes I have been here before) etc. I also don't own the plugin in question and would have to buy it.

Providing you can link to a static image from Kodi (which I imagine you can) then the functionality already exists in the plugin, when you download an image from the device it will sit in the HS HTML directory and you can link Kodi to this image and it should display.

Edit: Beaten to it with the same information!


The only reason I asked is I saw this "The DoorBird unit will only allow one connection at a time to the API" in the help file and I though that may be your plugin takes sole control of the device. I'm still waiting for the device to come and test. If it can still send video/image to other devices and at the same time connected to the plugin then that's a plus because that's how I view the image in Kodi. So with you events/device change I can invoke the Kodi plugin to show the video. Cool.



Eman.

Pete July 13th, 2016 07:03 PM

Yup; the IPCam script mentioned is much simpler to configure than the overlay script.

You just have to enter a link for your camera. With RTSP you can stream a variety of resolutions.

skarragallagher July 13th, 2016 07:31 PM

I'll have to check that script out,

mrhappy July 14th, 2016 02:27 PM

Quote:

Originally Posted by Eman (Post 1254733)
The only reason I asked is I saw this "The DoorBird unit will only allow one connection at a time to the API" in the help file and I though that may be your plugin takes sole control of the device. I'm still waiting for the device to come and test. If it can still send video/image to other devices and at the same time connected to the plugin then that's a plus because that's how I view the image in Kodi. So with you events/device change I can invoke the Kodi plugin to show the video. Cool.



Eman.

This is what the API says:

Quote:

The device handles via this third-party API a maximum of 1 concurrent connection per second for API access.

Please keep in mind that the device is a door intercom unit, which handles in general - like all commercially relevant door stations - only one simultaneous audio/video call for live communication. You get a status code "503" (Busy) if another user already took the call. In that case you can notify the user with a message dialog on your GUI, e.g. "Line busy" and additionally preview one still image (LIVE IMAGE REQUEST).
That to me says that you cannot have two concurrent video feeds running at the same time, I sense this is probably network related or processor related (or both) as it is a HD video feed. I will do some testing but the grabbing of the image takes a second and then closes the connection, I don't see a real issue with it in practice I just don't want people starting numerous video feeds off.

mrhappy July 22nd, 2016 01:53 PM

The following is some basic ideas and instructions on how to record video from the DoorBird unit using FFMPEG. This is realistically if you do not use the cloud service from DoorBird or a server like BlueIris and just want a simple solution to grab a video clip.

Note: I do not know whether or not the script will work OK on Linux, it should in theory but don't know in practice.

I have decided against embedding this as part of the plugin because;

1) The .net wrappers for FFMPEG like NReco.VideoConverter do not appear to play nicely with live video streams and have limited documentation unless I pay for support.
2) I do not want to tie the plugin down with video recording and have any ability for it to get caught with a stream running and filling someones hard drive.
3) Different codecs, would potentially end up distributing codecs which brings additional issues concerning any sort of licencing
4) The infinitely different possibilities that FFMPEG has that would be difficult to add to a plugin, adding text, different codecs, audio streams, resolutions - etc. Different people want different things...

Instructions:

1) Download FFMPEG (https://ffmpeg.org/download.html)
2) Find a directory to suit (I would suggest a separate one, I use a 8GB SSD just for this purpose), place ffmpeg.exe in this directory.
3) Save the attached script into your HS scripts directory, you will need to amend the following fields to suit your setup;
  • Username
  • Password
  • IP Address
  • Path to FFMPEG
  • Duration of clip
  • Filename prefix or similar
4) Run the script when you wish to do so, be careful about launching multiple copies of the script so I would suggest setting the event to not re-trigger at a reasonable interval.

Script:

Code:

Imports System.Text

Dim LT As String = "CameraRecorder"
Dim CameraUsername As String = "username"
Dim CameraPassword As String = "password"
Dim CameraIP As String = "192.168.1.8" 'set to the doorbird IP address
Dim URLString As String = "" 'leave this at nothing
Dim OverWrite As Boolean = True 'if set to true then the file (if one exists with the same name) will be overwritten
Dim Duration As Byte = 30 'duration of video clip in seconds
Dim PathToFFMPEG As String

Sub Main(ByVal Parms As Object)

    Try
        Dim CLIArgs As New StringBuilder
               
        PathToFFMPEG = "E:\" 'this is the video storage path and the path to FFMPEG

        Dim FileName As String = "FrontDoor_" & Date.Now.ToString("ddMMyy_HHmmss") & ".avi"

        hs.writelog(LT, "Recorder Script Started")

        URLString = "http://" & CameraUsername & ":" & CameraPassword & "@" & CameraIP & "/bha-api/video.cgi"

        CLIArgs.Append("-f mjpeg -r 10")
        CLIArgs.Append(" -i " & URLString) 'input string
        CLIArgs.Append(" -vcodec mpeg4") 'sets the output codec to MPEG4 - possibly the best
        CLIArgs.Append(" -b 1000000")
        CLIArgs.Append(" -r 10") 'sets the frame rate to 10 fps               
        CLIArgs.Append(" " & FileName)

        If OverWrite = True Then CLIArgs.Append(" -y")

        hs.launch(PathToFFMPEG & "ffmpeg.exe", CLIArgs.ToString, PathToFFMPEG, 0)

        hs.WaitSecs(Duration)

        hs.keys("^c", PathToFFMPEG & "ffmpeg.exe", True)
        hs.keys("q", PathToFFMPEG & "ffmpeg.exe", True) 'sending both of these is a bit of a failsafe, it should only need one

        If System.IO.File.Exists(PathToFFMPEG & FileName) Then hs.writelog(LT, "File Created") Else hs.writelog(LT, "Error: File Not Created")

    Catch ex As Exception : hs.writelog(LT, "Exception: " & ex.message)
    End Try

End Sub


Eman July 25th, 2016 06:58 PM

Connection error!
 
1 Attachment(s)
Hi mrhappy,

It's not possible to configer the plugin on a remote machine! It even creates aghost root device.

This is the log :
Jul-25 23:40:30 DoorBird Error Connecting To DoorBird - Not Registering Events
Jul-25 23:40:30 DoorBird DoorBird Web Exception: Unable to connect to the remote server


Please see attached image.

mrhappy July 26th, 2016 12:31 AM

Quote:

Originally Posted by Eman (Post 1256435)
Hi mrhappy,

It's not possible to configer the plugin on a remote machine! It even creates aghost root device.

This is the log :
Jul-25 23:40:30 DoorBird Error Connecting To DoorBird - Not Registering Events
Jul-25 23:40:30 DoorBird DoorBird Web Exception: Unable to connect to the remote server


Please see attached image.

It is possible because all my development is on a remote machine, the error suggests the plugin cannot connect to the DoorBird. Can you on the remote PC please check that you can browse http://192.168.1.8/ (changing your IP to the DoorBird IP as appropriate), it should load a simple page. It can be a firewall issue that is blocking the connection.

That ghost device has plagued me, I've been over the code many times and cannot see why it is created, it has a very subtle difference in the check box next to it is formatted slightly differently and I have no idea why. I will check again.

skarragallagher July 26th, 2016 12:44 AM

Any one with a unit able to test wether you can access a stream with a NVR like blue iris ACS access with this plugin?


All times are GMT -4. The time now is 07:14 PM.


Copyright HomeSeer Technologies, LLC