No viable alternative at input 'OR'

Hey Guys,

just creating a ruleset for my homematic heating.

but I have a probelm and get an error:
2018-10-25 13:33:25.610 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model ‘heizung.rules’ has errors, therefore ignoring it: [54,5]: no viable alternative at input ‘OR’

rule "Sync Thermostat wohnzimmer mode mit CCU2"
when
    Item wohn_heiz_klein_mode OR Item wohn_heiz_gross_mode changed
then
    logDebug("heizung", "New control mode sent by CCU2 is '{}'", 
        wohn_heiz_klein_mode.state.toString);
    wohn_heiz_all_Control_Mode_openHAB.sendCommand(wohn_heiz_klein_mode.state.toString)
	logDebug("heizung", "New control mode sent by CCU2 is '{}'", 
        wohn_heiz_gross_mode.state.toString);
    wohn_heiz_all_Control_Mode_openHAB.sendCommand(wohn_heiz_gross_mode.state.toString)
end

Can anyone help?

I believe you have to write as:

Item wohn_heiz_klein_mode changed 
or 
Item wohn_heiz_gross_mode changed

Thanks for help, butmakes no difference:
2018-10-25 13:44:45.267 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model ‘heizung.rules’ has errors, therefore ignoring it: [54,5]: no viable alternative at input ‘or’

edit:

I changed it in that way, that I created a group which will be triggered:

rule "Sync Thermostat wohnzimmer mode mit CCU2"
when
    Member of gHeizungWZ changed
then
    logDebug("heizung", "New control mode sent by CCU2 is '{}'", 
        wohn_heiz_klein_mode.state.toString);
    wohn_heiz_all_Control_Mode_openHAB.sendCommand(wohn_heiz_klein_mode.state.toString)
	logDebug("heizung", "New control mode sent by CCU2 is '{}'", 
        wohn_heiz_gross_mode.state.toString);
    wohn_heiz_all_Control_Mode_openHAB.sendCommand(wohn_heiz_gross_mode.state.toString)
end

is it working after your edition?

Yes it worked. :wink:

Just for completeness here is how to make your original trigger correct @fr0scher.

when
    Item wohn_heiz_klein_mode changed or
    Item wohn_heiz_gross_mode changed
then

The or needs to be all lower case.

I’m pretty sure that the or cannot be on it’s own line.

Finally, the original was missing the changed for Item wohn_heiz_klein_mode.

I encourage the Group and Member of approach though so don’t change that. I just wanted to have the full solution preserved in the forum.

It’s ok for the or to be on it’s own line. So, this should be ok, too.

when
    Item wohn_heiz_klein_mode changed
    or
    Item wohn_heiz_gross_mode changed
then
2 Likes

yes it works. I always put or in one line to be more clear even