Rule optimization: Window OPEN reminder

No, that isn’t a typo.

There is a feature of the language that I absolutely hate because it causes a lot of confusion.

createTimer takes two arguments, a DateTime and a lambda. But the language let’s you define the second argument outside the parens if and only if the last argument is a lambda.

For those who are not familiar with the language, it looks like you are somehow magically associating the lambda with the Timer by putting it after the call.

createTimer(now.plusMinutes(1), [ |
    // some code
])

is a more correct reflection of what is actually going on. So I always put the lambda inside the parens and encourage others who post to the forum to do the same.

How did you declare stopMotionTimer? Is it a val? It needs to be a var.

There is nothing in this code that would generate that error unless stopMotionTimer is a val instead of a var.

Did you create windows.map? You need to create it with a mapping between the Item names and the name you want to include in your spoken message. See Design Pattern: Human Readable Names in Messages.