Can anyone tell me if there is any way that I can test more then two conditions in a single IF AND THEN Statement...
Here's what I'm trying to do, I have Z-wave RF light switches that report their conditions back to HS, Im trying to have HS check the elapsed time of a light, allowing me to know when it has been on for a specified amount of time. I want HS to turn the light off if there is no motion in the room after that specified amount of time.
What I've got so far that does work is, there is an Event that runs every 5 minutes that runs this script, what this script does now is:
1. checks to see if 59 minutes have elapsed
2. checks to see if the light is on or dim
BathRmLight is a variable that is loaded by "hs.Devicetime("Q20")"
BathRmLightStat is a variable that is loaded by hs.Devicestatus("Q20")
Current IF THEN Statement below....
If BathRmLight > 59 And BathRmLightStat <> 3 then
hs.writelog "Timed Lights","Master Bathroom light has been on for " & BathRmLight & " minutes"
hs.speak "Master Bathroom light has been on for " & BathRmLight & " minutes, Turning off in 15 seconds"
hs.Waitsecs 15
hs.ExecX10 "Q20", "off"
end If
What I would like to do, Is make the "IF AND THEN" statement be a IF AND AND THEN" statement, but it doesnt seam to work... I want to add a motion detector to the mix so that the light(s) will not turn off if someone is still in the room.... but when I try to put the Motion Dector in the mix it just doesn't seem to work out..
Perposed, IF THEN Statement below....
If BathRmLight > 59 AND BathRmMotion <> AND BathRmLightStat <> 3 then
hs.writelog "Timed Lights","Master Bathroom light has been on for " & BathRmLight & " minutes"
hs.speak "Master Bathroom light has been on for " & BathRmLight & " minutes, Turning off in 15 seconds"
hs.Waitsecs 15
hs.ExecX10 "Q20", "off"
end If
I'm not a programmer, I've only learned what I know from asking questions on here and trial and error. Please if someone can help me on what I'm trying to accomplish I greatly appreciate it....
Thank You,
Charles
Here's what I'm trying to do, I have Z-wave RF light switches that report their conditions back to HS, Im trying to have HS check the elapsed time of a light, allowing me to know when it has been on for a specified amount of time. I want HS to turn the light off if there is no motion in the room after that specified amount of time.
What I've got so far that does work is, there is an Event that runs every 5 minutes that runs this script, what this script does now is:
1. checks to see if 59 minutes have elapsed
2. checks to see if the light is on or dim
BathRmLight is a variable that is loaded by "hs.Devicetime("Q20")"
BathRmLightStat is a variable that is loaded by hs.Devicestatus("Q20")
Current IF THEN Statement below....
If BathRmLight > 59 And BathRmLightStat <> 3 then
hs.writelog "Timed Lights","Master Bathroom light has been on for " & BathRmLight & " minutes"
hs.speak "Master Bathroom light has been on for " & BathRmLight & " minutes, Turning off in 15 seconds"
hs.Waitsecs 15
hs.ExecX10 "Q20", "off"
end If
What I would like to do, Is make the "IF AND THEN" statement be a IF AND AND THEN" statement, but it doesnt seam to work... I want to add a motion detector to the mix so that the light(s) will not turn off if someone is still in the room.... but when I try to put the Motion Dector in the mix it just doesn't seem to work out..
Perposed, IF THEN Statement below....
If BathRmLight > 59 AND BathRmMotion <> AND BathRmLightStat <> 3 then
hs.writelog "Timed Lights","Master Bathroom light has been on for " & BathRmLight & " minutes"
hs.speak "Master Bathroom light has been on for " & BathRmLight & " minutes, Turning off in 15 seconds"
hs.Waitsecs 15
hs.ExecX10 "Q20", "off"
end If
I'm not a programmer, I've only learned what I know from asking questions on here and trial and error. Please if someone can help me on what I'm trying to accomplish I greatly appreciate it....
Thank You,
Charles
Comment