Script error when setting OFF TIMER

Ask and answer questions related to any type of OSA scripting.
Post Reply
Message
Author
mlinnen
Posts: 9
Joined: Sun Nov 29, 2015 3:25 pm

Script error when setting OFF TIMER

#1 Post by mlinnen » Fri Dec 04, 2015 3:43 pm

I am using 4.6 and I am attempting to run a simple script that turns on a z-wave appliance module and then setting the OFF TIMER so that it turns off after a period of time. Here is the script:

Xmas Tree.Run Method.On

Xmas Tree.SET PROPERTY.OFF TIMER = 10

I know that 10 seconds is a silly time but I was just using that value to see if my script was working. The Xmas Tree turns on fine but after 10 seconds the tree does not turn off. In the logs I found the following error when the script runs:
Error RunScript - Length cannot be less than zero. Parameter name: length

If I move the SET PROPERTY command to the first line of the script it will run without causing the error and it will also set the OFF TIMER property to 10. Also if I just swap the 2 lines the Xmas Tree will turn on and then go out after 10 seconds so technically this achieves what I wanted the script to do anyway.

This works:
Xmas Tree.SET PROPERTY.OFF TIMER = 10
Xmas Tree.Run Method.On

So my question is why would I be getting a script runtime error if I call the SET PROPERTY last in the script?

Post Reply