[SOLVED] Problem with case and switch in rules

You use received command, this does not ensure that the item state is already set. As this will be done asynchronous.
I won’t go in detail but, that an command was received does not mean that the state of the item which received the command is already processed and set.

Use implicit variables like receivedCommand , triggeringItem to get the state depending to the event that triggered the rule.

Best would be to use received command and receivedCommand

https://docs.openhab.org/configuration/rules-dsl.html#implicit-variables

Have a look at the rules in this examples how to use them.

1 Like