Announcement

Collapse
No announcement yet.

Jon00 Homeseer Plugin Enable/Disable utility

Collapse
This topic is closed.
X
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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.

    Jon

    Comment


      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.
      Jon

      Comment


        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


        Comment


          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.
          Jon

          Comment


            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.

            Comment


              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!

              Comment


                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)

                Comment


                  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.

                  Comment


                    Good to hear you got this sorted.

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

                    Comment


                      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.

                      Comment


                        A button on what?
                        Jon

                        Comment


                          Hi John

                          Have you ever consider creating a "Virtual On/Off" device for each Plugin in the system containing the plugin status in the status field instead of having only 2 devices with the drop down ?

                          I know I could manually create regular Virtual Devices and 2 events for all the installed plugin to manage their state but these would need to be maintained as we add or erase plugins.

                          My specific need for this is that I have some plugins that I sometimes have to turn off, actually I connect to my server via browser and manually turn them off. My goal would be to link a virtual device directly on my mobile HomeRemote app.

                          I have no idea how difficult this would be so please don't be offend by this.

                          thanks

                          Comment


                            Good idea but I don't actually monitor a plugin state. The current setup just tells the interface to either enable or disable a plugin blind. Also, as you know some plugins take much longer than others to enable/disable so I would have to constantly monitor their current enabled/disabled state which is not consistent when using a script.

                            Not sure why you say why you need to maintain manually created devices/events. So long as the plugin concerned is not deleted, it should work just fine even if you delete/add others.
                            Jon

                            Comment


                              I see, too Bad the On/Off switch at Plugin level was not build as a standard accessible device or that every plugin designer did not tought their plugin as the Pushover Plugin wich provides it own "Enable / Disable" device

                              You are right, maintenance would only be required for removed/add plugins but my main concern is I would have liked a Virtual Device from wich I could also get the status of the plugin: Running, Error, Stopped

                              thanks anyway

                              Comment


                                Detecting an error state in every plugin would be almost impossible as these could manifest in multiple ways. Most people use one of the HS log monitor available to check for certain messages in the log and use that the disable/enable the respective plugin.
                                Jon

                                Comment

                                Working...
                                X