Announcement

Collapse
No announcement yet.

DoorBird Beta Plugin Release

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

    Originally posted by stefxx View Post
    Right, now I understand. So to answer your question, yes I am fine with the fact that it only works local (until WriteHTMLImage is fixed). And as soon as the WriteHTMLImage function is fixed I need to update my plugin as well

    While you are working on the plugin, maybe I can propose another feature? Currently the "Ring", "Motion" and "Light" buttons are activated only for about 5 seconds. I find that a bit short. Especially for the light, as it is actually on for 3 minutes. Is there any way you can make that configurable?

    Thanks again!
    I'll try and sort the image issue tomorrow, I did set it to five seconds and when an event comes in it starts a thread to wait five seconds and reset the device. This is basically because of the fact the events (motion/doorbell/door open) have a relaxation time before they can trigger again, in the case of this plugin I don't change it from the default 10 seconds so I picked a time for the devices that was less than this but a time when I felt that any events that were triggering on the devices would have chance to trigger.

    It may be that I should really add an option to configure the relaxation time and then calculate a figure for the time to reset the devices from this (perhaps half?) but suggestions are welcome.

    Comment


      Originally posted by mrhappy View Post
      It may be that I should really add an option to configure the relaxation time and then calculate a figure for the time to reset the devices from this (perhaps half?) but suggestions are welcome.
      Sound a bit complicated. Why not simply make it a configurable time and reset the device after that time has passed? You can use the "Do not update device last change time if device value does not change" option to optionally update last change date/time if another event comes in during the configured time. That way everyone can decide for himself how to react to those events?

      Either way, thanks again for all your help and efforts!
      stefxx

      Comment


        Originally posted by stefxx View Post
        Sound a bit complicated. Why not simply make it a configurable time and reset the device after that time has passed? You can use the "Do not update device last change time if device value does not change" option to optionally update last change date/time if another event comes in during the configured time. That way everyone can decide for himself how to react to those events?

        Either way, thanks again for all your help and efforts!
        Can you try this see what you think and whether or not it works - http://s652164905.websitehome.co.uk/...d_0_0_0_14.zip

        The relaxation time is now configurable in settings (albeit in steps), the devices reset after half of their relaxation time apart from the light device which resets at two minutes. The events table is now all jQueried on a timer and updates dynamically and the settings page provides some feedback as to whether it was able to establish a connection when you include your details.

        I've added the linux option to create the directory in the HS html directory, it then downloads the image as an image and saves it into this directory. I've had to add a bit to delete the file first then download it else I will never have assurance that the file is actually the one downloaded. The issue then is that this plugin will not work if it is run on a Linux install remotely, it will run fine on Linux when run on the HS PC. You don't need to worry about the path on the events page in terms of what displays in the event, that is for display only.

        Thanks..

        Comment


          Originally posted by mrhappy View Post
          Thanks..
          No, thank you!

          Few questions/observations:
          - Downloading the pictures now works fine on Linux. I am running the PI local so I don't face the issue of not remote saving the images.
          - I don't get the "relaxation time" thing. Maybe because I am not native English, but I simple do not understand the meaning or purpose. Why would I configure a 30 second timeout if it is actually 15 seconds?
          - I have an event triggering on Ring. It is trying to save the last image (nr 1). However, without a 1 second delay between the trigger (the ring) and the action (to save the file) the file is corrupt. I guest it is still saving the image to the DoorBird while the PI is trying to retrieve it. Is this something you can check on or should I simply leave the delay in the event?
          - I was trying to change the name of the file in the event from "1" to "Current". However, it doesn't "stick". No matter what I try for the filename, it always revert to "1".

          But: thanks again! At least now I can use it the way I want!
          stefxx

          Comment


            Originally posted by stefxx View Post
            No, thank you!

            Few questions/observations:
            - Downloading the pictures now works fine on Linux. I am running the PI local so I don't face the issue of not remote saving the images.
            - I don't get the "relaxation time" thing. Maybe because I am not native English, but I simple do not understand the meaning or purpose. Why would I configure a 30 second timeout if it is actually 15 seconds?
            - I have an event triggering on Ring. It is trying to save the last image (nr 1). However, without a 1 second delay between the trigger (the ring) and the action (to save the file) the file is corrupt. I guest it is still saving the image to the DoorBird while the PI is trying to retrieve it. Is this something you can check on or should I simply leave the delay in the event?
            - I was trying to change the name of the file in the event from "1" to "Current". However, it doesn't "stick". No matter what I try for the filename, it always revert to "1".

            But: thanks again! At least now I can use it the way I want!
            The 'relaxation time' is a little bit of a odd use of the term (that is in the API) but it is from my understanding a bit like the do not trigger for x minutes/seconds on a HS event. If the doorbell relaxation time is set to 30 seconds then if someone presses the doorbell 20 seconds after it was first pushed you will not get the notification. I guess it could be re-labelled as re-trigger time which would probably make more sense.

            For the second issue then I have seen similar before (was half of the image grey by chance?) and reached the same conclusion that it was because the image was still downloading. I don't think I can unfortunately do anything about this, when the plugin downloads the image the web client call should block until the image downloads (or times out) so that makes me think that the DoorBird unit is likely still saving the image on the unit and my plugin is getting in first. If the delay works then I would leave it in, I may be able to detect if an image is corrupt and I'll look into that and possible re-run the routine once if a corrupt image is detected.

            The last point should work, you must however press the 'update changes' button when you have changed the file name and it should display in the event once collapsed like this;



            Are you saying you never get test.jpg or similar?

            Comment


              Forget about the event issue. I tried again and it is working now. The source of the issue was probably between the keyboard and chair...

              About the corrupt image, I do mean half grey indeed. And I guess it makes more sense to fix this at the DoorBird site and for now the 1 second delay is just fine.

              Finally, the relaxation thing. I think I understand now. I assumed that the HomeSeer device reset would occur at the predefined time, and the "relaxation/do not trigger for x" would be half of that time. But actually, it is the other way around. I still not find it very logical, but don't change it just for me please...
              stefxx

              Comment


                Originally posted by stefxx View Post
                Forget about the event issue. I tried again and it is working now. The source of the issue was probably between the keyboard and chair...

                About the corrupt image, I do mean half grey indeed. And I guess it makes more sense to fix this at the DoorBird site and for now the 1 second delay is just fine.

                Finally, the relaxation thing. I think I understand now. I assumed that the HomeSeer device reset would occur at the predefined time, and the "relaxation/do not trigger for x" would be half of that time. But actually, it is the other way around. I still not find it very logical, but don't change it just for me please...
                Rather typically I can't get a corrupt image to display now although I had one saved I've used for testing, I guess that if HS is running quickly or the network is running slowly, or the doorbird is having a pause or whatever then this is why the image may sometimes appear corrupted so it is dependent on a number of factors.

                I've added a function in version .15 that I'm not sure if it will help, it will now look at the image and the first pixel in each row, if that is #808080 which appears to be it's value when it corrupts and there are more than 20 occurrences of that grey pixel being present (suggesting the image itself is corrupt) it will attempt to download again for a maximum of five times before aborting. This should then allow time for the doorbird unit to save the image and it to be downloaded in HS OK.

                Would there be any chance you could try it and have a look see if it helps?

                http://s652164905.websitehome.co.uk/...d_0_0_0_15.zip

                Comment


                  A quick test shows no more corrupt (half grey) images. However, several times I got the image of the previous visitor. It seems HS3 and your plugin is too quick and/or the DoorBird is too slow. So I need the 1 second delay anyway to make it work reliable...
                  stefxx

                  Comment


                    Originally posted by stefxx View Post
                    A quick test shows no more corrupt (half grey) images. However, several times I got the image of the previous visitor. It seems HS3 and your plugin is too quick and/or the DoorBird is too slow. So I need the 1 second delay anyway to make it work reliable...
                    OK thanks for checking, I'll leave it in and I don't think it's going to do anything detrimental there, if it does I'll just take it out. Next communication I have with DoorBird I'll let them know and see what they advise.

                    I'll put version .15 in the updater anyway with those features/issues resolved.

                    Comment


                      Hi,

                      Any idea why I suddenly see these messages in the console log, all the time, every 2 seconds:

                      [17-2-2017 16:10:52] - Input Data: action=updatetime
                      [17-2-2017 16:10:52] - Row Count: 2
                      [17-2-2017 16:10:54] - Input Data: action=updatetime
                      [17-2-2017 16:10:54] - Row Count: 2
                      [17-2-2017 16:10:56] - Input Data: action=updatetime
                      [17-2-2017 16:10:56] - Row Count: 2
                      [17-2-2017 16:10:58] - Input Data: action=updatetime
                      [17-2-2017 16:10:58] - Row Count: 2
                      [17-2-2017 16:11:00] - Input Data: action=updatetime
                      [17-2-2017 16:11:00] - Row Count: 2
                      [17-2-2017 16:11:02] - Input Data: action=updatetime
                      [17-2-2017 16:11:02] - Row Count: 2
                      [17-2-2017 16:11:04] - Input Data: action=updatetime
                      [17-2-2017 16:11:04] - Row Count: 2
                      [17-2-2017 16:11:06] - Input Data: action=updatetime
                      [17-2-2017 16:11:06] - Row Count: 2
                      [17-2-2017 16:11:08] - Input Data: action=updatetime
                      [17-2-2017 16:11:08] - Row Count: 2
                      updating devices
                      [17-2-2017 16:11:10] - Input Data: action=updatetime
                      [17-2-2017 16:11:10] - Row Count: 2
                      [17-2-2017 16:11:12] - Input Data: action=updatetime
                      [17-2-2017 16:11:12] - Row Count: 2
                      [17-2-2017 16:11:14] - Input Data: action=updatetime
                      [17-2-2017 16:11:14] - Row Count: 2
                      [17-2-2017 16:11:16] - Input Data: action=updatetime
                      [17-2-2017 16:11:16] - Row Count: 2

                      Restarted my HomeSeer box, restarted the DoorBird but the messages stay. I am still running firmware 101 (I noticed 102 is being rolled out currently).

                      Apart from these messages, I would like to disable console messages all together. Is this possible? On Windows it only shows with "Developer mode" but on Linux they show up all the time.
                      stefxx

                      Comment


                        After seeing those messages for a few hours, it just stopped. Still running 101 firmware. Not sure if it has anything to do with firmware update at all.

                        Question remains, can the console messages be disabled completely?
                        stefxx

                        Comment


                          Originally posted by stefxx View Post
                          After seeing those messages for a few hours, it just stopped. Still running 101 firmware. Not sure if it has anything to do with firmware update at all.

                          Question remains, can the console messages be disabled completely?
                          Those messages are because there is a AJAX timer on the web page that runs to dynamically update the message table. I'll remove the entry in specific about that as there is really little need for it. I expect it stopped if you closed a web page tab or similar at the time.

                          I mean I can stop the console messages on Linux but I'd obviously need an option to turn it off/on because of needing the debug data - what happens with other plugins as I'd guess other plugins may be putting data into this window?

                          Comment


                            Thanks for explaining the messages. I was really surprised to see all those messages for hours and then it suddenly stopped... I must have had a browser window open somewhere

                            About the logging, you can either add an option in the plugin, or check "PluginDebug" in the settings.ini. This will equal the "Developer mode" on the Manage Plugins page. Something like this?

                            Dim LogDebug As Boolean = If(hs.GetINISetting("Settings", "PluginDebug", "False", "settings.ini") = "True", True, False)
                            stefxx

                            Comment


                              Originally posted by stefxx View Post
                              Thanks for explaining the messages. I was really surprised to see all those messages for hours and then it suddenly stopped... I must have had a browser window open somewhere

                              About the logging, you can either add an option in the plugin, or check "PluginDebug" in the settings.ini. This will equal the "Developer mode" on the Manage Plugins page. Something like this?

                              Dim LogDebug As Boolean = If(hs.GetINISetting("Settings", "PluginDebug", "False", "settings.ini") = "True", True, False)
                              Yeah I've added that as an option - I was more interested in how other plugins were handling it (not being a linux person, I only use it for testing and then only one plugin at a time) as I would imagine other plugins must be logging data to the console window?

                              Regardless I have changed those two issues, you shouldn't get the continual entry in the log now, the ini setting is Debug=False under the settings key. I've put this version in the updater and tested it myself - can you take a look please?

                              Comment


                                Thanks! It works as expected. As soon as I added "Debug=False" to the ini the logging stopped after restarting the plugin:

                                Connecting to server at 127.0.0.1...
                                02:19:54:4670:[Info]->Plugin DoorBird has connected. IP:127.0.0.1:49102
                                Connected, waiting to be initialized...
                                [18-2-2017 14:19:54] - InitIO Running
                                Debug Mode Enabled: False

                                In my 5 plugins, I simply have an options in the PI config that enabled/disables debug logging. It defaults to false, because in the Linux console it becomes messy pretty quick when you have several PI running. I use to check the "Developer mode" option in the settings.ini but again, running multiple plugins with that option set to On became too much pretty soon.
                                stefxx

                                Comment

                                Working...
                                X