I have the following code as a tag event script on a temperature tag
value = int(currentValue.value)
tagPath = "[~]_Sample_Device_/Writeable/WriteableBoolean1.value"
lowerLimit = system.tag.read("[~]lowerLimit.value")
upperLimit = system.tag.read("[~]upperLimit.value")
if value > upperLimit:
system.tag.writeAsync([tagPath], [0])
elif value < lowerLimit:
system.tag.writeAsync([tagPath], [1])
I’m trying to get the code to use two number entry boxes to set an upper/lower limit at which to switch on/off a heater.
The above code is not working but if I replace the limits in the code with numbers like this:
value = int(currentValue.value)
tagPath = "[~]_Sample_Device_/Writeable/WriteableBoolean1.value"
if value > 28:
system.tag.writeAsync([tagPath], [0])
elif value < 23:
system.tag.writeAsync([tagPath], [1])
It works.
What am I doing wrong?