rule "Garage Door Movement Rule"
when
Item Remote_GarageDoor_1_0 received command or
Item GarageDoor received command
then
logInfo("Garage", newState)
end
The event log
2020-07-12 16:33:01.948 [ome.event.ItemCommandEvent] - Item ‘GarageDoor’ received command UP
The openhab log
2020-07-12 16:33:01.949 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘Garage Door Movement Rule’: The name ‘newState’ cannot be resolved to an item or type; line 35, column 23, length 8
The newState implicit variable is only available when the rule is triggered by a state change or update (not command). For your rule, you’d want to use receivedCommand instead of newState, or change the trigger.
rule "Garage Door Movement Rule"
when
Item Remote_GarageDoor_1_0 received command or
Item GarageDoor received command
then
logInfo("Garage", receivedCommand)
end
Whatever you think is going on, that rule would not work. There is no receivedCommand to display.
Make sure you use unique rule “names”, it is not obvious that this is important (or they overwrite each other).
Check in your openhab.log after editing xxx.rules files, to see if the file refreshed successfully (otherwise old rule versions persist)
I’ve discovered the need for unique names the hard way in the past. It’s definitely unique. I’ve also greped the rules folder. There’s no other rules containing the word garage.
I have been checking the openhab log. Upon saving the file it says, “Refreshing model 'garage.rules”.
I can’t explain why it works or why “receivedCommand” did not, but it does.