Announcement

Collapse
No announcement yet.

DoorBird Beta Plugin Release

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Originally posted by Eman View Post
    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:

    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.

    Comment


      #17
      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

      Comment


        #18
        Connection error!

        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.
        Attached Files
        TinkerLand : Life's Choices,"No One Size Fits All"

        Comment


          #19
          Originally posted by Eman View Post
          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.

          Comment


            #20
            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?

            Comment


              #21
              Originally posted by mrhappy View Post
              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.

              It's true the plugin does not invoke the firewall for communication. I have already manually added the HSPI_DOORBIRD3P to the list of applications.

              You also get this in the log : ~!~DoorBird~!~No Manual IP Found In INI File
              But when I checked the INI file, it's got 6 divice refs and Doorbird IP and the funny part is Doorbird during logging attracts HomeSeer web server port. And it's a vicious attraction, no matter how much you delete. It keeps coming back. This is partly due Doorbird not having fixed IP in the settings. The only problem is I can't test locally on the server.

              So I tried FFMPEG url :"http://" & CameraUsername & ":" & CameraPassword & "@" & CameraIP & "/bha-api/video.cgi" you posted earlier. I get live video when using the Kodi plugin (IP Cam) and in a browser.

              That said, is this the new normal that DOORBIRD people don't let you change the camera settings as you wish like other manufacturers? They even have another setting in there when you change the password, you have to email it to them in case you forget it Can they log in any time they wish?



              Eman.
              Last edited by Eman; July 26, 2016, 04:23 AM.
              TinkerLand : Life's Choices,"No One Size Fits All"

              Comment


                #22
                INI file

                Hi mrhappy,

                Although this plugin here :http://board.homeseer.com/showthread...17#post1132517 bares similarities to your kind of install. It does contain an INI file during intallation. The INI is already edited but the author states that you are free delete things you don't need. I'm just curious because I'm not a coder so bare with me




                Eman.
                TinkerLand : Life's Choices,"No One Size Fits All"

                Comment


                  #23
                  Originally posted by Eman View Post
                  It's true the plugin does not invoke the firewall for communication. I have already manually added the HSPI_DOORBIRD3P to the list of applications.

                  You also get this in the log : ~!~DoorBird~!~No Manual IP Found In INI File
                  But when I checked the INI file, it's got 6 divice refs and Doorbird IP and the funny part is Doorbird during logging attracts HomeSeer web server port. And it's a vicious attraction, no matter how much you delete. It keeps coming back. This is partly due Doorbird not having fixed IP in the settings. The only problem is I can't test locally on the server.

                  So I tried FFMPEG url :"http://" & CameraUsername & ":" & CameraPassword & "@" & CameraIP & "/bha-api/video.cgi" you posted earlier. I get live video when using the Kodi plugin (IP Cam) and in a browser.

                  That said, is this the new normal that DOORBIRD people don't let you change the camera settings as you wish like other manufacturers? They even have another setting in there when you change the password, you have to email it to them in case you forget it Can they log in any time they wish?



                  Eman.
                  What do you mean that the DoorBird "during logging attracts HomeSeer web server port And it's a vicious attraction, no matter how much you delete"? I am afraid I do not understand what you are saying.

                  The plugin needs to know the HS server IP, it makes an attempt to discover this through a variety of means. I would like to think that unless you have multiple network cards then it will discover what it needs to by the methods I have put into the plugin. The reason it needs to know the server IP is when an event in the doorbell fires it makes a call to the plugin to launch change the device status through the HS web server.

                  Originally posted by Eman View Post
                  Hi mrhappy,

                  Although this plugin here :http://board.homeseer.com/showthread...17#post1132517 bares similarities to your kind of install. It does contain an INI file during intallation. The INI is already edited but the author states that you are free delete things you don't need. I'm just curious because I'm not a coder so bare with me




                  Eman.
                  You should not need to do anything with the INI file yourself in most circumstances, the plugin will create the file and update it as it needs to. Unless you need to over ride the IP address for the HS PC as detailed by the documentation you do not need to make any changes to the INI file and that is potentially causing issues.

                  My advice is to disable the plugin, delete the INI file, delete the devices in HS and then start the plugin again. Do not mess with the INI file unless you need to.

                  Comment


                    #24
                    Thanks for the plugin!

                    I just installed it. A couple of things I noticed:

                    1. The icons used are not available in an older version of HS3 (I am currently running on 3.0.0.163, so time to update )

                    2. I need to submit the IP address of the doorbird device. Would be nice if a FQDN would be possible as well, just in case the IP of the doorbird changes.

                    3. I also see the "ghost root device". The strange thing is that both devices have exactly the same refid. So what would happen if I delete one of them? Probably they will be both deleted? Maybe something went wrong with the grouping?

                    4. When I try to access the history images I get the following error: Image 1 Failed To Download: The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF
                    Attached Files

                    Comment


                      #25
                      Originally posted by petermdevries View Post
                      Thanks for the plugin!

                      I just installed it. A couple of things I noticed:

                      1. The icons used are not available in an older version of HS3 (I am currently running on 3.0.0.163, so time to update )

                      2. I need to submit the IP address of the doorbird device. Would be nice if a FQDN would be possible as well, just in case the IP of the doorbird changes.

                      3. I also see the "ghost root device". The strange thing is that both devices have exactly the same refid. So what would happen if I delete one of them? Probably they will be both deleted? Maybe something went wrong with the grouping?

                      4. When I try to access the history images I get the following error: Image 1 Failed To Download: The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF
                      Thank you for testing...

                      1) Yes the icons are part of the contemporary set and I didn't think people would mind, I then didn't have to bother with making or finding icons from elsewhere. If you are still running the old icon set then you can change the value/graphics pairs in the device configuration tabs.

                      2) Could you just give me an example of this - I don't quite understand, are you mapping your DoorBird to a domain instead of an IP in case DHCP gives it another IP? It may be that the box already accepts this but I would need to check what I am thinking.

                      3) I've fixed this now, minor thing wrong although IMHO a HS bug that lets you get it into that state really. This is the new version : https://drive.google.com/file/d/0B5D...ew?usp=sharing

                      4) Odd little error really - does everything else work OK in the plugin like the events/device actions? What happens if you go to http://192.168.1.8/bha-api/history.cgi?index=3 (changing the IP as appropriate) - does the image display OK?

                      Comment


                        #26
                        Originally posted by mrhappy View Post
                        Thank you for testing...



                        1) Yes the icons are part of the contemporary set and I didn't think people would mind, I then didn't have to bother with making or finding icons from elsewhere. If you are still running the old icon set then you can change the value/graphics pairs in the device configuration tabs.



                        2) Could you just give me an example of this - I don't quite understand, are you mapping your DoorBird to a domain instead of an IP in case DHCP gives it another IP? It may be that the box already accepts this but I would need to check what I am thinking.



                        3) I've fixed this now, minor thing wrong although IMHO a HS bug that lets you get it into that state really. This is the new version : https://drive.google.com/file/d/0B5D...ew?usp=sharing



                        4) Odd little error really - does everything else work OK in the plugin like the events/device actions? What happens if you go to http://192.168.1.8/bha-api/history.cgi?index=3 (changing the IP as appropriate) - does the image display OK?


                        1) Clear...

                        2) I am using a DNS. For example bha-1ccae370.home.mydomain.com

                        3) I downloaded and installed the newer version (0.0.0.5). The ghost device still exists. Should I delete this or recreate the device(s)?

                        4) As far as I can see everything else looks fine. The event data tab looks fine. Also the connection seems to work fine (I get the motion and doorbell notifications). The URL also works fine. The log shows a little bit more information:






                        Sent from my iPad using Tapatalk

                        Comment


                          #27
                          Originally posted by petermdevries View Post
                          1) Clear...
                          I've just checked and unfortunately there does not appear to be an obviously method to check whether the new or old icons are in use (I could start checking directories existing I guess) but may instead put a note in the documentation saying that if people are using an older version of HS they either need to use their own icons or upgrade.

                          2) I am using a DNS. For example bha-1ccae370.home.mydomain.com
                          OK, I think this can be done with relatively minor changes so the IP box accepts both a domain name or an IP address. I'll look at it for batch of next changes.

                          3) I downloaded and installed the newer version (0.0.0.5). The ghost device still exists. Should I delete this or recreate the device(s)?
                          I'm afraid you are going to have to delete all the devices. The curious thing you will notice is that one root device does not let you delete from the drop down - you need to pick the one you can delete and it will take all the other device with it.

                          4) As far as I can see everything else looks fine. The event data tab looks fine. Also the connection seems to work fine (I get the motion and doorbell notifications). The URL also works fine. The log shows a little bit more information:



                          Sent from my iPad using Tapatalk
                          I've had a look around the net for data on this, it appears that the DoorBird is sending data that is not finished with the carriage return and line feed. The web client get thats data and faults because it is expecting the line feed it is not getting. I am wondering why this is - whether or not you have a different firmware version (unlikely as I think it auto updates - I am on version 97), can you go to http://192.168.1.8/bha-api/info.cgi and tell me what it says?

                          Comment


                            #28
                            Originally posted by skarragallagher View Post
                            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?
                            I have installed the Blue Iris demo, have a stream to the camera running in MJPEG and the plugin still appears to handle events such as motion and door bell notifications. Not sure I would try much more than one simultaneous stream though in case you started to tax the device.
                            Last edited by mrhappy; December 28, 2016, 03:18 PM.

                            Comment


                              #29
                              Originally posted by mrhappy View Post
                              OK, I think this can be done with relatively minor changes so the IP box accepts both a domain name or an IP address. I'll look at it for batch of next changes.
                              Cool, would be nice!

                              Originally posted by mrhappy View Post
                              I'm afraid you are going to have to delete all the devices. The curious thing you will notice is that one root device does not let you delete from the drop down - you need to pick the one you can delete and it will take all the other device with it.
                              Just removed all devices and recreated a new set. So far it looks good.

                              Originally posted by mrhappy View Post
                              I've had a look around the net for data on this, it appears that the DoorBird is sending data that is not finished with the carriage return and line feed. The web client get thats data and faults because it is expecting the line feed it is not getting. I am wondering why this is - whether or not you have a different firmware version (unlikely as I think it auto updates - I am on version 97), can you go to http://192.168.1.8/bha-api/info.cgi and tell me what it says?
                              I am on 0098 ("VERSION": {"FIRMWARE": "000098","BUILD_NUMBER": "42418"). This is what I can see what is returned by the DoorBird. Looks fine at first glance. The only thing which might be strange is that the response tab in Chrome gives a "Failed to load response data". Perhaps because of the same issue?
                              Attached Files

                              Comment


                                #30
                                Originally posted by petermdevries View Post
                                ..I am on 0098 ("VERSION": {"FIRMWARE": "000098","BUILD_NUMBER": "42418"). This is what I can see what is returned by the DoorBird. Looks fine at first glance. The only thing which might be strange is that the response tab in Chrome gives a "Failed to load response data". Perhaps because of the same issue?
                                Well this is good in a sense of there is a difference between mine and your setup and whilst I am loathed to do so I might try and force an upgrade to find out whether or not this causes the problem.

                                I however see the same error in Chrome that it cannot load the data, I also wonder if it is malformed that Chrome fails but mine is good enough for the .net WebClient to deal with. I can also see the web server in the device is a few versions different to mine (you are on 1.4.39 wheres mine is 1.4.35) which could be a line of enquiry.

                                I'll send an email to DoorBird and see if they are willing to help...

                                Comment

                                Working...
                                X