Announcement

Collapse
No announcement yet.

Learn to create script:

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

  • #31
    Originally posted by ArbWare View Post
    Yes, I use Tenscripting to create and debug...

    Then i copy/paste the working code into a notepad doc.. which i can then put in the script directory....

    Although... i am not sure why i don't share my /Script Directory... i'm not concerned about security behind my router/fire wall.... (maybe i'm naive?)

    I'll have to take a look at that..
    Why not use the tenScripting export file to export your scripts to a temporary directory and then just copy the file from the temporary directory to your script folder. Might be easier than copy and paste, etc. Easiest is to just export to the script folder.
    tenholde

    Comment


    • #32
      Originally posted by tenholde View Post
      Why not use the tenScripting export file to export your scripts to a temporary directory and then just copy the file from the temporary directory to your script folder.
      LOL....

      Because.... I didn't know that was possible?

      That will teach me to to read release notes... or go exploring through menus every once in a while... I don't think that the Export was in the original Tenscripting... and i never read the release notes... even though i did update recently..

      Thanks for the great tool.. and like i said.. i should open my eyes more..
      Regards,

      Andrew B.

      Comment


      • #33
        I get the error on the dateTimeobject. Why?

        Sub Main()
        If DateTime.Now.Hours > 13 Then
        hs.execx10 "Q1","off",0
        end if
        End Sub

        Comment


        • #34
          Originally posted by Dagfinn Andestad View Post
          I get the error on the dateTimeobject. Why?

          Sub Main()
          If DateTime.Now.Hours > 13 Then
          hs.execx10 "Q1","off",0
          end if
          End Sub
          It should be DateTime.Now.Hour (singular)

          If you were entering the statement in VS using tenScripting, intellisense should have made that obvious while you were entering the statement.

          tenholde
          tenholde

          Comment


          • #35
            You are mixing VBScript & VB.NET with the syntax used.

            Sub Main(ByVal Parms As Object)
            If DateTime.Now.Hour > 13 Then
            hs.execx10 ("Q1","off",0)
            end if
            End Sub

            This will run only when the script name has a .vb extension (not .txt)

            If you want to do this in VBScript, it would become:

            Sub Main()
            If Hour(Time) > 13 Then
            hs.execx10 "Q1","off",0
            end if
            End Sub

            This would only run when the script name has a .txt extension
            Jon

            Comment


            • #36
              Wow, old thread comming up.

              You need to create the "hs" object yourself. Just add this line on the top of your file, but after any Class or Module statement:
              Code:
              Public hs As HomeSeerAPI.IHSApplication
              Then reference the hs object all you want.


              EDIT: Hmmm! The post I'm replying to is gone? What gives?
              HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
              Running on Windows 10 (64) virtualized
              on ESXi (Fujitsu Primergy TX150 S8).
              WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

              Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

              Comment


              • #37
                Originally posted by Moskus View Post
                Wow, old thread comming up.

                You need to create the "hs" object yourself. Just add this line on the top of your file, but after any Class or Module statement:
                Code:
                Public hs As HomeSeerAPI.IHSApplication
                Then reference the hs object all you want.


                EDIT: Hmmm! The post I'm replying to is gone? What gives?
                HI Mokus - I was going to try to make my message more clear - but you answered the question immediately - Thank you!

                My original post is below:

                Hi Mokus – I have a very basic question. I use tenscripting for script creation and it is an incredibly helpful tool (thank you again tenholder!). However, I wanted to see if I could setup visual studio for HomeSeer VB.NET scripting independent of tenscripting (just for my knowledge and only to take advantage of IntelliSense to help with syntax). I have created a new VB.NET project and I have added references to HSPI.dll, scheduler.dll and HomeSeerAPI (via solution explorer -> My Project -> references). However I am not able to get Intellisense to recognize homeseer functions like hs.DeviceString(). Not sure what I am doing wrong. If you have this documented already (even if it is in Norwegian :-) ) please point me to it (and I will translate with google) – Thank you!
                Last edited by mstukel; April 5th, 2017, 11:23 AM.

                Comment


                • #38
                  Originally posted by Moskus View Post
                  Wow, old thread comming up.

                  You need to create the "hs" object yourself. Just add this line on the top of your file, but after any Class or Module statement:
                  Code:
                  Public hs As HomeSeerAPI.IHSApplication
                  Then reference the hs object all you want.
                  Mokus - Thank you - this is exactly what i needed. Thank you again!
                  Last edited by mstukel; April 5th, 2017, 11:15 AM.

                  Comment


                  • #39
                    You're welcome!
                    HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
                    Running on Windows 10 (64) virtualized
                    on ESXi (Fujitsu Primergy TX150 S8).
                    WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

                    Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

                    Comment

                    Working...
                    X