Beginner trying to Create Rules

Hi,

I installedd openHAB2 on a Buster Raspbian system (up-to-date) based on the openHAB repos with openJDK.
I can access the website and configure items and openHAB sees my enocean USB300 stick and a device I have here, too.

In the openhab console I can see the devices and the change of state (on first attempt it is closed, on second open:

openhab> smarthome:items list                                                                                                                                 
network_pingdevice_192_168_9_31_latency (Type=NumberItem, State=16.0 ms, Label=Pingzeit, Category=null)
enocean_mechanicalHandle_FTB3SXG_FEF70304_windowHandleState (Type=StringItem, State=CLOSED, Label=, Category=null)
enocean_mechanicalHandle_FTB3SXG_FEF70304_contact (Type=ContactItem, State=CLOSED, Label=, Category=null)
openhab> smarthome:items list                                                                                                                                 
network_pingdevice_192_168_9_31_latency (Type=NumberItem, State=16.0 ms, Label=Pingzeit, Category=null)
enocean_mechanicalHandle_FTB3SXG_FEF70304_windowHandleState (Type=StringItem, State=OPEN, Label=, Category=null)
enocean_mechanicalHandle_FTB3SXG_FEF70304_contact (Type=ContactItem, State=OPEN, Label=, Category=null)

So I wanted to create rules for this. As it it just for testing I would see a log entry in openhab.log. So I created /etc/openhab2/rules/tuerkontakt_eltako.rules

rule "Türkontakt Eltako"
when
 Item enocean_mechanicalHandle_FTB3SXG_FEF70304_windowHandleState changed from OPEN to CLOSE
then
 logError("KNEBB", "DoorClosed")
end

I checked the openhab.log and it tells me it read the rules successfully.
But that’s it. When changing the state nothing else happens.

2020-04-23 12:00:13.090 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'tuerkontakt_eltako.rules'
2020-04-23 12:00:14.371 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'tuerkontakt_eltako.rules'

There are no entries from my rules!
In the event.log I can see the events:

2020-04-23 12:52:52.569 [vent.ItemStateChangedEvent] - enocean_mechanicalHandle_FTB3SXG_FEF70304_contact changed from CLOSED to OPEN
2020-04-23 12:52:52.577 [vent.ItemStateChangedEvent] - enocean_mechanicalHandle_FTB3SXG_FEF70304_windowHandleState changed from CLOSED to OPEN

So what am I missing here?

Thanks a lot!

/KNEBB

CLOSE not equal CLOSED, look again at your rule trigger

2 Likes

Oh man! You are the best!

Sorry I did not see this on my own.

Working perfectly now…

THANKS!

/KNEBB