OH 2.1 reports an error on the rule below:
` Configuration model ‘kodi.rules’ has errors, therefore ignoring it: [7,3]: no viable alternative at input ‘case’ [10,8]: no viable alternative at input ‘default’
This rule worked as a charm in OH2.0, can’t get it to work… Help is appreciated
`
rule "Kodi Movie"
when
Item pi2mediatype received update
then
switch (pi2mediatype.state) {
case "episode",
case "movie" : {
sendCommand(SchemerLampC,"0,0,0")
}
case default : {
sendCommand(KamerScene, KamerScene.state)
}
}
end
I would guess the message is complaining about no action for that case. Is a comma really appropriate there? I think I have seen
case “episode” : break
for a do-nothing case
Then the rule is accepted without errors but does not work… Once it hits the default case it says: 2017-07-12 22:14:00.595 [ERROR] [.script.engine.ScriptExecutionThread] - Rule 'Kodi Movie': An error occurred during the script execution: Could not invoke method: org.eclipse.smarthome.model.script.actions.BusEvent.sendCommand(org.eclipse.smarthome.core.items.Item,java.lang.String) on instance: null
I am getting a bit annoyed that I have to do work to make a previously working rule work, because I upgraded…
Did I miss an announcement when upgrading? Did it mention rules might need to be changed?