[SOLVED] How to change the LSP port (5007) to another

I run the latest version of OH in my raspberry. After a lot of tries i cant open the 5007 port to my pc win 10. Is there any way to change the 5007 port from raspberry (openhabian ) in order to use openHAB VS Code Extension.???

You can change the LSP port within openHAB, using Paper UI (Configuration->Services->Misc->LSP), REST API

curl -X PUT --header "Content-Type: application/json" --header "Accept: application/json" -d "{port=5007}" "http://openhab-ip:8080/rest/services/org.eclipse.smarthome.lsp/config"

or even via services/runtime.cfg by adding this line

org.eclipse.smarthome.lsp:port=5007

Please be aware that you will get an error if trying to get the setting through REST API, as long as you did not set it yet, because port=5007 is default, so by default there is no config at all.

1 Like

Thanks @Udo_Hartmann, I’ll remember that!

Great . Any suggestion in which port to switch ?

You are double posting and have a misunderstanding of the situation

You can try port 50007. Maybe an additional zero will help here?

5008?

1 Like

i change it but i cant understand if is running!!!
Is this the right image of the code with LSP?

The lsp will prompt you for program key words and item names as you type. Is VS code doing that?

yes it do it. But is there any way to check it for sure?
I will say something stupid but i noticed that the colors of the words are different in some pictures on internet.

If it does it then it’s connected. Happy days

1 Like

I’m not convinced my VS code rules check is working.
I get auto-complete in rules and I have different colours for different types of things in the VS code window but if I introduce an error (such as missing off a close bracket at the end of a sendCommand(xxxx) command, there is no online feedback. Should there be and if so, what is it?

Thanks.

I am having the same issue.