Announcement

Collapse
No announcement yet.

Need help converting fro HS2 script

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

    Need help converting fro HS2 script

    I'm still new to HS3 / 4 and trying to learn.

    I had used the below while using HS2 to send a message to the sign when the garage door status changed but now that I've finally moved into the 21 century, I need some help with how to format this to run in BLLED/

    Any help is greatly appreciated.

    The old script is below



    Garage_door_to_LED.txt


    sub main()

    ' This script is triggered when the garage door sensor (a normally open
    ' magnetic contact switch from Radio Shack, part #49-533, wired to a
    ' PowerFlash configured to input B mode 3) sends a code (either on or off).

    Dim lastcmd
    Dim msg

    lastcmd = hs.StringItem(hs.LastX10(),3,";")
    if lastcmd = 2 then ' On -- means the door is now closed

    hs.WriteLog "Garage","GARAGE DOOR OPEN"
    hs.PlayWavFile "C:\Program Files (x86)\HomeSeer HSPro\wavs\horn.wav"
    hs.Speak "Warning! The garage door is now open!"
    msg = "{extchar=Car}{font=seven}{color=red}{flash=1} Garage Door...{transition=hold}{flash=0}"
    msg = msg & "{color=yellow}is now OPEN{transition=CompressedRotate}"
    hs.RunEx "Snevl_bb.vben","queue_msg","1|A|12|" & msg
    hs.SetDeviceValueByName "Garage Door",100
    hs.SetDeviceStringByName "Garage Door", "Open"
    ' if there are any pending events to open it, cancel them
    ' close it in thirty minutes
    ' hs.DelayTrigger 1800,"Close Garage Door"

    elseif lastcmd = 3 then ' Off -- means the door is now Closed

    hs.WriteLog "Garage","Garage door closed."
    hs.Speak "The garage door is now closed."
    msg = "{extchar=Car}{font=seven}{color=red}{flash=1} Garage Door...{transition=hold}{flash=0}"
    msg = msg & "{color=yellow}is now CLOSED{transition=CompressedRotate}"
    hs.RunEx "Snevl_bb.vben","queue_msg","1|A|12|" & msg
    hs.SetDeviceValueByName "Garage Door",0
    hs.SetDeviceStringByName "Garage Door", "Closed"

    else ' Some other code -- don't know what this means!

    hs.WriteLog "Garage","Garage door sensor sent unknown command " & hs.LastX10

    end if

    end sub



    #2
    Most of the script has nothing to do with sending messages to the sign. The script calls another script (snevl_bb.vben) that must be doing the actual interfacing with the sign. I can post some script snippets that work with Blade’s plugin if needed, but check the help file first as it has some good examples.
    HS 4.2.8.0: 2134 Devices 1252 Events
    Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

    Comment


      #3
      Thanks for the response.. I’ll check the help files and try to figure it out. I WOULD LOVE TO SEE SOME SNIPPETS as I’m hoping to also show the now playing information while using Plex..

      Comment


        #4
        I used to use those Snevl_bb scripts myself but the author didn't update his original HS2 scripts to HS3 and unfortunately didn't release his source.
        Left with that predicament many many moons ago, I went for Blades plugin and it does everything that you'll need.

        As Sparkman says you'll need swap these repeated lines out with equivalents:
        hs.RunEx "Snevl_bb.vben","queue_msg","1|A|12|" & msg

        You'll then need to make sure that the lines that build the message strings, 'msg = ' all use Blades format, but it is very similar to Snevl_bb.
        Just copy some of the examples and just practice sending test messages from another simple test script.
        Once that's all working it should be easy to swap the necessary lines out.

        Comment


          #5
          Originally posted by gelessor View Post
          Thanks for the response.. I’ll check the help files and try to figure it out. I WOULD LOVE TO SEE SOME SNIPPETS as I’m hoping to also show the now playing information while using Plex..
          There are some examples posted in this thread: https://forums.homeseer.com/forum/ul...scripting-help
          HS 4.2.8.0: 2134 Devices 1252 Events
          Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

          Comment

          Working...
          X