Error connecting to the openHAB Cloud instance: not authorized

I am an absolute beginner to Linux/Raspberry Pi, but when I learnt about openHAB yesterday, I was intrigued and setup my Raspberry Pi4 with 2GB RAM and 32GB MicroSD to run OpenHabian, which I installed following standard installation, with Java version “1.8.0_222”. I am running OpenHab 2.5.

After the installation, I started with the Network and Sonos Bindings and they worked pretty good. However hit a snag when I installed the OpenHAB Cloud Connector. I created an account with https://myopenhab.org/ and used the uuid and secret found in the openhabcloud directory. I continue to get “Error connecting to the openHAB Cloud instance: not authorized”, and I restarted many times.

I scanned the discussion website and attempted to follow all suggestions to no avail. For Ex: I stopped openhab and cleaned the cache and restarted again. I deleted the uuid and secret to force the cloud connector in creating new ones which I updated to the myopenhab.org website. Restarted many time and it did not resolve the issue. The log associated is as attached
020-02-22 07:48:42.147 [ERROR] [io.openhabcloud.internal.CloudClient] - Error connecting to the openHAB Cloud instance: not authorized

I went over many different threads and nothing worked for me. Please share any insights or thoughts to help resolve this.

According to documentation, the uuid is elsewhere:

Location of UUID and Secret:

File Regular Installation APT Installation
UUID userdata/uuid /var/lib/openhab2/uuid
Secret userdata/openhabcloud/secret /var/lib/openhab2/openhabcloud/secret

Restarting openhab after adding the correct uuid and secret should suffice in my experience.

After deleting and recreating the UUID/Secret you may need to wait up to 24 hours before it starts working.

@j.hoekstra : I used the uuid and secret I found in /var/lib/openhab2 to the myopenhab cloud. Do you mean to suggest that there are different values in userdata/uuid folder ? if yes, I am not sure how to find the userdata folder as I dont see it in my installation. I just see a /usr folder.

@H102 It has been less than 24 hours and I restarted it this morning (PST) around the 12 hr mark and I still get the error. Is there a particular sequence these values register in the cloud ? Does it update any cloud server with the uuid and secret information after installing the OpenHABcloud services, and that “update” takes upto 24hrs before my local installation is able to present these “credentials” to get authenticated ?

I do not have an answer for these questions, only posted what I have experienced and read on other post.

Finally figured out what went wrong. As much as I thought the uninstalling and cleaning the cache was solving the problem it wasn’t, as there were residual files that continued to remain related to openhabcloud folder and files like uuid and secret. The way I was able to resolve it was

a) Uninstalled the Service from Basic UI
b) Used terminal and went to /var/lib/openhab2/uuid and /var/lib/openhab2/openhabcloud/secret and deleted both files and also deleted openhabcloud directory
c) Went to /var/lib/openhab2/config/org/openhab/openhabcloud.config and deleted the file.
d) Delete myopenhab cloud account.
e) stopped the openhab service, cleaned the cache and rebooted the system
f) verified all the files I deleted were truly gone
g) Reinstalled the openhabcloud service.
f) followed rest of the standard process to identify the uuid and secret and created the account with these values and save the same.
g) Rebooted my Pi and this time it finally connected.
Maybe one to two steps may sound redundant but following this sequence helped me solve the issue. Seems basic stuff but still a good learning experience for me.

3 Likes