bbindreiter / node-red-contrib-alexa-remote2-applestrudel

Node-Red Nodes for interacting with Alexa
https://flows.nodered.org/node/node-red-contrib-alexa-remote2-applestrudel
MIT License
77 stars 21 forks source link

Not receiving events #25

Closed gontxomde closed 2 years ago

gontxomde commented 3 years ago

I am using this version inside home assistant node-red. Everything seems to be working fine, I have tested the routine speak and it has worked.

The problem has to do with receiving events from Alexa. I have not been able to receive a single event. This is a major problem as the main advantage for me is being able to receive information from alexa to trigger automations. If i configure volume changes and I change Alexa Echo (3rd Gen style) volume, I receive nothing in my debug node.

I'm using Alexa in Spanish and have events onfigured as "On" in node-red

image

andesse commented 3 years ago

Do you save the cookie to a file? You need to. I don't refresh, try leave this empty, but I use auto init. Never run two Alexa nodes at once. Don't make full deploys, only do changed node deploys. If Alexa nodes get deployed without need, it will mess everything up.

With on device activity node I get data from 5 echos without any issues. Mine runs stable for weeks when I don't touch the init nodes, following this rules.

gontxomde commented 3 years ago

Thanks for the reply

I think the problem is a little bit weird, my alexa connection seems to be working fine, even days after (I'm saving my cookie to a file, as you recommended). Right now, if I try to make my echo speak or play music, it works OK.

I have now made some changes to see if I can deploy new things without messing everything up.

My problem has to do with the device "Alexa Event" node. No matter the type of event I choose to receive I receive nothing. It does not notify for volume changes nor "Device Activity".

As I see the communication flow, the communication when Node-RED is the starting point works OK (eg, query device, text commands, making alexa speak...). The problem comes when alexa has to start the communication with my device.

Do you know if not having SSL activated in my HA can be the cause of this issue? (I'm thinking aloud right now)

bbindreiter commented 3 years ago

Same, mine is also still running strong. 2 Echos running flawless for months now. But unlike you I'm reinitialize every hour. Apparently this isn't even necessary anymore..

bbindreiter commented 3 years ago

The event pushes are definitely not working over a simple HTTP Rest Call, so if everything else works it would point to a network problem.

bbindreiter commented 3 years ago

Some folks over here https://github.com/Apollon77/alexa-remote/issues are running Node-Red within HA so it should theoretically work. Events are received over a WebSocket connection.

gontxomde commented 3 years ago

Do you know if not having my port 443 forwarded can be the issue? I suppose Alexa does only connect via SSL connection. My 433 port is not redirected to 8123 nor 80 (my knowledge here is pretty weak and I don't know really how this works). @bbindreiter, from your perspective, is there anything in particular I should be doing to allow that websocket connection?

I don't really know if is Alexa the one starting the connection on port 433 and not being able or what.

gontxomde commented 3 years ago

Do you have any theory about what could be happening? Are there any other nodes that use websockets so that I can test if that's the issue?

bbindreiter commented 3 years ago

Sorry for the late reply. No I don't think that's the problem. Yes, port 443 is used but on server side. There's no need to open (and forward) that port in your client side config unless you use a proxy server (I assume you don't).

BTW: Does your node say listening, like shown here? image

If yes, and after a node-red redeploy, can you try to talk to your Alexa immediately and see if you receive something? Maybe your connection is cut off after a minute or so without the client recognizing.

gontxomde commented 2 years ago

This morning I have been able to solve the issue. I opened my 443 port and completely reinstalled the addon. Now its working fine. When it didnt work it was saying “listening” but listened nothing.

Reading your comment I dont know if having the port forwarded has been the cause of my installation to be working fine, but its working fine!

Thanks for your help! We can close this issue

bbindreiter commented 2 years ago

Awesome!