Setup IDE for fast Scripting

  • Platform information:
    • Scipp that because it seem to be valid for all

I am very common with JAVA (not so much with JAVAScript) and very lucky to own a valid licence of IntelliJ (ultimate)

[Later on I will try to activate RemoteDebug on the whole JavaCode of a running OpenHAB]

For now please help me to understand the dependencies of available Scrips.
As far as I can see there are 2 types of Script. The one in the GUI (stored in the DB) and the file-based ones I can not manipulate with the UI.

So lets talk about the pain of missing syntax-highlighting and not knowing the whole API by heart :frowning:

Writing any snytax-higlighted JavaScript might be very easy.
But how to get all the OpenHAB (Script) specific stuff included to write a script (syntactically correct) offline and push it to the OpenHAB-Server?

SideNode: What has to happen that OH recognize a new/changed Script-File?
And what might be the easiest way to upload it from the IDE? (do I allway have to go over SSH?)

Any idea would be appreciated.
Thanks a lot

If you use Rules DSL, VS Code has an extension that connects to openHAB’s language server and does the syntax highlighting and checking as you type. But it’s only available in VS Code.

If you use JavaScript Scripting, you can install openhab using npm and any IDE that does node.js JavaScript syntax highlighting and checking will work.

There is a Java addon that lets you write rules in pure Java but you’ll have to read the docs to see how to use that. I do know it has to be compiled.

In the UI, the editor will do syntax highlighting and code completion too for at least JavaScrip, perhaps Rules DSL too, I never tried it.

Save the file to the appropriate folder in /etc/openhab.

The file has to change.

You can go over what ever protocol you want (NFS, Smaba, SSH, FTP, etc.). All that OH sees or cares is that the files have changed.

VSCode has this SSH mode which is awesome! It can edit the files in-place through SSH. I used to do it via samba, but it was slow when working with git (over smb).