Announcement

Collapse
No announcement yet.

HS Scripts What type and what editor?

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

    HS Scripts What type and what editor?

    What type of scripts is HS using VBScript, JSscript, HWS.
    I have reading all I can to try and use a script enigine if that is what is called. I want to be able to edit and run a script
    without having to use the event console interface to test them. Just way to many "clicks" to edit test edit test edit
    test. I have even tried to use command console "dos"
    go to my dir and type Wsript.exe New_Scripts_8.js "the file names or .vbs. Yes I have saved these scripts with those different exts.
    I have a hard believing people are creating these cool scripts
    with just notepad editor then calling them up in events and testing them. Seems slow.
    Michael

    #2
    Michael,
    The easiest way to write a vb script is to use the Microsoft's Visual Basic editor. this way you can instantiate the HS object and the VB environment gives you all the properties and methods via the intellasense display. Another way is to use notepad and write the script and always have the HS log window up by right clicking on it and selecting "Display in new window". This way you click the test button on an event and the information is presented with out exiting the event and going to the log view.
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      Only Way?

      Rupp , are you saying that is the Only WAY?
      Therei is no other way to some how run a software app that can edit and run scripts that communicate or instruct hs
      to do things. Where do you find Microsoft Visual Basic Editor?
      I have look and down load three or four editors for VB from MS web site one is called VB5.6. But I think they have switched to VB NET orsomething like that.
      Your suggestion to have the log open in hs and the notepad
      and make changes yes would work but seem like the only reason anyone would stay that way is just to be only using hs to debug. In other word seems like a non user friendly way of editing scripts for non programmers.
      Is this what I should be looking into?
      http://msdn.microsoft.com/library/de...ist/webdev.asp

      Michael

      Comment


        #4
        Michael,
        The ways I listed are by no means the only way it's just the ways I know. I believe that Jim DooLittle put together a vb editor for HS at one time and I also believe that the message server has some type of an editor but don't quote me on that because I do not use those.
        💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

        Comment


          #5
          Originally posted by mjbarker
          I have a hard believing people are creating these cool scripts
          with just notepad editor then calling them up in events and testing them. Seems slow.
          That's exactly what I'm doing (although I don't know if most of my scripts would be called cool).
          With the log showing in a separate window the way Rupp describes, it's really not that slow. When testing, I usually add a new event to get the event form to show up, type the "command" to run the script into it, and click the "Test" button to test it. If you leave that form up, it's only one click.

          So the "loop" is:
          1) Make changes in notepad.
          2) File -> Save in notepad.
          3) Click "Test" button on event form.
          4) Look at log to see if there are errors.
          Repeat as necessary.

          Comment


            #6
            I had some pain points, too about debugging script files. After working all day in an IDE with so many features and functionality, I was really put-off with having the log window and a TEST button on a palmpad. As I started doing it that way, I eventually grew accustomed to it. Now, developing scripts is as easy as opening textpad and using my palmpad and the HS log window.

            It would be cool to have the IDE, but developing this way will work too.

            Hope this helps.
            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


              #7
              Script Texting and editing...

              I do the same thing. When I am writing a script, I set up a palpad button to the event to run the script. When I am coding and want to test it, I simply press the button on the palm pad. With the HS log file in a new window on the lower portion of the screen, and the text editor of your choice on the upper part, you will never have to switch windows and see everything on the screen at once.

              As for a good Text Editor, I use ConText, It is a FREE replacement for notepad, that color codes the text, and has more options that you could ever want, but is also very simple to use. Most importantly it has line numbers (have to turn the option on), you can read more about it in another thread HERE
              Last edited by johnwpb; January 20, 2005, 06:04 PM.
              Visit My Home Seer Site at:
              www.JohnWPB.com
              Created with LCARS

              Comment


                #8
                Originally posted by johnwpb
                I do the same thing. When I am writing a script, I set up a palpad button to the event to run the script. When I am coding and want to test it, I simply press the button on the palm pad.
                Me too. Like the previous two posts, I will use a palmpad to test scripts. Whether I do or not depends on how involved the scripts are and how many iterations I expect to go through while testing. There's always a palmpad on my desk.

                Comment


                  #9
                  Editors

                  The Message Server editor is really handy, I have never written a script from the console of the hs server, I do it on my desktop machine. The MS editor has a run button to test the scripts, no event to setup until required and the only drawback I have found with this setup is if a vbdialog pops up on the HS server I have to actually turn around in my chair and acknowledge it. (Wow, sounds kinda lazy when I type it out like that.) I have "tweaked" many a script from work with the client side editor.

                  Later, Tman1

                  Comment


                    #10
                    Vi

                    gVIm-- the only way to go.
                    HS3 Pro Edition 3.0.0.435 (Windows Server 8.1 on ESXi box)

                    Plug-Ins Enabled:
                    Z-Wave:,RaspberryIO:,AirplaySpeak:,Ecobee:,
                    weatherXML:,JowiHue:,APCUPSD:,PHLocation:,Chromecast:,EasyTr igger:

                    Comment


                      #11
                      Hey, just have two monitors set up on your desktop. The bigger/nicer monitor has notepad in front of the HS app that's in Log view so I can see what's going on. The other monitor just has the HS web interface open where I can easily go over and hit the Run button and see the log updating in real time on the first monitor. Works NICELY for me. I got lucky and found a 64Mb ATI dual headed card a few months ago for around $30 somewhere out there. Once you get used to actually working with two monitors you wonder how you ever did it before.

                      Comment


                        #12
                        HSC Command line syntax

                        I have resently discovered Command line hsc.exe.
                        So now I can call scripts and other HS commands. This works
                        great for my experimnets.
                        But I am having problems with some direct control commands. For example.
                        A3 OFF works or A3+4+5+6 ON etc or OFF etc works.
                        But the command line for all A Lights OFF or ON or ALL A
                        Units OFF or ON does not work. I must not have the correct
                        syntax. I have looked in all hlp files that I can find and have tried multble commands. Nothing. But individual command ON and OFF works.
                        So could someone send or submit the complete correct
                        command line syntax.
                        Having to guess through this is frustrating.
                        Michael

                        Comment


                          #13
                          HSC command line running scripts

                          I am currntly developing a website front end in PHP for my final year project at university and there is something that I'm trying to do. I am hoping that I will eventually be able to control most things from my own webpage, anyhow I have wrote a script which will look for a device and then change the house code and type

                          sub main()
                          dim dev_count
                          dim I
                          dim device

                          dev_count = hs.DeviceCount ' get total number of devices

                          for i=1 to dev_count
                          set device = hs.GetDevice(i)
                          if device.name = "landing lamp" then
                          device.DC = "9"
                          device.hc = "A"
                          device.dev_type_string = "Lamp Module"
                          end if
                          next


                          end sub

                          very straightforward code and it works when I run it as an event, I have written other simple HSC commands which turn off lights and things and they work fine but Im not sure of the exact syntax with this, can anyone help?

                          Cheers
                          Stu

                          Comment


                            #14
                            Stu,
                            I'm not sure about PHP but asp uses the exact same code you posted. I assume your trying to run the php pages on a server aside from the built in HS web server. Is this true? If so you will need to instantiate the HS.exe inside your php web page in order to "get at" the methods and properties of the HS object. In an asp page this is accomplished using something like this:

                            PHP Code:
                            set hs server.createobject("HomeSeer.Application")
                            Response.write hs.sunrise
                            Response
                            .write hs.sunset 
                            💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                            Comment


                              #15
                              Thanks

                              Rupert,
                              all I was having trouble doing was getting command line to actually to run a script, becasue I have to have the main hsc.exe file in the same location as all my bats I had forgot about the hsc help file which tells you how to run scripts. all I have done now is

                              hsc -sr "C:\Program Files\HomeSeer\scripts\changedevice.txt"
                              this then calls my script written above and makes the changes.

                              I will eventually be trying to add new devices from my website which I will call the default add a newdevice and add a standard name and code ie (new, A1) and then automatically run the getdevice and update it with parameters that will be passed from my website, I am thinking that I may have to just edit the text file using paramters passed from a form and then run my bat file but not exactly sure yet if thats the best way to do it.

                              I am teaching myslef the PHP as I go along!

                              Cheers
                              Stu

                              Comment

                              Working...
                              X