Everything works when i Write:
„Transition: 1“ directly
But it has to be dynamically set… that is the sense. Different transition times per situation (not mentioned in the script)
I’m not very experienced with variables, but I’m pretty sure the variable now only exists in the then block, not outside it. Variables need to be defined at the top level to be able to use then troughout the script.
See this for more detail, especially the bit about scope: