Just in case anyone is reading this looking for a solution and the above didn’t help: I have additional information.
I’ve been scratching my head over this for a long time now. I’m running openHabian and am using a Mac and VS Code. Even after scouring my .rules files for blank lines or extra spaces this error just wouldn’t go away. Then it dawned on me that it might be some problem with file encoding. I then did the following for every file, using VS Code:
- Copied the code
- Created a new file (right click on rules folder --> New File)
- Pasted the code and saved the file
- Deleted the old file
And the error message was gone!
Copying the files did not solve the problem btw… I had to create new ones.
I’m sorry to say that this does not solve the problem after all.
But there is definitely something strange going on here. The “copy & paste to a new file” trick seemingly works at first. The file is then saved without openHab logging the error. Subsequent presses of Ctrl + S lead to the single log entry
2017-11-26 23:08:47.623 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'xyz.rules'
So… still no error. Removing any character in VS Code, adding it again (so, in effect, no change) and pressing Ctrl + S leads to:
2017-11-26 23:06:36.346 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'xyz.rules'
2017-11-26 23:06:36.357 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'xyz.rules' is either empty or cannot be parsed correctly!
2017-11-26 23:06:36.796 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'xyz.rules'