[SOLVED] Noob question: rules not triggering


I’ve tried to find the answer in the forum, but without success. I hope you will be able to help me.

I’m new to Openhab, but have run Vera3 for many years and are in a transition to Openhab.

Everything seems OK with the installation. I can add items and run everything as expected in the paper UI. I installed the experimental rules engine, which is working OK. However, I quickly found that it’s too limited and wanted to work with .rules files instead.

I’ve created my .items and .sitemap files and have started to play with the .rules files.

Here’s my problem. No matter what I write in the .rules files - nothing happens. It doesn’t trigger anything. If I write LogInfo commands - nothing happens. The openhab.log just says the rule has been loaded/updated. The events.log shows the state change (although not displaying the item name, but the channel name).

I feel I must have missed something, but I can’t figure out what. Any help would be appreciated. Thanks.

Can you post your rule so that someone can peer review it ?

OK, first my default.items

Switch PowerOutlet1 "Fibaro plug bedroom" <light> { channel="ZWaveNode3FGWP101MeteredWallPlugSwitch_Switch" }

Here’s the rule

rule "Test rule"
        Item PowerOutlet1 changed
        logInfo("logOutletState","Power outlet state changed")

I have played a lot with it and tried many different options/log strings/commands, both under when and then…

{ channel="ZWaveNode3FGWP101MeteredWallPlugSwitch_Switch" }

That looks wrong
Go to the paper UI and copy the channel link and paste it in your rules file

Are you saying I should not use the .items file and instead reference the channel in the .rules file? Or did I copy the wrong reference for the channel setting (or some other error)?

I did copy the item name from paper UI.

You need to copy the channel name, not the item name

Isn’t the name I copied the channel name? All items I have defined in my .items files appear correctly in the items section in Paper UI. Doesn’t that mean the channel name is copied correctly? If that’s not the channel name, where do I find the correct one?

I agree with Vincent, that looks wrong for a Channel name. Chanel names are usually all lower case and consist of several fields separated by a colon.

From where in PaperUI did you copy from? That does not look like a Channel but an Item. You will find the Channels under the Configurations -> Things -> Specific Thing

Thanks Vincent.
Changing the channel link did the trick.

Good to know,
Please mark the thread as solved by ticking the solution under the relevant post