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
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
Comment