Unable to discover devices with OH3
See original GitHub issueI have been playing around with OH3 snapshot versions and noted alexa discovery for new devices fails with OH3. So i hosted my own OH Cloud and connected to local OH3. I also hosted by copy of alexa skill on AWS/ Amazon. Looking at the nginx logs, there is a failure with the first of the two Get requests:
34.XXX.XXX.XXX - xxx@xxx.com [15/Sep/2020:19:28:22 +0000] "GET /rest/services/org.eclipse.smarthome.i18n/config HTTP/1.1" 401 76 "-" "-"
34.XXX.XXX.XXX - xxx@xxx.com [15/Sep/2020:19:28:22 +0000] "GET /rest/items/?fields=editable%2CgroupNames%2CgroupType%2Cname%2Clabel%2Cmetadata%2CstateDescription%2Ctags%2Ctype&metadata=alexa%2Cautoupdate%2Cchannel%2Csynonyms HTTP/1.1" 200 1269 "-" "-"
The failed request is evident from the 401. The relevant code is here: lambda/smarthome/alexa/v3/directives/discovery.js
One thing is that probably the package org.eclipse.smarthome.i18n doesnt exist in OH3. But changing this package name to `org.openhab.i18n’ also results in the same issue.
On local OH3 server, this is the debug log from the OH cloud connector. Request 18 resulted in failuere (possibly corresponding to the first Get request from above) while Request 19 did not (the second Get request i suppose). The complete log is here: https://pastebin.com/7h0SKKUi
2020-09-16 00:58:21.228 [DEBUG] [io.openhabcloud.internal.CloudClient] - Got request 18
2020-09-16 00:58:21.239 [DEBUG] [io.openhabcloud.internal.CloudClient] - {"host":"openhab.mydomain.com","cache-control":"no-cache","accept-encoding":"gzip, deflate","accept":"application/json","user-agent":"openhab-cloud/0.0.1"}
...
2020-09-16 00:58:21.391 [DEBUG] [io.openhabcloud.internal.CloudClient] - Got request 19
2020-09-16 00:58:21.411 [DEBUG] [io.openhabcloud.internal.CloudClient] - {"host":"openhab.mydomain.com","cache-control":"no-cache","accept-encoding":"gzip, deflate","accept":"application/json","user-agent":"openhab-cloud/0.0.1"}
...
2020-09-16 00:58:21.541 [DEBUG] [io.openhabcloud.internal.CloudClient] - Sent headers to request 18
...
2020-09-16 00:58:21.564 [DEBUG] [io.openhabcloud.internal.CloudClient] - {"headers":{"Transfer-Encoding":"chunked","Server":"Jetty(9.4.20.v20190813)","Date":"Tue, 15 Sep 2020 19:28:21 GMT","Content-Type":"application/json"},"responseStatusCode":401,"responseStatusText":"OK","id":18}
2020-09-16 00:58:21.667 [WARN ] [io.openhabcloud.internal.CloudClient] - Jetty request 18 failed: HTTP protocol violation: Authentication challenge without WWW-Authenticate header
2020-09-16 00:58:21.689 [WARN ] [io.openhabcloud.internal.CloudClient] - Response Failure: HTTP protocol violation: Authentication challenge without WWW-Authenticate header
2020-09-16 00:58:21.726 [DEBUG] [io.openhabcloud.internal.CloudClient] - Finished responding to request 18
...
2020-09-16 00:58:21.950 [DEBUG] [io.openhabcloud.internal.CloudClient] - Sent content to request 19
2020-09-16 00:58:21.983 [DEBUG] [io.openhabcloud.internal.CloudClient] - Finished responding to request 19
Overall, this results in a failed discovery.
I then tried with commenting out the Get requests to org.eclipse.smarthome.i18n and org.eclipse.smarthome.core.i18nprovider and used this code in discovery.js and it worked. Was able to discover and control devices.
Promise.all([
rest.getItems(
this.directive.payload.scope.token, this.timeout)
// rest.getServiceConfig(
// this.directive.payload.scope.token, 'org.eclipse.smarthome.i18n', this.timeout),
// rest.getServiceConfig(
// this.directive.payload.scope.token, 'org.eclipse.smarthome.core.i18nprovider', this.timeout)
]).then((data) => {
I wasnt sure where to post this or if this is this an issue with the openhab core packages or the alexa lambda code.
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (1 by maintainers)

Top Related StackOverflow Question
I merged a fix for this one. It also supports the
measurementSystemproperty that was just added by @kaikreuzer to the OH3 root resource based on my feature request. I also improved the 2.x service config requests where only the supported service pid will now be queried based on the api version.@candiesdoodle I was able to test this change on a barebone OH3 install without any issue. Can you please update your skill setup and let me know if it is working for you? Once you confirm, I will update the live skill.
The live skill has now been updated and will now work with OH3.