After upgrading to OH 2.5.6 and Buster, Im facing the issue, that new rules didnt get loaded by OH.
Platform information:
Hardware: RPi 4 (installed with openhabian)
OS: Buster
Java Runtime Environment: OH 2.5.6
Issue of the topic:
After upgrading to OH 2.5.6 and OS Buster, new rule-files didnt get loaded and so the rules dont get triggered
Please post configurations (if applicable):
Items configuration related to the issue Switch VT_SWI_EG_Sichtschutz "Sichtschutz" (gEG, gSwitches)
Rules code related to the issue
rule “Sichtschutz aktivieren”
when
Item VT_SWI_EG_Sichtschutz changed to ON
then
logInfo(“Shadowing”, “Rule triggered”)
end
I edit the files locally on my Win10 Notebook and copy them with samba to the RPI.
Even I tried to “touch” this file to trigger the reload. But nothing happens (no entry in the log, nor firing the rule)
Already existing rules are processed as expected.
It seems that the permissions were wrong.
All other rules have “openhab:openhab” and the new one had “openhabian:openhabian”. I changed the permission, but it ends in the same result (restart of OH-Service and daemon-reload done)
If the files were created in Windows, they will have \r\n for line endings. Files created in Linux have \n for the line endings, which is what OH needs. It is best to use VS Code for creating and editing files for use in OH, using SSH to access them rather than smb. In VS Code, you can specify the type of line ending used.
Another way around this is to copy an existing file and then delete everything inside. You can also use the dos2unix utility (in Linux).
Hello Scott
You were completly right.
But I needed to create a completly new file on Linux and give it a different name.
I created a “new.rules” and now it works. Even if I copy the file with samba to my Windows and back.