Announcement

Collapse
No announcement yet.

Insteon Thermostat script issues, Linux

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

  • Insteon Thermostat script issues, Linux

    I'm running HS3 on an RPI and run into the following errors:

    Feb-24 19:40:23
    *
    Error
    Compiling script /home/pi/Downloads/HomeSeer/scripts/dump.vb: http://mono-project.com/Bugs)
    Feb-24 19:40:23
    *
    Error
    Compiling script /home/pi/Downloads/HomeSeer/scripts/dump.vb: Namespace or type specified in the Imports 'System.Core' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.
    Feb-24 19:40:20

    *
    Event
    Running script in background: /home/pi/Downloads/HomeSeer/scripts/dump.vb
    Feb-24 19:40:20
    *
    Event
    Event Trigger "Email Request Dump Status"
    Feb-24 19:40:20
    *
    Event
    Event Email Request Dump Status triggered by the event page 'Run' button.

    Here's the VB code:
    Dim thermostatName As String = "Thermostat"^M
    Dim hvacName As String = "HVAC"^M
    ^M
    Dim pluginName As String = "Insteon Thermostat"^M
    Dim Instance As String = ""^M
    Dim plugin As Object = New HomeSeerAPI.PluginAccess(hs, pluginName, Instance)^M

    ^M
    Dim mode As String = plugin.PluginFunction("GetMode", {thermostatName})^M



    HomeSeer version: HS3 Standard Edition 3.0.0.297 (Linux)
    Insteon Plugin: 3.0.6.0
    Insteon Thermostat Plugin: 3.0.5.3

  • #2
    I don't see anything obvious other than you probably need to run dos2unix on that vb file to remove all those ^M line terminations. I would start by reducing this to a line or two of your initial variable declarations to see if you can get that much working then add in additional lines until you arrive at the part that triggers this error.

    There's a good forum on the board for HS3 about script development at https://forums.homeseer.com/forumdisplay.php?f=774 This question seems more generically about getting your initial script to run than something specific to this plugin.

    Nathan
    HS 3.0.0.435 (PRO)
    Hardware: Napco GEM-P9600 | VenstarT1800 w/Insteon 2441V adapter | Insteon PLM
    Plugins HS3: Napco Gemini (mine) | Insteon Thermostat (mine) | Insteon Plug-in (mnsandler) | HSTouch Server (HST)
    Platform: Windows 10 Pro 64bit, core2 duo 2.0Ghz, 4GB memory
    http://www.kazteel.com/

    Comment


    • #3
      Here's the line tat triggers the error:
      Dim mode As String = plugin.PluginFunction("GetMode", {thermostatName})^M

      Note that these errors are only encountered when accessing the Insteon Thermostat plugin API, so I'd be surprised if the ^Ms are the culprit. Is there something different about that API in Linux environments?

      Terry

      Comment


      • #4
        I have been able to reproduce the same error on that same line with my Linux virtualbox. Don't know yet if this is a mono compatibility issue or what. I'll be looking into it more on Friday. It will require some research.

        Nathan


        Sent from my iPhone using Tapatalk
        HS 3.0.0.435 (PRO)
        Hardware: Napco GEM-P9600 | VenstarT1800 w/Insteon 2441V adapter | Insteon PLM
        Plugins HS3: Napco Gemini (mine) | Insteon Thermostat (mine) | Insteon Plug-in (mnsandler) | HSTouch Server (HST)
        Platform: Windows 10 Pro 64bit, core2 duo 2.0Ghz, 4GB memory
        http://www.kazteel.com/

        Comment


        • #5
          Thank you!

          Nathan,
          Many thanks for taking the time to help me with this! This code was used previously on my Windows installation, so hopefully we can get it working on my Linux installation as well. Please note that ALL of the Insteon Thermostat API accesses in my code exhibit this same type of error.....I only provided the first instance to simplify things. I suspect there is a common issue among all of them. I'll be very happy to beta test your proposed solution when ready....just let me know!
          Terry

          Comment


          • #6
            Ok, I have a fix that is working for me and it's pretty simple. You can see a thread over here where I was asking for help and then documented my solution.

            The short answer is to add New Object() in front of the array of parameter(s) you pass to PluginFunction.

            Change

            Code:
            Dim mode As String = plugin.PluginFunction("GetMode", {thermostatName})
            to

            Code:
            Dim mode As String = plugin.PluginFunction("GetMode", New Object() {thermostatName})
            Give this is a shot and let me know if it works for you. I believe other plugins that require parameters to be passed in via a VB script to PluginFunction would have this same issue on Linux. Only those with a simple method name call with Nothing for parameters would avoid it.

            I will be releasing 3.0.6.1 to the BETA updater. It has no functional changes for this so you don't need to get it. I just updated the example scripts adding the New Object() in front of { } parameters so they script can work on windows and linux.

            Thanks!
            Nathan
            HS 3.0.0.435 (PRO)
            Hardware: Napco GEM-P9600 | VenstarT1800 w/Insteon 2441V adapter | Insteon PLM
            Plugins HS3: Napco Gemini (mine) | Insteon Thermostat (mine) | Insteon Plug-in (mnsandler) | HSTouch Server (HST)
            Platform: Windows 10 Pro 64bit, core2 duo 2.0Ghz, 4GB memory
            http://www.kazteel.com/

            Comment


            • #7
              All's well!

              Hi Nathan,
              Indeed this fixed the problem. Many thanks!
              Terry

              Comment

              Working...
              X