I have a dry contact binary switch that I am using to do zone control in a heating system by comparing various temperatures.
I have all the control logic working in a script but can't turn the switch on and off inside the script (ie - works fine as an Action).
Here is a simple test script of just the on/off attempt:
hs.WriteLog "Test", "Current device status is " & hs.DeviceStatus("q51")
hs.SetDeviceStatus "q51", 3
where the first line logs a 2 if it is ON and a 3 if it is OFF, so I know I am talking to the right device. The second line seems to cause a log entry saying the device is being set to what it already is (regardless of being a 2 or a 3 or anything in the second line).
I'm sure I'm doing it wrong - how would a single status value of 4(DIM) for instance set a dim level??
Can someone please point me to an example of device control in a script, or explain how to do what I am trying to do above?
Thanks in nadvance,
bob
I have all the control logic working in a script but can't turn the switch on and off inside the script (ie - works fine as an Action).
Here is a simple test script of just the on/off attempt:
hs.WriteLog "Test", "Current device status is " & hs.DeviceStatus("q51")
hs.SetDeviceStatus "q51", 3
where the first line logs a 2 if it is ON and a 3 if it is OFF, so I know I am talking to the right device. The second line seems to cause a log entry saying the device is being set to what it already is (regardless of being a 2 or a 3 or anything in the second line).
I'm sure I'm doing it wrong - how would a single status value of 4(DIM) for instance set a dim level??
Can someone please point me to an example of device control in a script, or explain how to do what I am trying to do above?
Thanks in nadvance,
bob
Comment