Cant get JS Rules working

Hello everyone, I am currently trying to make some of my RuleDSL rules faster and lighter and thought about migrating them to the new JS based scripting language. Also because I would like to use functions, etc.
I have a problem that I can not find any information on how to implement such a rule?

Do I have to use the UI to select a trigger and then write a script in the UI editor? Or is there another way where I can just upload a .js file somewhere?
I tried uploading to openhab/automation/js but I just get permission denied messages.

Thanks in advance.

See JavaScript Scripting - Automation | openHAB for you to write rules using JS Scripting and text files. Yes, you put the files in $OH_CONF/automation/js folder as .js files.

Then what ever user you are using doesn’t have permission to write to that folder. Not that OH’s folders are owned by user openHABian and you are almost certainly not logging in as that user, since that’s generally not allowed anyway.

should be:

owned by user openhab

instead of:

owned by user openhabian

1 Like