www.homeseer.com    
 

Go Back   HomeSeer Message Board > 3rd Party Plug-Ins/Scripts > Plug-ins by Author > Click Here for List of Author Forums > Jon00's plugins and scripts

Jon00's plugins and scripts Discussions related to Jon00's plugins and scripts.

Reply
 
Thread Tools Display Modes
  #221  
Old June 28th, 2018, 08:03 AM
jon00's Avatar
jon00 jon00 is offline
OverSeer
 
Join Date: Jan 2002
Location: London UK
Posts: 11,555
As I said, it needs to read the plugin names from Homeseer's own plugin setup page. It would appear that it is being prevented from doing so. I use the HttpWebRequest class to do this.
__________________
Jon

Reply With Quote
  #222  
Old June 29th, 2018, 01:52 PM
fksk fksk is offline
Seer
 
Join Date: Oct 2017
Location: IL
Posts: 32
Quote:
Originally Posted by jon00 View Post
As I said, it needs to read the plugin names from Homeseer's own plugin setup page. It would appear that it is being prevented from doing so. I use the HttpWebRequest class to do this.
By default what addresssdoes the script use to hit the page: localhost, 127.0.0.1, etc?
Reply With Quote
  #223  
Old June 29th, 2018, 07:04 PM
jon00's Avatar
jon00 jon00 is offline
OverSeer
 
Join Date: Jan 2002
Location: London UK
Posts: 11,555
It would be the LAN IP Address as seen on the about page. You can manually set this if it is wrong - read the docs.
Reply With Quote
  #224  
Old June 30th, 2018, 07:27 AM
fksk fksk is offline
Seer
 
Join Date: Oct 2017
Location: IL
Posts: 32
Quote:
Originally Posted by jon00 View Post
It would be the LAN IP Address as seen on the about page. You can manually set this if it is wrong - read the docs.
I was away from the machine and spitballing. Going to try some futzing with that to see if I can figure it out.
Reply With Quote
  #225  
Old June 30th, 2018, 07:50 AM
fksk fksk is offline
Seer
 
Join Date: Oct 2017
Location: IL
Posts: 32
Okay here’s my thoughts.

The script works on Win 10.

On my Server 2012 Install it is creating the Enable and Disable objects in HS3.

The script is almost certainly not successfully reading the Plugins page via the VB HTTP Get.

On Server 2012, MS has put almost obnoxious levels of security on Internet Explorer. Multiple site zones (trusted, local intranet, etc) + granular settings for each.

I have a sneaking suspicion that the VB HTTP request library is possibly subject to these security rules somehow. I have put the server’s IP (127.0.0.1) and localhost into the trusted sites on IE but it doesn’t mean it’s not goofed.


rprade - Do you have anything memorable on your IE browsing security settings? Did you turn all the dumb stuff off?

I think our problem lies in the OS not allowing the GET request to actually complete. Everything else is working including getting the log line that the script is instantiating at startup. John00 since you wrote the code and thus know how it’s invocation the web page get calls, see if you can Google other folks having their scripts fart in Server 2012.

I believe my issue *IS* solvable without touching the script -> nothing wrong with it. We just need to make the sure the OS/browser object/security settings will allow the script to execute which will ultimately mean an extra step or two on the script install instructions for Server 2012/2016 users.

Thanks everyone for the help!!!!!
Reply With Quote
  #226  
Old July 2nd, 2018, 07:23 AM
Moskus's Avatar
Moskus Moskus is offline
OverSeer
 
Join Date: Aug 2007
Location: Norway
Posts: 3,827
Okay, I've solved it by using the tip provided by Jon00.
As Jon00 is using HttpWebRequest, it should not using the IE settings at all (exept for proxy settings).

I wrote a simple script for testing. It seems that running a script locally gives some different results based on how you've set up permissions. Here's the results. Notice the wrapped web page in the log.



Aha! Yes, the user "data" was set as "Normal+Local" in the Tools -> Setup -> Network page. I set that user to "Normal" (I had another local user aswell), and wouldn't you know:



