I'm trying to simplify a bit and attempting to use a script to write a device string to one device, depending on what is on or off with 4 other devices.
This one doesn't return any errors but it doesn't quite work either. I'm thinking my mistake is with the "ISOff" portion. Either i should be using something else, or I am using it incorrectly.
Can someone point me to my error, please?
PHP Code:
sub main()
if hs.IsOn("V2") then
hs.SetDeviceString "V60", "Mornings", True
end if
if hs.IsOn("V61") then
hs.SetDeviceString "V60", "Days", True
end if
if hs.IsOn("V62") then
hs.SetDeviceString "V60", "Evenings", True
end if
if hs.IsOn("V63") then
hs.SetDeviceString "V60", "Nights", True
end if
if hs.IsOff("V2"&"V61"&"V62"&"V63") then
hs.SetDeviceString "V60", "Silent", True
end if
end sub
Can someone point me to my error, please?
Comment