Announcement

Collapse
No announcement yet.

Jon00 Homeseer Plugin Enable/Disable utility

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

  • jon00
    replied
    A button on what?

    Leave a comment:


  • kellermix
    replied
    Originally posted by ABL View Post
    I'm reading this thread and I'm wondering why one would like to disable or enable a plugin. Could you give some examples in what circumstances this could be applied?
    I'm using the iTunes DAAP plugin and my play button disappears every other day.After a restartingthe plugin it works again.I want to create a button and trigger a restart event to restart the plugin.

    Leave a comment:


  • jon00
    replied
    Good to hear you got this sorted.

    FYI, the version number is stored in Jon00Plugin.ini file

    Leave a comment:


  • sbessel
    replied
    Originally posted by sbessel View Post
    Jon,

    I am trying to get this utility working again. Not sure when it failed, but I am pretty sure it was due to me fixing another issue with my settings.ini and scriptingreference line.

    I am seeing these errors in the linux log upon startup: Which prevents this utility from working at all.
    <snip>
    Looks like it was a version issue. I downloaded the latest from your website and it is working just fine now.
    I couldn't tell what version I had so I just updated it anyway.

    Leave a comment:


  • sbessel
    replied
    Jon,

    I am trying to get this utility working again. Not sure when it failed, but I am pretty sure it was due to me fixing another issue with my settings.ini and scriptingreference line.

    I am seeing these errors in the linux log upon startup: Which prevents this utility from working at all.
    Code:
    Nov 8 10:41:47 bessel-homeseer mono[9894]: 10:41:47:2834:[Error]->Compiling script Jon00Plugin.vben: The import 'System.Core' could not be found.
    Nov 8 10:41:47 bessel-homeseer mono[9894]: 10:41:47:2849:[Error]->Compiling script Jon00Plugin.vben: 'Dispose' is not a member of 'System.Net.HttpWebResponse'.
    Nov 8 10:41:47 bessel-homeseer mono[9894]: 10:41:47:2867:[Error]->Compiling script Jon00Plugin.vben: 'Dispose' is not a member of 'System.Net.HttpWebResponse'.
    Nov 8 10:41:47 bessel-homeseer mono[9894]: 10:41:47:2880:[Error]->Compiling script Jon00Plugin.vben: Function without an 'As' clause; Object return type assumed.
    Nov 8 10:41:47 bessel-homeseer mono[9894]: 10:41:47:2892:[Error]->Compiling script Jon00Plugin.vben: Function without an 'As' clause; Object return type assumed.
    hs log:
    Nov-08 10:41:47 AM Error Compiling script Jon00Plugin.vben: Function without an 'As' clause; Object return type assumed.
    Nov-08 10:41:47 AM Error Compiling script Jon00Plugin.vben: Function without an 'As' clause; Object return type assumed.
    Nov-08 10:41:47 AM Error Compiling script Jon00Plugin.vben: 'Dispose' is not a member of 'System.Net.HttpWebResponse'.
    Nov-08 10:41:47 AM Error Compiling script Jon00Plugin.vben: 'Dispose' is not a member of 'System.Net.HttpWebResponse'.
    Nov-08 10:41:47 AM Error Compiling script Jon00Plugin.vben: The import 'System.Core' could not be found.

    my settings.ini scripting reference line:
    Code:
    ScriptingReferences=Newtonsoft.Json;Newtonsoft.Json.dll,System.Web;System.Web.Extensions.dll
    startup.vb
    Code:
    ' This is the startup script
    ' It is run once when HomeSeer starts up
    '
    ' You may also have Startup.vb and it will be run instead of this script.
    '
    sub Main(parm as object)
    
    hs.WriteLog("Startup", "Scripting is OK and is now running Startup.vb")
    
    
    hs.RunScript("Jon00Plugin.vben", False, False)
    
    
    End Sub
    here is my output from mono --version
    Code:
    Mono JIT compiler version 6.12.0.90 (tarball Fri Sep 4 13:58:50 UTC 2020)
    Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    
    TLS: __thread
    SIGSEGV: altstack
    Notifications: epoll
    Architecture: amd64
    Disabled: none
    Misc: softdebug
    Interpreter: yes
    LLVM: yes(610)
    Suspend: hybrid
    GC: sgen (concurrent by default)

    Leave a comment:


  • mgonzales100
    replied
    Originally posted by mgonzales100 View Post

    That was it. Now I feel like an idiot

    Thanks so much for the assistance. I'll test it with the plugin that I want to enable / disable and if it works I will make a donation. Thanks again.
    I tested it and it works flawlessly. Great little utility.

    Just made a donation!

    Leave a comment:


  • mgonzales100
    replied
    Originally posted by jon00 View Post
    It is nice to see such a detailed post describing your issue 👍

    If you have entries in the device management filters for 'Jon00 Plugin' and 'Utility' then I suspect they have been created. In addition to Floor/Room filters, make sure 'Virtual' is ticked under the device type filter.
    That was it. Now I feel like an idiot

    Thanks so much for the assistance. I'll test it with the plugin that I want to enable / disable and if it works I will make a donation. Thanks again.

    Leave a comment:


  • jon00
    replied
    It is nice to see such a detailed post describing your issue 👍

    If you have entries in the device management filters for 'Jon00 Plugin' and 'Utility' then I suspect they have been created. In addition to Floor/Room filters, make sure 'Virtual' is ticked under the device type filter.

    Leave a comment:


  • mgonzales100
    replied
    I downloaded the file and instructions and I think I followed them. However, the virtual devices were not created.

    I did the following:

    1. Copied the "Jon00Plugin.vben" file to the scripts folder under my main HS directory
    2. I edited the "startup.vb" file to add "hs.RunScript("Jon00Plugin.vben", False, False)"
    3. I do not require a password to login locally
    4. There is only user that has "admin-local" (or any other "local" privileges)

    A few observations:
    1. the startup.vb files contains "You may also have Startup.vb and it will be run instead of this script.". I thought this is the startup.vb file. see below for review.
    2. The HS3 Device List filters now include the Floor "Utility" and the Room "Jon00 Plugin". That was not the case before I did the 4 steps above.

    Your assistance is greatly appreciated and I will gladly donate once I have a working plugin. It will be worth every penny!

    ' This is the startup script
    ' It is run once when HomeSeer starts up
    '
    ' You may also have Startup.vb and it will be run instead of this script.
    '
    Sub Main(Parm As Object)

    hs.WriteLog("Startup", "(Startup.vb script) Scripting is OK and is now running Startup.vb")

    Dim SpeakClients As String = ""
    SpeakClients = hs.GetInstanceList
    If SpeakClients Is Nothing Then SpeakClients = ""
    If String.IsNullOrEmpty(SpeakClients.Trim) Then
    hs.WriteLog("Startup", "(Startup.vb script) No speaker clients detected, waiting up to 30 seconds for any to connect...")
    ' There are no connected speaker clients, so let's wait 30 seconds
    ' (which is the default re-connect interval for a speaker client)
    ' to see if we can get one connected, otherwise the two speak
    ' commands below will not be heard.
    hs.WaitSecs(1)
    Dim Start As Date = Now()
    Do
    SpeakClients = hs.GetInstanceList
    If SpeakClients Is Nothing Then SpeakClients = ""
    If String.IsNullOrEmpty(SpeakClients.Trim) Then
    hs.WaitSecs(1)
    Else
    Exit Do
    End If
    Loop Until Now.Subtract(Start).TotalSeconds > 30
    End If


    ' Speak - comment the next line if you do not want HomeSeer to speak at startup.
    hs.Speak("Welcome to Home-Seer", True)

    ' speak the port the web server is running on
    Dim port As String = hs.GetINISetting("Settings", "gWebSvrPort", "")
    If port <> "80" Then
    hs.Speak("Web server port number is " & port)
    End If


    ' You may add your own commands to this script.
    ' See the scripting section of the HomeSeer help system for more information.
    ' You may access help by going to your HomeSeer website and clicking the HELP button,
    ' or by pointing your browser to the /help page of your HomeSeer system.

    hs.RunScript("Jon00Plugin.vben", False, False)
    ' The above line was added by Michael to enable to the Jon00 plugin

    End Sub


    Leave a comment:


  • jon00
    replied
    For those of you who have had issues with this under Linux (only one or 2 operations before errors in the log), please try V1.0.8 on my site.

    Leave a comment:


  • jon00
    replied
    A few people are getting this error in Linux and I'm still not sure why.

    Try the following. Open up Jon00Plugin.ini in your config folder and add the following under [settings]:

    UseInterface=2

    If that fails try:

    UseInterface=3

    Let me know the results.

    Leave a comment:


  • Tillsy
    replied
    Originally posted by Tillsy View Post
    Worked an absolute treat the first time - BOTH the disable and enable worked fantastic.

    Every time thereafter nothing happens and the following error appears in my log
    Just confirming rebooting the system makes the disable and enable work again - once only each. Then its back to failing again until rebooted again, and so forth.

    Leave a comment:


  • Tillsy
    replied
    G'day Jon

    I have installed this plugin to troubleshoot a potential problem I am having with another - I'm going to disable and (20 seconds later) re-enable the plugin every few hours.

    Worked an absolute treat the first time - BOTH the disable and enable worked fantastic.

    Every time thereafter nothing happens and the following error appears in my log:

    7/16/2020 8:19:41 PM
    Script
    Jon00_Plugin
    Error in Main Block 3: System.Net.WebException: The operation has timed out. at System.Net.HttpWebRequest.RunWithTimeoutWorker[T] (System.Threading.Tasks.Task`1[TResult] workerTask, System.Int32 timeout, System.Action abort, System.Func`1[TResult] aborted, System.Threading.CancellationTokenSource cts) [0x000f8] in :0 at System.Net.HttpWebRequest.GetResponse () [0x00016] in :0 at scriptcode4.VBWrapper.Main (System.String Parm) [0x00a23] in :0

    Running with your V2 plugin with HS4 on Linux

    Leave a comment:


  • jon00
    replied
    Originally posted by avpman View Post

    Hi,
    Specifically, how do I enable/disable by number? I am using the V2 plugin on a HS Ze 2
    Thanks in advance.
    Its only available in V1

    Leave a comment:


  • avpman
    replied
    Originally posted by Mr_Resistor View Post
    Update:Yes, enable/disable by number works correctly. Name is more convenient, but this works. I just need to keep track of what Number various plugs are, and when I add/remove, I'll adjust events accordingly.

    Thanks.
    Hi,
    Specifically, how do I enable/disable by number? I am using the V2 plugin on a HS Ze 2
    Thanks in advance.

    Leave a comment:

Working...
X