Trying to use a Global Variable in an App. Can't seem to figure out where I'm going wrong. From what I can read, this code should work, but it errors out.
getGlobalVar() returns a GlobalVariable object, not the value itself. This object has a getValue() method, or, equivalently in Groovy, a value property, which should return the value you're looking for--and be of the appropriate type. So, use fanOnTime.value or something along those lines.
If that doesn't help, logs of the actual error you get would be helpful.