So, no: It's not ESXi (of course) or any other strange issues. But:
You need to have just one local user, and that user needs to have admin rights (of course).



If you want to test this yourself you can use this script:
Code:
    Sub Main(parm As Object)
        Dim request As System.Net.HttpWebRequest = DirectCast(System.Net.WebRequest.Create("http://localhost/interfaces"), System.Net.HttpWebRequest)
        Dim response As System.Net.HttpWebResponse = DirectCast(request.GetResponse, System.Net.HttpWebResponse)
        Dim reader As New System.IO.StreamReader(response.GetResponseStream)

        Dim output As String = reader.ReadToEnd
        hs.Writelog("Test interface page", output)
    End Sub
__________________
HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
Running on Windows 10 (64) virtualized
on ESXi (Fujitsu Primergy TX150 S8).
WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!
Reply With Quote
  #227  
Old July 2nd, 2018, 10:12 AM
fksk fksk is offline
Seer
 
Join Date: Oct 2017
Location: IL
Posts: 32
Talking

Moskus -> This is EXACTLY it!!! I changed my settings and it worked!!


Okay to re-phrase as I followed what Moskus was saying but it was a little opaque.
------------------

In order for Jon00's script to work, you can only have ONE Homeseer/HS3 user account that has Local privileges assigned to it. Out of default I had created additional HS3 user accounts for different folks to have access to our system, and I had made them User + Local, Admin + Local, etc.

I changed all the HS3 user accounts that I had created to NOT have Local account group type included, and then made sure the HS3 'default' user account was Admin + Local (and thus the only user to have Local). Then restarted HS3, boom all my plugs came up in the dropdown for Jon00's script. Perfect. Obviously what's happening is John00's script essentially runs under the 'default' user creds since they're the one with Local rights.

Jon00 I would HEARTILY recommend adding this to the documentation, Moskus you're the MAN!!!!!!

Quote:
Originally Posted by Moskus View Post
Okay, I've solved it by using the tip provided by Jon00.
As Jon00 is using HttpWebRequest, it should not using the IE settings at all (exept for proxy settings).

I wrote a simple script for testing. It seems that running a script locally gives some different results based on how you've set up permissions. Here's the results. Notice the wrapped web page in the log.



Aha! Yes, the user "data" was set as "Normal+Local" in the Tools -> Setup -> Network page. I set that user to "Normal" (I had another local user aswell), and wouldn't you know:



So, no: It's not ESXi (of course) or any other strange issues. But:
You need to have just one local user, and that user needs to have admin rights (of course).



If you want to test this yourself you can use this script:
Code:
    Sub Main(parm As Object)
        Dim request As System.Net.HttpWebRequest = DirectCast(System.Net.WebRequest.Create("http://localhost/interfaces"), System.Net.HttpWebRequest)
        Dim response As System.Net.HttpWebResponse = DirectCast(request.GetResponse, System.Net.HttpWebResponse)
        Dim reader As New System.IO.StreamReader(response.GetResponseStream)

        Dim output As String = reader.ReadToEnd
        hs.Writelog("Test interface page", output)
    End Sub
Reply With Quote
  #228  
Old July 2nd, 2018, 11:03 AM
jon00's Avatar
jon00 jon00 is offline
OverSeer
 
Join Date: Jan 2002
Location: London UK
Posts: 11,555
Thumbs up Good work Moskus

Thanks for your detective work on this. I have now added this information to the documentation.
Reply With Quote
  #229  
Old July 2nd, 2018, 12:44 PM
Moskus's Avatar
Moskus Moskus is offline
OverSeer
 
Join Date: Aug 2007
Location: Norway
Posts: 3,827
Quote:
Originally Posted by fksk View Post
Moskus you're the MAN!!!!!!
Thanks!

I just re-read my own post, and my English is all over the place. I have a hard time understanding what I've written (okay, maybe not, but apparently it's written in the worlds most used universal language: "Bad English")…

The next time I do a write up like that I should take a cup of coffee first... it is obviously needed. :P
Reply With Quote
  #230  
