My first thought was that the entire binding is offline. But when the devices turn unresponsive, both the Things in openHAB are shown as “online” (both the account as well as the actual Echo Dot)…
… and simple tests such as events.sendCommand("Echo_Dot_Speak", "Test");
still work. So the binding is somehow still there.
The log shows nothing related to that (e.g. when I try to switch on a light by talking to Alexa), which is probably another hint that the “inbound connection” to openHab does not seem to work anymore.
The only hint I have for a potential root cause is a log entry ~ 1 minute…
17:10:38.787 [INFO ] [ocontrol.internal.WebSocketConnection] - Web Socket close 1005. Reason: null
The binding has nothing to do with your problems. The connection openHAB device → Alexa (i.e. „Alexa, turn on my bedroom light“) is via the myopenhab cloud and the openHAB Alexa skill. The binding is for controlling Alexa devices from the openHAB side.
Since the problem re-materialized today (even with 3.2 release build and the 3.2.7-version of the updated AmazonEchoControl binding (Amazonechocontrol newest version - #13 by MFI-Net) I’m opening this up again:
Thanks for the hint. After a) going through the Troubleshooting guide as indicated by @jeshab and b) as pointed out by @J-N-K, this problem does indeed not appear to be caused by the binding.
I’m currently trying to debug the root cause, but am still struggling to come to a conclusion, given what I’m seeing, since what I see does not make sense to me:
All devices can be perfectly controlled via openHAB UI locally (x.x.x.x:8080), so things seem to be running correctly
Alexa in general is online (music, whether, etc working perfectly fine)
openHAB can make Alexa say things via a simple events.sendCommand("Echo_Bad_Speak", "Test"); which also leaves trails in the log
Asking Alexa to switch on the light does not work ("“the hub the device is connected to is not responding”) but the request leaves a trail in the log:
21:13:45.519 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Echo_Dot_LastVoiceCommand' changed from alexa to
21:13:45.530 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Echo_Dot_LastVoiceCommand' changed from to alexa
21:13:47.159 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Echo_Dot_LastVoiceCommand' changed from alexa to stehlampe ein
Logging into myopenhab.org says that openHAB is offline
No idea. I never looked in either code. Since the lastVoiceCommand channel works, it seems it’s not an issue of your network connection in general and the fact that lastVoiceCommand contains the correct command indicates that Alexa understood what you said.
Maybe next time this happens you can try to login to myopenhab.org with a browser and see if you can access your dashboard. If you can control there and Alexa still does not work, you are at least sure that it’s not your connection to the cloud but the connection between cloud and skill.
Still fighting hard with myself to not restart openHAB to solve the problem, but trying to figure out what’s the current root cause.
Logged into myopenhab.org (“Your openHAB is not online.”), so definitely a myopenHAB Cloud-problem? The Alexa skill can work without the myopenhab.org cloud, correct? If so, how is it possible that the Alexa commands reach openHAB, but appear to not be executed correctly (with a restart solving all this)?
No, it’s working for me. So the issue is in your connection to the cloud.
There are two parts:
“Alexa controls openHAB”: this is done by exposing things with metadata to the cloud. The openHAB skill enables you to control these devices with your voice via Alexa
“openHAB controls Alexa”: this is done via the amazonechocontrol binding. Part of this is to listen for events from Alexa like “someone said something” or “the volume of the speaker changed”, the other part is to send commands to Alexa (like “say arbitrary text” or “play radio xy”).
Both parts are completely independent. So the binding will see that Alexa understood “Turn on light xy”. This would even work if you disable the openHAB skill and has nothing to do with what happens afterwards. It’s just the “log” of what Alexa recorded.
That’s actually not true. It’s not because the Alexa voice history shows the requested command that it indicates that it was processed as intended. This is why I mentioned before that you can’t use the Amazon Echo Control binding as a way to troubleshoot the Alexa skill.
So you actually have all the information you need to determine the root cause. You have to understand that the Amazon Echo Control binding connects from OH to Amazon, while the Alexa skill goes the opposite direction via myopenhab.org. If your connection to that cloud service is down, as you highlighted, then the Alexa skill will not work. As a matter a fact, the error returned specifically indicates the root cause in the troubleshooting guide.
In all, this is an issue between your OH server and the myopenhab.org cloud connector service. Once you resolve it, the Alexa skill will work again.
I didn’t state that Alexa is doing the correct thing after she understood something. I said “lastVoiceCommand contains the last thing you said, so the network connection is fine and Alexa in general is able to understand something”.
Thanks! I think you’re right. Just checked openhab.log. It contains frequent messages like this:
2022-01-11 08:15:32.957 [INFO ] [io.openhabcloud.internal.CloudClient] - Disconnected from the openHAB Cloud service (UUID = xxx, base URL = http://localhost:8080)
2022-01-11 08:17:40.587 [ERROR] [io.openhabcloud.internal.CloudClient] - Error connecting to the openHAB Cloud instance. Reconnecting.
2022-01-11 08:17:41.308 [INFO ] [io.openhabcloud.internal.CloudClient] - Connected to the openHAB Cloud service (UUID = xxx, base URL = http://localhost:8080)
What’s odd:
Despite having several of these messages in the past x days, the function of Alexa was not affected (at least not noticeably, so maybe just good timing)
Despite the last log entry showing that the Cloud connection is there, myopenhab.org says it’s not.
Long story short: Problem seems to be like you said (" issue between your OH server and the myopenhab.org cloud connector service"). So I have to do some more research on this (or as a mitigation / no sustainable workaround) just do a restart.
Update: Problem might also be related to a recent DHCP problem which I’m having here, so closing this for now / have to observe further.
Update 2: After having had a bunch of connectivity problems for months, and after (unsuccessfully) having changed almost everything except the rounter, I finally replaced the router with something decent (Fritz! Box). And voillà: All my connectivity problems are gone.
I’ve got the same problem from time to time…
Disconnect followed by Reconnect, but from Openhab Cloud, my env is OFFLINE, and thus, offline for Alexa too…
My Openhab is running as a docker container…
EDIT: If I just save my Openhab Cloud configuration from the preferences, it just works again:
[INFO ] [io.openhabcloud.internal.CloudClient] - Shutting down openHAB Cloud service connection
[INFO ] [io.openhabcloud.internal.CloudClient] - Disconnected from the openHAB Cloud service (UUID = ..., base URL = http://localhost:8080)
[INFO ] [io.openhabcloud.internal.CloudClient] - Connected to the openHAB Cloud service (UUID = ..., base URL = http://localhost:8080)
I think there’s another thread on this somewhere, but I can’t find it now. By saving you are getting the restart which is what I think temporarily resolves the problem. It can work for a month or two for me, then stop working.