Can someone help me with this script. I've done tons of research to get this to work via HS2 awhile ago, I messed with it a little in order to get the file converted but I can't seem to find the matching commands within HS3.
I'm just a little frustrated with HS3 (Scripting wise) I'm sure there is a resolution but I'm at a dead end.
Basically this script / event checks to see if a particular light has been on for a specified amount of time and if there has been any motion for another specified amount of time then turns it off if it detected no motion.
It also warns us over the house speakers that its turning off.
Below is my sample HS2 Script which runs in a recurring event every 1 minute.
I've shortened it to only 1 device to simplify it as I have over 30 z-wave light switches that are in the original script.
My biggest problem is trying to figure out how to get the hs.ExecX10 "Q2", "off" to work.
------------------------------------------------------------------------------------
sub main()
TrackLight = hs.Devicetime("Q2")
TrackLightStat = hs.Devicestatus("Q2")
KitchenMotionStat = hs.Devicestatus("M13")
KitchenMotion = hs.Devicetime("M13")
If TrackLight > 30 and TrackLightStat <> 3 and KitchenMotionStat = 3 and KitchenMotion > 10 then
hs.speak "Track lights have been on for " & TrackLight & " minutes, Turning off in 15 seconds"
hs.Waitsecs 15
hs.ExecX10 "Q2", "off"
end If
end sub
------------------------------------------------------------------------------------
This was an earlier thread that I've posted when I was originally working on it in HS2
http://board.homeseer.com/showthread.php?t=145027
Any help is much appreciated.
Charles
I'm just a little frustrated with HS3 (Scripting wise) I'm sure there is a resolution but I'm at a dead end.
Basically this script / event checks to see if a particular light has been on for a specified amount of time and if there has been any motion for another specified amount of time then turns it off if it detected no motion.
It also warns us over the house speakers that its turning off.
Below is my sample HS2 Script which runs in a recurring event every 1 minute.
I've shortened it to only 1 device to simplify it as I have over 30 z-wave light switches that are in the original script.
My biggest problem is trying to figure out how to get the hs.ExecX10 "Q2", "off" to work.
------------------------------------------------------------------------------------
sub main()
TrackLight = hs.Devicetime("Q2")
TrackLightStat = hs.Devicestatus("Q2")
KitchenMotionStat = hs.Devicestatus("M13")
KitchenMotion = hs.Devicetime("M13")
If TrackLight > 30 and TrackLightStat <> 3 and KitchenMotionStat = 3 and KitchenMotion > 10 then
hs.speak "Track lights have been on for " & TrackLight & " minutes, Turning off in 15 seconds"
hs.Waitsecs 15
hs.ExecX10 "Q2", "off"
end If
end sub
------------------------------------------------------------------------------------
This was an earlier thread that I've posted when I was originally working on it in HS2
http://board.homeseer.com/showthread.php?t=145027
Any help is much appreciated.
Charles
Comment