www.homeseer.com    
 

Go Back   HomeSeer Message Board > HomeSeer Products & Services > HomeSeer Software > HS3 / HS3PRO > HS3 / HS3PRO Discussion

HS3 / HS3PRO Discussion Discussions related to the released version of HS3/HS3PRO

Reply
 
Thread Tools Display Modes
  #101  
Old January 31st, 2017, 04:09 PM
stefxx's Avatar
stefxx stefxx is offline
Seer Deluxe
 
Join Date: Sep 2008
Location: Netherlands
Posts: 446
Excellent! Yes, I think you are right, HSTouch does not support authentication headers... but this is good enough for me right now!

Another issue, this time related to the PI: I can't get any history images. Going to the config page of the PI (History Images), all images only show "Image 1 Failed To Download: Unknown". Note that the image on the "Home" tab shows just fine.

Trying to download an image by using an event gives an error in the log: "DoorBird Image 1 FAILED to download: Unknown".

Looking at the event, is states it will download to "/html/Images/DoorBird". Note that the default Linux directory is "images", no capital I. But even after creating "html/images/DoorBird" and "html/Images/DoorBird" directories, it still fails.

BTW, viewing history images at the HTML widget (http://192.168.1.144/bha-api/view.html) does work.

Thanks again!
__________________
stefxx
Reply With Quote
  #102  
Old January 31st, 2017, 05:06 PM
mrhappy mrhappy is offline
OverSeer
 
Join Date: Nov 2007
Location: W.Mids, UK
Posts: 6,690
Quote:
Originally Posted by stefxx View Post
Excellent! Yes, I think you are right, HSTouch does not support authentication headers... but this is good enough for me right now!

Another issue, this time related to the PI: I can't get any history images. Going to the config page of the PI (History Images), all images only show "Image 1 Failed To Download: Unknown". Note that the image on the "Home" tab shows just fine.

Trying to download an image by using an event gives an error in the log: "DoorBird Image 1 FAILED to download: Unknown".

Looking at the event, is states it will download to "/html/Images/DoorBird". Note that the default Linux directory is "images", no capital I. But even after creating "html/images/DoorBird" and "html/Images/DoorBird" directories, it still fails.

BTW, viewing history images at the HTML widget (http://192.168.1.144/bha-api/view.html) does work.

Thanks again!
somewhat of a frustrating one this one, the problem is with the call to hs.writeurlimage (http://www.homeseer.com/support/home...ehtmlimage.htm) - that is meant to allow you to write to the HS images directory.

If I referenced the path to the DoorBird URL then obviously it is going to fail to load any images the moment you are outside your network (this is how it used to be written when I first released it), clearly not great and the above call is meant to get around that by pushing the image to the HS web server images directory so it shouldn't matter how you are accessing HS.

It seems in Linux this fails no matter what path you provide to it, you are only meant to put a path relative to the HS images directory and this is how it was;

Code:
Dim rval As Boolean = hs.WriteHTMLImage(img, "DoorBird\" & IIf(instance <> "", DInstanceName & "\", "") & FileName & ".jpg", True)
Log("Image Creation Return: " & rval)
I thought perhaps the path may have been the issue but I have tried

Code:
hs.WriteHTMLImage(img, "/DoorBird/" & IIf(instance <> "", DInstanceName & "/", "") & FileName & ".jpg"

hs.WriteHTMLImage(img, "/" & FileName & ".jpg"

hs.WriteHTMLImage(img, FileName & ".jpg"
And they all fail and return false so it can't write the image correctly, I don't know whether this is a permissions issue or what. I'll try and get an answer, as a workaround I can reference the local address if that would help temporarily?
Reply With Quote
  #103  
Old February 1st, 2017, 03:15 AM
stefxx's Avatar
stefxx stefxx is offline
Seer Deluxe
 
Join Date: Sep 2008
Location: Netherlands
Posts: 446
Hi,

I didn't even know that function existed, so for my Buienradar plugin I did something like this:

Code:
    Dim slash = If(IsRunningOnMono, "/", "\")

    If (Not System.IO.Directory.Exists("html" & slash & "Buienradar")) Then
        System.IO.Directory.CreateDirectory("html" & slash & "Buienradar")
    End If
    image.Save("html" & slash & "Buienradar" & slash & "Buienradar" & index + 1 & ".png", Imaging.ImageFormat.Png)
I assume you have your own way of checking if running on Linux already, but this is my IsRunningOnMono function:

Code:
    Public Function IsRunningOnMono() As Boolean
        Return Type.[GetType]("Mono.Runtime") IsNot Nothing
    End Function
__________________
stefxx
Reply With Quote
  #104  
Old February 1st, 2017, 06:56 PM
mrhappy mrhappy is offline
OverSeer
 
Join Date: Nov 2007
Location: W.Mids, UK
Posts: 6,690
Quote:
Originally Posted by stefxx View Post
Hi,

I didn't even know that function existed, so for my Buienradar plugin I did something like this:

Code:
    Dim slash = If(IsRunningOnMono, "/", "\")

    If (Not System.IO.Directory.Exists("html" & slash & "Buienradar")) Then
        System.IO.Directory.CreateDirectory("html" & slash & "Buienradar")
    End If
    image.Save("html" & slash & "Buienradar" & slash & "Buienradar" & index + 1 & ".png", Imaging.ImageFormat.Png)
I assume you have your own way of checking if running on Linux already, but this is my IsRunningOnMono function:

Code:
    Public Function IsRunningOnMono() As Boolean
        Return Type.[GetType]("Mono.Runtime") IsNot Nothing
    End Function
Issue with that is if the plugin is running remotely then when you call img.save it is going to save locally with respect to the plugin which if it is remote then the image is not going to sit in the HS HTML directory and then it is not going to be able to be viewed by a web page.

I mean I can add this so on linux it works but the caveat then is that Linux plugins won't be able to be run remotely until I can figure out what is wrong or the command itself can be fixed if it is at fault.
Reply With Quote
  #105  
Old February 2nd, 2017, 01:13 AM
stefxx's Avatar
stefxx stefxx is offline
Seer Deluxe
 
Join Date: Sep 2008
Location: Netherlands
Posts: 446
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!
__________________
stefxx
Reply With Quote
  #106  
Old February 2nd, 2017, 08:10 AM
mrhappy mrhappy is offline
OverSeer
 
Join Date: Nov 2007
Location: W.Mids, UK
Posts: 6,690
Quote:
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.
Reply With Quote
  #107  
Old February 2nd, 2017, 08:17 AM
stefxx's Avatar
stefxx stefxx is offline
Seer Deluxe
 
Join Date: Sep 2008
Location: Netherlands
Posts: 446
Quote:
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
Reply With Quote
  #108  
Old February 6th, 2017, 05:28 PM
mrhappy mrhappy is offline
OverSeer
 
Join Date: Nov 2007
Location: W.Mids, UK
Posts: 6,690
Quote:
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..
Reply With Quote
  #109  
Old February 7th, 2017, 02:35 AM
stefxx's Avatar
stefxx stefxx is offline
Seer Deluxe
 
Join Date: Sep 2008
Location: Netherlands
Posts: 446
Quote:
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
Reply With Quote
  #110  
Old February 7th, 2017, 05:28 PM
mrhappy mrhappy is offline
OverSeer
 
Join Date: Nov 2007
Location: W.Mids, UK
Posts: 6,690
Quote:
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?
Reply With Quote
  #111  
Old February 8th, 2017, 04:41 AM
stefxx's Avatar
stefxx stefxx is offline
Seer Deluxe
 
Join Date: Sep 2008
Location: Netherlands
Posts: 446
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
Reply With Quote
  #112  
Old February 8th, 2017, 01:06 PM
mrhappy mrhappy is offline
OverSeer
 
Join Date: Nov 2007
Location: W.Mids, UK
Posts: 6,690
Quote:
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
Reply With Quote
  #113  
Old February 8th, 2017, 01:30 PM
stefxx's Avatar
stefxx stefxx is offline
Seer Deluxe
 
Join Date: Sep 2008
Location: Netherlands
Posts: 446
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
Reply With Quote
  #114  
Old February 8th, 2017, 01:39 PM
mrhappy mrhappy is offline
OverSeer
 
Join Date: Nov 2007
Location: W.Mids, UK
Posts: 6,690
Quote:
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.
Reply With Quote
  #115  
Old February 17th, 2017, 10:18 AM
stefxx's Avatar
stefxx stefxx is offline
Seer Deluxe
 
Join Date: Sep 2008
Location: Netherlands
Posts: 446
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
Reply With Quote
  #116  
Old February 17th, 2017, 10:25 AM
stefxx's Avatar
stefxx stefxx is offline
Seer Deluxe
 
Join Date: Sep 2008
Location: Netherlands
Posts: 446
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
Reply With Quote
  #117  
Old February 17th, 2017, 01:51 PM
mrhappy mrhappy is offline
OverSeer
 
Join Date: Nov 2007
Location: W.Mids, UK
Posts: 6,690
Quote:
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?
Reply With Quote
  #118  
Old February 17th, 2017, 02:25 PM
stefxx's Avatar
stefxx stefxx is offline
Seer Deluxe
 
Join Date: Sep 2008
Location: Netherlands
Posts: 446
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
Reply With Quote
  #119  
Old February 18th, 2017, 05:55 AM
mrhappy mrhappy is offline
OverSeer
 
Join Date: Nov 2007
Location: W.Mids, UK
Posts: 6,690
Quote:
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?
Reply With Quote
  #120  
Old February 18th, 2017, 08:37 AM
stefxx's Avatar
stefxx stefxx is offline
Seer Deluxe
 
Join Date: Sep 2008
Location: Netherlands
Posts: 446
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
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Doorbird (Video Doorbell) Plugin Request skarragallagher HS3 Plug-In Development 41 July 9th, 2016 05:51 AM
DOORBIRD Eman Tasker Plugin (3P) 1 May 6th, 2016 03:34 PM
Beta to Release beerygaz Modbus Plug-In 8 February 8th, 2016 07:48 AM
BETA Release 1.1.1 twa8000 TWA-Onkyo / Integra Plug-in (3P) 44 December 14th, 2010 03:43 AM


All times are GMT -4. The time now is 10:15 PM.

Untitled Document
NEW!
New Products


Copyright HomeSeer Technologies, LLC