[SOLVED]Looking up OpenHAB UUID and Secret

okay thanks! Does it matter that im running on windows(10)?

No. The Synology NAS is running a version of linux.

When you use SSH you are “remote controlling” the computer you are connected to (in this case your NAS). Every command you type in there is sent to the NAS which runs it and then sends you back the result. None of the commands are run on your windows 10 computer.

OK thanks! Did try a few things now via my SSH. When I open up volume1(that’s where everything is placed) using the command CD and then showing everything what’s in the map using the command ls, then I see the map “@appstore”. However, if I want to open this map I get the following.

Is this error getting more clear in the link you just send?

It’s not immediately obvious to a beginner but / is the “root” directory (think of it like C:\ in windows).

You are inside the directory /volume1 and want to go into the directory @appstore inside /volume1.

cd /@appstore means "go the the directory /@appstore" (which does not exist which explains the message No such file or directory)

To get into the @appstore directory you want to use either an absolute path: cd /volume1/@appstore
or a relative path cd @appstore or cd ./@appstore (where . is a special path meaning “the folder I am in right now”)

@rossgb wow thanks! Didn’t had any experience with Linux and bios programming untill now haha! But it isn’t that difficult as it looks like. In the meantime, I’ve found the secret-file using these paths:

/var/lib/openhab2/openhabcloud/secret

however I can’t open it with de cd command(probably because it’s a file, not a directory?), but when I do this:

./ secret

it tells me the acces is denied, while I’m logged in as the administrator…
Do you know how to solve this?

Second thing: I found a UUID in openHAB REST API. Is this the correct one?
Because:

/var/lib/openhab2/uuid

was non existent…

1 Like

I’m afraid I cannot help you with specific openhab cloud stuff as I have not used it myself.

You are right that cd <file> does not work because the cd command is only for Changing Directories.

If you just put in a path like /var/lib/openhab2/openhabcloud/secret your shell (the thing running your commands) thinks you want to run the program at /var/lib/openhab2/openhabcloud/secret.

If a file is not marked as executable you will get an error even if you are the administrator.

To look at what is inside a file there a many commands you can use. The ones most useful for you now will probably be cat and more.

cat <file> will just print the entire contents of the file to your console which is fine if the file is short but could be annoying if it is long.

more <file> will stop once your console is full and then wait for you to press ENTER to scroll and show more.

You may find stuff about a command called less online. It is like more but a bit nicer. Unfortunately it is not installed by default in the Synology version of linux.

Bonus hint:

Most commands you will find on linux will tell you how to use them if you give them the parameter -h or --help

Try cat --help

Extra bonus hint:

On most linux systems the command man <command> will show you the manual for <command>.
Unfortunately this is another thing not installed by default on Synology’s version of linux.
If you google man <command> you will usually find the same information though.

For those using docker/ docker-compose, the paths are
/opt/openhab/userdata/openhabcloud/secret
/opt/openhab/userdata/uuid

Was anyone able to find out where the uuid and/or secret file is for a openHAB installation on Synology?

I am not sure how the implementation is done on Synology in case it runs similar to other linux installations I would expect that if you login to your Synology via ssh and you execute the command

env | grep OPENHAB

you should see a list of environment variables.
Check the environment variable that is called OPENHAB_USERDATA take the content and extend it with openhabcloud/secret to get the location of the secret file.
Extend it with uuid to get the location of the uuid file.

Hi Roy,
yes i did!
You have to open Putty and put the next line in for the UUID:
/volumeXYZ/SmartHome/openHAB/userdata
in this same directory you can find “openhabcloud”. Open this and you’ll find the secret.
To read both these files you gotta enter cat uuid or cat secret

I have openhab 4 installed in termux and it’s running well , now i want to use the cloud service but i don’t know how to find the uuid and secret please help

1 Like

Cloud “extension” is installed via UI ?

Yes

And also found the uuid and secret

nano userdata/uuid For uuid

nano userdata/openhabcloud/secret For secret

1 Like

For Docker running in “container station” of Qnap execute Console Command “cat /openhab/userdata/openhabcloud/secret”. And “cat /openhab/userdata/uuid”.

First you need to install the openHAB Cloud Connector!