Rule not trigger - Received Command ON

Hello,

I have currently a strange issue.
I have created a Switch and if I switch it from OFF to ON I see in the the log the event “[ome.event.ItemCommandEvent] - Item ‘Rolladen_SonnenSchutz_OG’ received command ON” but the Rule is not triggered. I have similar rules with exactly the same syntax and there it works fine.
Any ideas for this behavior?? Thanks in advance!

The item and rule syntax for your reference.
Item:

Switch Rolladen_SonnenSchutz_OG “Sonnenschutz OG” (Rolladen) { alexa=“Switchable” }

Rule:

rule “Schonnenschutz On OG”

when

    Item Rolladen_SonnenShutz_OG received command ON

then

    var PosValue = Rolladen_SonnenSchutz_Pos.state as DecimalType

    Rollladen_OG_Schlafzimmer.sendCommand(PosValue.intValue)

    Rollladen_OG_Kinderzimmer1.sendCommand(PosValue.intValue) 

    logInfo("Schonnenschutz On OG", PosValue.toString())

end

Does your rules file load? Look in openhab.log

Does your rule have a unique “name”? Else they replace each other.

There’s one issue

rule “Schonnenschutz On OG”

Not

Rrule “Schonnenschutz On OG”

Yes the rule file is loaded

[el.core.internal.ModelRepositoryImpl] - Refreshing model 'MyHome.rules

Sorry, this was a mistake from my side when I copy the rule to the forum. In the rules it wrote with a small “r”.

1 Like

Add another rule

rule "Schonnenschutz test"
when
    Item Rolladen_SonnenShutz_OG received command
then
    logInfo("test", receivedCommand.toString)
end

check openhab.log for load after editing

I have added the new rule:

I checked the log, but no log info but event is fired (->timestamp):

2020-05-18 16:09:40.525 [vent.ItemStateChangedEvent] - Rolladen_SonnenSchutz_OG changed from OFF to ON
2020-05-18 16:09:03.463 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model ‘MyHome.rules’

I got the Error…

I forgot in the rule the “c” in the Item Rolladen_SonnenS"c"hutz_OG received command ON

Sorry for this topic, what a stupid failure.

Thanks for your effort!

2 Likes

It is possible some othe rrule of your has used up all rule threads, and no new rule can start.

Try adding yet another rule - cron triggered rules take threads from a different pool

rule "Clock tick"
when
    Time cron "5 0/1 * * * ?"  // each minute, offset by 5secs
then
    logInfo("test", "ticktock")
end

EDIT, alright, sorted.