Announcement

Collapse
No announcement yet.

Send Http get via events

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

    Send Http get via events

    I just moved from windows HS3 to Linux (same Serial ID) on a pi3 and I'm now having trouble using hs.GetURL in my events or writing a .vb script. Other Scripts seem to work but I don't run many.

    I'm using "HS3 Standard Edition 3.0.0.297 (Linux)"

    I'm trying to control my Roomba and Blueiris Profiles based off home an away and day and night.

    Problem is I get an error after switching to linux.

    Oct-25 10:10:03 AM Error Compiling script /usr/local/HomeSeer/scripts/BettyClean.vb:
    Oct-25 10:10:03 AM Event Running script in background: /usr/local/HomeSeer/scripts/BettyClean.vb
    Oct-25 10:10:03 AM Event Event Trigger "Test"
    Oct-25 10:10:03 AM Event Event Test triggered by the event page 'Run' button.
    or
    Oct-25 9:56:43 AM Error Compiling script /tmp/K13.vb:
    Oct-25 9:56:43 AM Info Running immediate script: /tmp/K13.vb
    Oct-25 9:56:43 AM Event Running script statement immediately: &hs.GetURL("http://192.168.1.109","/command.json?command=max",True,80)
    Oct-25 9:56:43 AM Event Event Trigger "Test"
    Oct-25 9:56:43 AM Event Event Test triggered by the event page 'Run' button.
    depending if I write my on .vb

    The Url "http://192.168.1.109/command.json?command=max" Starts the roomba just fine from a web browser and used to work on windows HS3.

    I have the same issues when trying to change blueiris profiles

    Oct-24 9:04:25 PM Error Compiling script /tmp/K9.vb:
    Oct-24 9:04:25 PM Info Running immediate script: /tmp/K9.vb
    Oct-24 9:04:25 PM Event Running script statement immediately: &hs.GetURL("192.168.1.100","/admin?profile=1&lock=2&user=XXXXXX&pw=XXXXX",FALSE,9091)
    Oct-24 9:04:25 PM Event Event Trigger "BlueIris AwayDay"
    Oct-24 9:04:25 PM Event Event BlueIris AwayDay triggered by the event page 'Run' button.
    I have tried changing case on the false, chaining to "0" changing ".hs" to ".nhs"

    Anyone see an obvious problem or know of a problem behind the scenes (I'm no good with Linux, maybe a program is didn't get installed?) that could cause this problem?

    Thanks,

    #2
    I just copied/pasted your URL into an immediate script command and it worked fine. Well, it ran, but I dont have a 192.168.1.109 machine, so it died, however, it didnt give me a compilation error.

    The script that HS built with that single line script was:
    Code:
    Function Main(parm as object)
    dim result as object
    result=hs.GetURL("http://192.168.1.109","/command.json?command=max",True,80)
    return(result)
    End Function
    I am also running on Linux, but I am running HS3 Pro instead of Standard edition. That really shouldnt matter since both versions support scripting.

    Can you post the contents of your Config/settings.ini file - specifically, the first line:
    ScriptingReferences=System.Data.DataSetExtensions;System.Dat a.DataSetExtensions.dll,System.Data.SQLite;bin/System.Data.SQLite.dll
    HS4Pro on a Raspberry Pi4
    54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
    Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

    HSTouch Clients: 1 Android

    Comment


      #3
      Originally posted by rmasonjr View Post
      I just copied/pasted your URL into an immediate script command and it worked fine. Well, it ran, but I dont have a 192.168.1.109 machine, so it died, however, it didnt give me a compilation error.

      The script that HS built with that single line script was:
      Code:
      Function Main(parm as object)
      dim result as object
      result=hs.GetURL("http://192.168.1.109","/command.json?command=max",True,80)
      return(result)
      End Function
      I am also running on Linux, but I am running HS3 Pro instead of Standard edition. That really shouldnt matter since both versions support scripting.

      Can you post the contents of your Config/settings.ini file - specifically, the first line:
      ScriptingReferences=System.Data.DataSetExtensions;System.Dat a.DataSetExtensions.dll,System.Data.SQLite;bin/System.Data.SQLite.dll
      Either I'm not looking in the right area or I don't have that line.

      Code:
      [Settings]
      gLastShutdownOK=False
      gFirstTimeRun=False
      gConfigFilename=HomeSeerData.hsd
      gLocLabel=Room
      gLocLabel2=Floor
      bUseLocation2=True
      bLocationFirst=False
      gLongitude=XXXXXX
      gLatitude=XXXXXX
      SADProc=True
      gWebSvrPort=XXXX
      RateUpdated=True
      last_event_time=2016-7-30-10-14-0
      gServerAddressBind=(No Binding)
      gLaunchWebStartup=False
      gStartSpeakerClient=False
      gLogSizeMB=200
      gEnableEnergy=False
      EnablePowerfail=True
      gLastRunVersion=3.0.0.297
      LastDevRef=200
      groupPhysical=False
      io_interfaces=BLBackup:,Blue-Iris:,EasyTrigger:,ImperiHome:,OpenSprinkler:,Sonos:,ThinkingCleaner:,UltraWeatherWU3:,BLLAN:,Caddx:,Z-Wave:,Pushover 3P:
      [Display]
      gSelectedGroupWeb=All Groups
      [IPBlock]
      IPBlock_Enabled=True

      Comment


        #4
        oh wow - that might be the problem.
        • Shut down HS
        • make a backup of your settings.ini
        • add that line I posted
        • Start up HS
        • see if your script compiles


        <cross fingers>
        HS4Pro on a Raspberry Pi4
        54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
        Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

        HSTouch Clients: 1 Android

        Comment


          #5
          Probley also related to not being able to run scripts I noticed during startup I get the following error.


          Oct-25 11:52:33 AM Error Compiling script Startup.vb:
          Oct-25 11:52:32 AM Startup Running the startup script Startup.vb

          Comment


            #6
            Originally posted by rmasonjr View Post
            oh wow - that might be the problem.
            • Shut down HS
            • make a backup of your settings.ini
            • add that line I posted
            • Start up HS
            • see if your script compiles


            <cross fingers>
            Tested that and have same error.

            Comment


              #7
              ouch. That is very strange...

              Can you SSH to the box as user homeseer and type:
              vbnc

              This is the VB compiler with mono.
              You'll either get a 'command not found' or 'file not found'
              I'm curious if you have a mono issue or not.
              HS4Pro on a Raspberry Pi4
              54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
              Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

              HSTouch Clients: 1 Android

              Comment


                #8
                Originally posted by rmasonjr View Post
                ouch. That is very strange...

                Can you SSH to the box as user homeseer and type:
                vbnc

                This is the VB compiler with mono.
                You'll either get a 'command not found' or 'file not found'
                I'm curious if you have a mono issue or not.
                I only use "Root" for everything and never created a "Homeseer" user.

                I'll test now as root.

                Comment


                  #9
                  I received this.

                  root@raspberrypi:~# vbnc

                  Unhandled Exception:
                  System.TypeLoadException: Could not load type 'vbnc.Compiler' from assembly 'vbn c, Version=0.0.0.5943, Culture=neutral, PublicKeyToken=null'.
                  root@raspberrypi:~#

                  Comment


                    #10
                    Well, that explains the scripting issue you're having. vbnc is the VB compiler that HS uses to compile a script. Your vbnc is not working, so scripts are not being compiled.

                    Not sure what to tell you - you either need to find a working image that someone has posted to get you going, or start over and use apt-get install mono-complete which should pick up everything mono-related.

                    I hope someone has posted a Pi3 image somewhere - it would make things easier. I have a Pi3 and havent set it up yet for HS
                    HS4Pro on a Raspberry Pi4
                    54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
                    Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

                    HSTouch Clients: 1 Android

                    Comment


                      #11
                      Originally posted by rmasonjr View Post
                      Well, that explains the scripting issue you're having. vbnc is the VB compiler that HS uses to compile a script. Your vbnc is not working, so scripts are not being compiled.

                      Not sure what to tell you - you either need to find a working image that someone has posted to get you going, or start over and use apt-get install mono-complete which should pick up everything mono-related.

                      I hope someone has posted a Pi3 image somewhere - it would make things easier. I have a Pi3 and havent set it up yet for HS
                      Well I'm not using the pi version but rather the full linux version. I have ran the mono-complete in the beginning.

                      Can I run that now or will that screw everything up?

                      Comment


                        #12
                        Originally posted by integlikewhoa View Post
                        Well I'm not using the pi version but rather the full linux version. I have ran the mono-complete in the beginning.

                        Can I run that now or will that screw everything up?
                        It's hard to say. If you are far enough along, make an image of the SD, then try it out. That way, you can roll back.

                        Also, I would recommend creating a 'homeseer' user that has sudo access.
                        You should never run as user 'root'
                        HS4Pro on a Raspberry Pi4
                        54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
                        Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

                        HSTouch Clients: 1 Android

                        Comment


                          #13
                          Originally posted by rmasonjr View Post
                          It's hard to say. If you are far enough along, make an image of the SD, then try it out. That way, you can roll back.
                          I can do that.

                          Originally posted by rmasonjr View Post
                          Also, I would recommend creating a 'homeseer' user that has sudo access.
                          You should never run as user 'root'
                          Can you give more info on the reasons for this. I'm new to linux.

                          Comment


                            #14
                            Originally posted by integlikewhoa View Post
                            I can do that.



                            Can you give more info on the reasons for this. I'm new to linux.
                            Think of 'root' as the master user that can control the entire OS.
                            A user 'homeseer' would be a privileged user that can do everything that 'root' can do, in addition to running individual programs and processes.
                            HS4Pro on a Raspberry Pi4
                            54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
                            Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

                            HSTouch Clients: 1 Android

                            Comment


                              #15
                              Tried to run the install mono

                              Code:
                              root@raspberrypi:~# apt-get install mono-complete
                              Reading package lists... Done
                              Building dependency tree
                              Reading state information... Done
                              Some packages could not be installed. This may mean that you have
                              requested an impossible situation or if you are using the unstable
                              distribution that some required packages have not yet been created
                              or been moved out of Incoming.
                              The following information may help to resolve the situation:
                              
                              The following packages have unmet dependencies:
                               mono-complete : Depends: mono-devel (= 4.6.1.5-0xamarin1) but it is not going t                                                                    o be installed
                              E: Unable to correct problems, you have held broken packages.
                              root@raspberrypi:~#
                              root@raspberrypi:~# mono --version
                              Mono JIT compiler version 4.6.1 (Stable 4.6.1.3/abb06f1 Wed Sep 28 14:39:46 UTC 2016)
                              Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
                              TLS: __thread
                              SIGSEGV: normal
                              Notifications: epoll
                              Architecture: armel,vfp+hard
                              Disabled: none
                              Misc: softdebug
                              LLVM: supported, not enabled.
                              GC: sgen
                              root@raspberrypi:~#

                              Comment

                              Working...
                              X