I cannot get a simple script to turn a light device on or off even though the script does change the value of the device.
'Study is Location 1 and SpotLights is the device name
hs.SetDeviceValueByName("Study SpotLights", 100)
I write the device value to the log from the script and it shows the value change to 100 (from 0)
Also, I have a hstouch label displaying the value and the value shown in the label changes from 0 to 100
hs.SetDeviceValueByName("Study SpotLights", 0)
I also have a test script to turn off the light as shown above.
The light does not turn off with the above script even though the value changes to 0.
I can turn on or off the light from the device home page or from a hstouch label that when released toggles the device
I also tried hs.SetDeviceValueByRef(50, 100, True) and hs.SetDeviceValueByRef(50, 0, True)
Same result as using set value by name, the light does not turn from off to on or from on to off, but the value changes.
Any help would be very much appreciated.
'Study is Location 1 and SpotLights is the device name
hs.SetDeviceValueByName("Study SpotLights", 100)
I write the device value to the log from the script and it shows the value change to 100 (from 0)
Also, I have a hstouch label displaying the value and the value shown in the label changes from 0 to 100
hs.SetDeviceValueByName("Study SpotLights", 0)
I also have a test script to turn off the light as shown above.
The light does not turn off with the above script even though the value changes to 0.
I can turn on or off the light from the device home page or from a hstouch label that when released toggles the device
I also tried hs.SetDeviceValueByRef(50, 100, True) and hs.SetDeviceValueByRef(50, 0, True)
Same result as using set value by name, the light does not turn from off to on or from on to off, but the value changes.
Any help would be very much appreciated.
Comment