Is my OH2 rule engine broken? Nothing happening

I am trying to get to grips with OH 2.1.0 after having stumbled along with 1.8 for a couple of years.
Now I have run into problems with rules. They do not seem to fire at all, not even the simplest.

My item definition is made in Paper UI:

Number    Store_fryk_temp

It works because I can see the number changing in HABPanel and I see changes in the Events log.

Here are two rules:

// rule to test the visibility of items
rule "Log temp change in store"
		Item Store_temp_fryk received update	
			logInfo("Temperature changing: ", Store_temp_fryk.toString)

and here is another:

rule "Persistence Demo"
		Time cron "0 * * * * ?"
			if(Store_temp_fryk.changedSince(now.minusMinutes(1))) {
			logInfo("PersistenceDemo", "2 minutes ago, the temperature was " + Store_temp_fryk.historicState(now.minusMinutes(2)) + " degrees.")

None of them generate any output in the logs. I have also tried with items defined in the .items file from an 1.X binding but no success there either. When updating a rule I also do not get any log entry either, like I did get in OH 1.8 “rule XXX updated”.

For these rules I should not have to define any special imports, right?
What is broken and how to fix it?
I am running Openhabian on an RPi3. Everything else seems to work fine.

What really makes me wonder is the missing log-out while saving.
Where are you saving and what log are you looking at (on the Karaf-Console using log:tail would show the running entries from both openhab and events.log)?

Is this a typo (“Store_fryk_temp” defined, but “Store_temp_fryk”)?

First, It is a typo. The item definition is Store_temp_fryk like in the rules.

I am looking at both logs using Frontail at port 9001: tail -F /var/log/openhab2/openhab.log /var/log/openhab2/events.log

Here is a sample of the output from both logs:
2017-10-26 21:27:03.758 [ItemStateChangedEvent ] - Temperature_bed changed from 20.6 to 20.7
2017-10-26 21:29:21.321 [ItemStateChangedEvent ] - Temperature_bed changed from 20.7 to 20.6
==> /var/log/openhab2/openhab.log <==
2017-10-26 21:32:19.443 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'ib9oh2.items’
2017-10-26 21:32:19.748 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model ‘ib9oh2.items’
==> /var/log/openhab2/events.log <==
2017-10-26 21:32:19.817 [ItemStateChangedEvent ] - Open_fryk_temp changed from NULL to 4.0
==> /var/log/openhab2/openhab.log <==
2017-10-26 21:32:22.995 [INFO ] [ternal.scheduler.WeatherJobScheduler] - Deleting weatherJob-landet
2017-10-26 21:32:23.003 [INFO ] [ternal.scheduler.WeatherJobScheduler] - Deleting weatherJob-Solna
2017-10-26 21:32:23.010 [INFO ] [ternal.scheduler.WeatherJobScheduler] - Starting and scheduling weatherJob-Solna with interval of 15 minutes
2017-10-26 21:32:23.019 [INFO ] [ternal.scheduler.WeatherJobScheduler] - Starting and scheduling weatherJob-landet with interval of 15 minutes
==> /var/log/openhab2/events.log <==
2017-10-26 21:32:23.179 [ItemStateChangedEvent ] - Weather_Direction changed from NULL to NW
2017-10-26 21:32:23.194 [ItemStateChangedEvent ] - Open_solna_temp changed from NULL to 4.00
2017-10-26 21:32:23.201 [ItemStateChangedEvent ] - Weather_WindSpeed changed from NULL to 5.40
2017-10-26 21:32:44.697 [ItemStateChangedEvent ] - Store_temp_fryk changed from 12.5 to 12.3

During this time I updated the .items file as you see @ 21:32:19.748
@ 21:32:44.697 the Item Store_temp_fryk changed but this did not result in any rule firing.

Also using Eclipse SmartHome Designer for the rules, I get an error marking every time for all the Item names, except the first line starting with

when Item Store_temp_fryk received update

The error message is that the method or field is undefined. But i remember reading somewhere that this is a bug in Designer.

I am saving .items and .rules in the directory
Openhab2-conf/Items and Openhab2-conf/Rules

Only if Store_temp_fryk is defined using PaperUI, Habmin, or the REST API some other way. If that Item is in a .items file that indicates a real problem, assuming you are running ESH Design 0.8.

That sounds like you are trying to use version 0.9 of ESH Designer which is hopelessly broken and you should not use it. If you are using 0.8 then something else is going on. Either you have some syntax error further up in the file or you have your files in the wrong folders or something like that.

Since we see Store_temp_fryk updating in events.log we can assume that the Item is defined properly. What do you see when you change and reload the .rules file in openhab.log?

I’m not familiar with these folders. Are they openHABian specific? Typically one saves to /etc/openhab2/items and /etc/openhab2/rules

The error message ‘field is undefined’ appears regardless if the item is defined in .items or in the paperUI.

No, I’m using Designer 0.8.0 on a Mac OS 10.12.6 Sierra
The rules files are as quoted above, there is no other content.
When I reload the .rules files, nothing happens in the log.

Yes they are openHABian specific but they are being mirrored to /etc/openhab2/items and /rules respectively. I have checked that they are there and I have used used ‘nano’ and’touch’ to change the .rules files. No reaction in the log.

If I ‘touch’ the .items file this is immediately reflected in the log.
So maybe there is something wrong with the rules engine. Is there any other way than to re-install openHABian?

That is telling. OH is not seeing your rules files at all.

What are the ownership and permissions on the .rules files? That is far more likely than there being something wrong with Rules Engine. In all the time I’ve contributed to the OH forums (starting way back in 1.6 days) I’ve never seen a problem the Rules Engine simply not working.

First, check the permissions on the files. Then check that the link to /etc/openhab2/rules is set up correctly.

Well, something was broken in my installation.
Re-installing OpenhabianPi from the beginning solved the problem and now everything is working as expected. Thank you for spending time on this!

But… It seems that there is a flaw in Eclipse Smarthome Designer 0.8.0. If I create a .rules file there and store it I get an error message that the file is defective and only contains an EOF. The rule is loaded but is not operative.

Changing the file extension to something else in the Mac Finder and back again or using ‘touch’ or ‘nano’ in the terminal window immediately corrects this problem and the rule starts working. I think this is already known?

Assuming you are editing the file over samba, this is a flaw in samba not ESH Designer. Two file events get triggered for every save, one when the file starts to be saved and another when the file is done being saved. The error you see is generated when OH tries to read the file after the first file change event.