OH2 Rule Designer - How can i check my rules?

Hi, i want to check my rules to see if there is an error in it.

I changed from OH2 stable 2.0 to snapshot 2.1 and now i get many errors in the logfile. I corrected most of the errors, but some still remain and i don´t know why.

I have looked into HABmin rule designer, but how can i check my rules? It´s only an editor and i don´t know how to start the spell checking for correctness of the rules.

The syntax check is running (automatically) in the background so there is no need for you to start anything. If there is a problem with a rule that is open in the editor window, you will see an indication (a red circle with a cross, as I remember) at the start of the line in question.

Please note that there are some false negatives (i.e. the Designer complains on a few things that are actually syntactically correct) and I presume that there may be some false positives as well (i.e. stuff that the designer does not catch).

All-in-all, IMO the syntax checking that is done is of great value when I write rules.

Another tip: Pressing Ctrl-Space in the Designer will (attempt to) bring up a list of possible completions, for instance if you are positioned on a variable that represents a class, you will get a list of the methods of the class. Again, this may be of good value to you when writing rules.

My problem is, that since the change to snapshot version i get errors in some of my rule files and i don´t know why.

They worked in OH2 2.0 without Problems. I made some updates to the rules to make them OH2 2.1 compatible, but some rules still have errors with strange error messages…

2017-03-02 08:28:59.855 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'strom_state_machine.rules' has errors, therefore ignoring it: [148,24]: mismatched input '<EOF>' expecting '}'

But the rule looks good.

I also divided some rule files and then some errors were gone. When i put them together agein, some wired errors are comeing up again. ???

When i see this:

mismatched input '<EOF>' expecting '}'

I think it begs the question what Editor you are using on which OS.
Almost willing to bet you are using an editor under Windows; because this looks like you have a codepage problem resulting in non-visible(in the editor) characters that OH interprets as "file ends here, nothing more to do"
I would recommend checking your files for the right codepage. Should be ANSI IIRC but better check the forum…

I use notepad++ on Windows10. All my files are encoded in UTF-8 without BOM.

I need a codepage which shows german umlauts (ä, ü, ö).

When i open the rule-file in the HABmin Editor, there is exactly the same. No additional non-visible characters.

So in Notepad++ Ansicht, nicht druckbare Zeichen, alle Zeichen anzeigen
Shows no eof or crlf where it not belongs?
Hmmm…Just to be save than sorry I would:

  • rename File on Server
  • on Server, create new File with vi
  • copy File content in Notepad++
  • Paste into vi
  • save, quit vi and retry…

There is only CR LF on every end of the line. No EOF.

I changed that to UNIX-Settings, so now there is only LF on every line.

But the error still exists.

I will do the steps with vi or nano.

I am not familiar with the Habmin designer, but did you try the Eclipse SmartHome Designer:
Just make sure you install ver 0.8 (0.9 is currently broken); it will give you a lot of syntax help

Oh my! Apparently I did not read the original post quite as thorough as I should have. I completely missed the fact that this was a question about the rules editor in HABmin. I thought it was about the Eclipse Smarthome Designer.

Needless to say my answers/comments in post #2 are nowhere near relevant to the question asked, :frowning: Sorry about creating confusion!