Announcement

Collapse
No announcement yet.

Scripting, any basic intro, and full PDF of online manual?

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

    Scripting, any basic intro, and full PDF of online manual?

    to all
    using homeseer basic past year, goiung to get HS2

    am looking at scripting, I am new to HS scripting, but comfortable with scripting/programming elsewhere

    Is there a basic scripting manual, to do intro to HomeSeer scripting?

    and also is there a full PDF version of hte online help manual (the online manual does include scripting, but I'd like to have the PDF of complete online manual, as sometimes if I am reading it, I dont' have access to internet)

    thansk
    Nick

    #2
    You might like to look into the local HS website, wich has a help file. Depending on your configuration you can find it under tools (first entry) or in the main menu itself. Look for scripts. It is mainly following vbs (old) syntax and vb.net syntax, wich I feel more comfortable to use.

    This goes into scripting commands of HS itself. Added information of course is available for visual basic.net wich is on the microsoft sites.

    Wim
    -- Wim

    Plugins: JowiHue, RFXCOM, Sonos4, Jon00's Perfmon and Network monitor, EasyTrigger, Pushover 3P, rnbWeather, BLBackup, AK SmartDevice, Pushover, PHLocation, Zwave, GCalseer, SDJ-Health, Device History, BLGData

    1210 devices/features ---- 392 events ----- 40 scripts

    Comment


      #3
      I highly recomend TenScripting from Tenholder. It is the best thing since sliced bread for HS scripting. It has comand completion and debuging. It is donate ware and has great support

      http://www.tenholder.net/tenWare2/homeseer.aspx

      Comment


        #4
        I do apreciate the replies.
        I don't have HS2 yet, I have the homeseer basic, and am looking for the documentation as to how to integrate scripting into HS2; reading the online stuff has been good, but as noted, there are times when i have time to study this, but don't have internet access.

        but I'm making progress

        QUESTION
        links to microsoft's scripting info, is there a web link (link is broken in the online info) to microsoft's stuff?

        I'll also look at the donate ware also

        My confusion is (without currently having HS2) hw the scripts talk to HS2, and the language and commands that HS2 requires for triggering events, devices, etc

        thanks
        Nick

        Comment


          #5
          HS2 is written for MS .net 2.0 and will run scripts written either in the old vb scripting language, or the preferred vb.net. Scripts are placed into the \Program Files\HomeSeer HS2\Scripts\ folder. If the file extension is .vb, then the script is assumed to be vb.net.

          The HomeSeer scripting commands are found, as stated above, in the Help file undering scripting. Sounds like you've found that.

          To get started with vb.net, download the free Visual Studio Express product from Microsoft. http://msdn.microsoft.com/en-us/beginner/default.aspx

          The link also has a lot of beginners documentation.


          To run vb.net homeseer scripts under Visual Studio so you can easily test and debug them, go to:

          http://www.tenholder.net/tenWare2/tenScripting

          Don't hesitate to ask question here.

          tenholde
          tenholde

          Comment


            #6
            replies are very much appreciated.

            I will go to those sites to peruse info : - )

            thanks
            Nick

            Comment


              #7
              I forgot, one other question on obtaining info from a text file.

              Suppose I have a text file that I am able to create in another program, and it has a value/string in it that I want to use, in homeseer itself
              (example, oregon scientific has its temperature sensors recorded in text file)

              can I use the script function to access that text file, and take action based on the value inside that text file?

              example (for structure, not actual script language)

              if
              TExt file contains 4.0 (centigrade temperature of the basement)
              trigger event "Turn_On_Basement_Relay_01" (which controls a baseboard heater
              end if

              how to read the external text files? I have another scripting program, MacroExpress,which I can use to manipulate the text files, to create one that contains the values I need; question is how to get scripting to access these files, which might only contain one value, to pass to HomeSeer

              thanks

              addendum, I am downloading the Visual Basic express package also, to install

              nick

              Comment


                #8
                See this thread for an example:
                http://board.homeseer.com/showthread...arse+text+file
                💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                Comment


                  #9
                  Rupp,
                  thanks for reply.
                  I see what you are doing, and I can do something similar with the MacroExpress. Now the question is how to pass this to HomeSeer, and I'm getting the gist of the scripting, to just continue with setting this as a value and writing additional script.
                  But I then read this in the online manual, as to how to create an HTML button , to triger an event, or to directly control a device.

                  --------------- from manual
                  You can add buttons to your custom web pages to control devices and trigger events. The following HTML code will run the event named "table lamp on".
                  <form method="POST">
                  <p><input type="submit" value="table lamp on" name="run_event"></p>

                  </form>

                  _______________

                  QUESTION
                  IS there a way to DIRECTLY PASS THIS data to HomeSeer, without using an HTML button; or how does this HTML button, in its own Internet Explorer page, talk directly to HOmeSeer?

                  Comment


                    #10
                    Use the hs.ExecX10 to turn a device on/off. The following sample code toggles the state of the device passed to it as a parameter:


                    Code:
                    Public Sub Main(ByVal Parms As Object)
                            ''
                            '' Toggle the Specified Device ON/OFF
                            ''   DIM is considered ON
                            ''
                            Dim devStatus As Integer
                            Dim theDevice As String
                    
                            '' Get Device from the Parms
                            theDevice = Parms.ToString
                            '' Get the Device Status
                            devStatus = hs.DeviceStatus(theDevice)
                            '' Toggle it
                            Select Case devStatus
                                Case 2, 4, 5
                                    '' Device ON or DIM, turn it OFF
                                    hs.ExecX10(Parms, "Off")
                                Case 3
                                    '' Device OFF, turn it ON
                                    hs.ExecX10(Parms, "On")
                            End Select
                        End Sub
                    tenholde
                    tenholde

                    Comment


                      #11
                      I'll workwith this; I have downloaded the visual basic express package, will install later, and experiment
                      thanks

                      SO, with the ABOVE, you can have that as a vb script, and run it from anywhere, and it would trigger HomeSeer to turn that device on or off?

                      thanks
                      Nick

                      Comment


                        #12
                        Originally posted by aoz View Post
                        I forgot, one other question on obtaining info from a text file.
                        example (for structure, not actual script language)

                        if
                        TExt file contains 4.0 (centigrade temperature of the basement)
                        trigger event "Turn_On_Basement_Relay_01" (which controls a baseboard heater
                        end if

                        nick
                        Just my 2 cents on the example(if this is the real task) above and how to take advantage of HS. In this type setup I would script the temp to get put into a HS device. The use regular HS events to trigger when temp is at a certan value or below. In that way you can adjust the temp without rescripting and use the temp for anything else also. Im my case I turn on or off the heater in the outside CAT box on my pourch and anouance that the cat will now be warm.

                        PS: if you lots of OS RF sensors RFXCOM will recieve them RF into HS directly
                        Attached Files

                        Comment


                          #13
                          thanks fofr reply
                          eventually I will get other sensors.
                          but currently I hav the oregon sensors, and I can use my other scripting to access their data, and if I can figure out how to pass this data to an HS sript or value,then I don't need another HS plugin and an rfx sensor.

                          reason for not wanting the rfx or o ther plugin is that I don't need many more sensors

                          and also, jst to be able to figure out how to pass data back and forth


                          thansk
                          nick

                          Comment


                            #14
                            You could schedule an Event to run, say, every 30 seconds. The Event would run your script. Your script would read the file, and take the appropriate action.

                            tenholde
                            tenholde

                            Comment


                              #15
                              Originally posted by aoz View Post
                              SO, with the ABOVE, you can have that as a vb script, and run it from anywhere, and it would trigger HomeSeer to turn that device on or off?

                              thanks
                              Nick
                              I'm not sure what you mean "from anywhere", but if the script uses HS-specific commands (the ones that begin with 'hs.'), then you will most likely get an error and not see a response from HS. HS uses standard MS scripting, but adds in the HS object with HS-specific functions. As far as I know, these will only work if executed within HS.
                              Mike____________________________________________________________ __________________
                              HS3 Pro Edition 3.0.0.548, NUC i3

                              HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

                              Comment

                              Working...
                              X