Old July 4th, 2018, 08:25 PM
Rick Bonari Rick Bonari is offline
Seer Master
 
Join Date: Oct 2002
Location: Bremerton, Washington (USA)
Posts: 656
Where To Find This Plugin?

Just wondering where this plugin is located for download? Thanks....Rick
Reply With Quote
  #231  
Old July 4th, 2018, 08:35 PM
rprade's Avatar
rprade rprade is offline
OverSeer
 
Join Date: Jan 2014
Location: Colorado
Posts: 6,955
Quote:
Originally Posted by Rick Bonari View Post
Just wondering where this plugin is located for download? Thanks....Rick
Click on the graphic under Jon’s signature in the post at the top of this page.
__________________
Randy Prade
Aurora, CO
Prades.net

PHLocation - Pushover - EasyTrigger - UltraECM3 - Ultra1Wire3 - Arduino
Reply With Quote
  #232  
Old July 8th, 2018, 01:21 AM
Rick Bonari Rick Bonari is offline
Seer Master
 
Join Date: Oct 2002
Location: Bremerton, Washington (USA)
Posts: 656
Hello Jon00,

I installed the script in the HS3 Program scripts directory and created an event that is triggered manually. I told the event to run script in the script directory that you show in your example when triggered manually. I then did as you said to do using Sub or Function: Main and Parameters: Plugin;0.

It created the two devices on the device management page after I first ran this script and when I enable and disable the plugins from the device management page or HS3Touch page they disable and enable just fine.

I am puzzled about one thing. When I first ran the script, with Parameter: Plugin;0, why when I went to the plugin management screen was the plugin still enabled? I thought we were supposed to be able to create events that would disable or enable plugins depending on various conditions such as time, etc. Again when I do a manual trigger of this event from the events creations page, it did give me the two devices in the device management screen but it did not when first run disable the plugin as I would have expected.

What am I missing here? I think maybe I don't understand exactly how the plug-in works. I do like this plugin. Thanks much !!!!!! Rick

Last edited by Rick Bonari; July 8th, 2018 at 01:29 AM. Reason: Additonal Information
Reply With Quote
  #233  
Old July 8th, 2018, 01:34 AM
jon00's Avatar
jon00 jon00 is offline
OverSeer
 
Join Date: Jan 2002
Location: London UK
Posts: 11,555
It looks like you installed version 1 of the script. You need to use V2. Both are included in the same zip. If you unzip the folder to a temporary directory, preserving the file structure, you will see 2 folders called V1 and V2. Use the scripts & documentation in the V2 folder.

Last edited by jon00; July 8th, 2018 at 03:53 AM.
Reply With Quote
  #234  
Old July 8th, 2018, 09:55 AM
Rick Bonari Rick Bonari is offline
Seer Master
 
Join Date: Oct 2002
Location: Bremerton, Washington (USA)
Posts: 656
Jon00,

I believe I did install v2. To install v2, do I need to remove two devices on device management page and the event I created and then remove current script and load version 2 script in scripts folder?
What if v2 is currently loaded? How can you tell what version is loaded? Thanks much....Rick

Last edited by Rick Bonari; July 8th, 2018 at 09:58 AM. Reason: Additional Information
Reply With Quote
  #235  
Old July 8th, 2018, 10:09 AM
jon00's Avatar
jon00 jon00 is offline
OverSeer
 
Join Date: Jan 2002
Location: London UK
Posts: 11,555
Rick,

If you have 2 virtual devices but using notation Plugin;0 in a script then it appears you have installed V2 but reading both sets of documentation for V1 and V2.

Once version 2 is setup correctly, then it is only called from events.

Please only read the pdf document called 'Jon00 PluginV2.pdf' and ensure you have followed the install instructions. The script Jon00Plugin.vben has a last modified date of June 1st 2018.
Reply With Quote
Reply

Bookmarks

Tags
disable, enable, jon00, plug-in, plugin

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


All times are GMT -4. The time now is 04:27 PM.


Copyright HomeSeer Technologies, LLC