How can I use item state as timer duration?

I want to use the state of an item as timer duration:

createTimer(now.plusMinutes(foo.state) [|
do stuff
]

Try this:

createTimer(now.plusMinutes((foo.state as DecimalType).intValue) [|
do stuff
]
1 Like

Thanks!

Is there a reason why it is not foo.state.toInteger?

Yes, the reason is, there is no such method as .toInteger :slight_smile: