OpenHab2 graphical rules

Hi there all,
I just try to use the wonderfool graphical rules of the OpenHab2 in the BAHMin panel.
The problem is that it no generate source code… is that normal please ?
Also if I save the graphical source… i did’t find it in the rules folder under /etc/openhab/rules

Thanks in advance

I think this statement is still true

some of this isn’t mature (eg the graphical rule editor)

1 Like

Ok …I understand
But is there possibility to code rules via web site please ?
I just want to play it with during my officeday via web site.

Thanks again

Never tried that, but maybe this works:

Try the experimental rule engine

and access it through the cloud connector using myopenhab

1 Like

I allready try it … but I think is not save the rule.
Thanks anyway :slight_smile:

Graphical rule engines normally don’t save to any files, that is because they are graphical :grinning:

Ok … but after I make the graphical, what I must do after, inorder to make it functional ?
Thanks again

Save it and thats it.

Let’s make an example:

Click on the plus sign in the rule editor
Click on “New Rule”
Give that rule a name, for example test
Click the plus sign besides “When …”
Chose a trigger, let’s try “an item state changes”, click on “Next”
Select an item, in this test case I’m choosing a motion sensor
Click on “State” and choose the state for the previous choosen “an item state changes”, so in this case we want “On”
Click OK

Now let’s go to the “then …” part:
We want to send a command to a light when motion triggers, so choose “send a command”
Click on next
Choose the item you want to send a command to, in my case it is a relay for a light
Click on Command and then ON
Click okay
Click on the blue checkmark on top of the rules editor, that saves the rule

Now trigger the motion sensor and the light should come on (it actually does, I tried it).

If you don’t want to trigger the motion sensor, you may execute the rule manually: click on the “Play” sign right next to your rules name, the rule gets executed.
If you want to disable the rule, click on the “Clock” sign, voila, disabled.

Those rules are saved in your json db folder, but there is no need to edit those files manually: automation_rules.json

1 Like

Thanks a lot for your help
I just do all the rule but then, when I click the blue checkmark I had a little message in the botom right angle
like “rule saved” but then I didn’t see the rule (like in your picture)
All page was empty…

Anyway I found the automation_rules.json file… and my rule is there.
I then close and reopen PaperUI and I fount my rule :slight_smile:

Thanks again

1 Like

I’m new to openHAB, and I’m having a similar experience with rule editing in the PaperUI as described by the OP.

I’ve created a simple rule to turn off three lights at 11pm. In creating the rule I accidentally created an action to turn one of the lights ON rather than OFF at that specified time. Oops.

So, I’ve clicked on the rule to edit it. This action opens the rule for editing. I’ve then clicked the cog icon on the incorrect action in the THEN clause of the rule, and changed the command being sent to OFF. Saved the action by clicking OK. And then save the rule by clicking the blue tick at the top of the page. I get a message displayed briefly at the bottom of the page indicating that the rule has been saved.

However, the rule has NOT been saved. If I open the JSON rule representation at /homes/openhab/userdata/jsonb/automation_rules.json I find that the rule has NOT been updated. Further, if I open the rule again in the editor I find that it hasn’t changed either.

My installation is on a Synollogy NAS DS412+ (DSM 6.1.6-15266 Update 1). I installed openHAB (on volume1)

When I view the logs, I don’t see any error from saving the rule. In fact, the event.log updates with a sequence of messages claiming that the rule was updated, INITIALIZING, and then IDLE.

However I do see that there is an error near the start of the log claiming that openHAB can’t generate a new SSL certificate when it was first installed and started. Now, I have the Java 8 from Synology installed. Do I need to install further cryptographic software to get the EC KeyPairGenerator? And could this be the root of my problem?

Even so, how did it manage to save the rule in the first place?

All help gratefully accepted.

Cheers, S t u a r t .

PS: I find the file system layout confusing for openHAB on the Synology. It appears to be installed in:
/volume1/homes/openhab (owned by root)
This directory has three sub-directories named addons, conf, and userdata.
The addons directory contains just a README file.
The conf directory contains a whole bunch of sub-directories, including a rules sub-directory (which again just includes a README)
And the userdata sub-directory contains a bunch of things including jsonb/automation_rules.json. There is also a backup sub-directory in the jsonb sub-directory which appears to get a copy of the rules every time I save them - with the correction!

What’s really going on here?