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
74 stars 20 forks source link

Events are not firing again for several people #142

Closed cymplecy closed 8 months ago

cymplecy commented 10 months ago

https://discourse.nodered.org/t/alexa-on-device-activity-not-working/80901/1

Apollon77 commented 10 months ago

Hm … I‘m not at home till the weekend. Son-in-law fact debug logs and check what comes in via wsmqtt would be the only helping to get an idea. But it might be that Amazon now also closes this way :-(

claudiopj commented 10 months ago

i have same problem!

mactwin commented 10 months ago

same here, all other nodes are working....events no, it's grayed out and not receiving anything.

DanPatten commented 10 months ago

@Apollon77 Looks like events are no longer occurring via wsmqtt, I connected directly to that WS and not seeing anything. Is there an alternative here? It does appear the API supports returning recent events although probably not a great solution for real time as compared to a websocket connection.

Apollon77 commented 10 months ago

What api you talk about?

sreevo commented 10 months ago

Apollon, pls help us :( we need you

Apollon77 commented 10 months ago

If someone is firm with sniffing ios/android network traffic including tls decoding using wireshark or such ... contact me. So you know what we do currently ... this is not that funny doing as it sounds reading.

lets see if we find a way

DanPatten commented 10 months ago

What api you talk about?

The alexa API can be reached at: https://www.amazon.com/alexa-privacy/apd/rvh/customer-history-records-v2?startTime=1693630800000&endTime=1693710556556&disableGlobalNav=false

You can view recent history at: https://www.amazon.com/alexa-privacy/apd/rvh

Apollon77 commented 10 months ago

Ahh you mean that api. Yes this is not the topic here because we need to know when to get these data

Chris380 commented 10 months ago

Same for me. Other nodes work, "Alexa Event" says "listening" but does not emit anything. Thanks for everybody involved in fixing this issue.

questuk commented 10 months ago

Same for me. Other nodes work, "Alexa Event" says "listening" but does not emit anything. Thanks for everybody involved in fixing this issue.

Yes same here for me as well, hope it gets fixed as it was very very useful

Apollon77 commented 10 months ago

I'm in communication with @bbindreiter ... stay tuned ... and prepare your system: It will require Node.js 16+ !

If it works and you like my work ... I'm happy for any Donations: https://github.com/sponsors/Apollon77 / https://paypal.me/Apollon77

bbindreiter commented 10 months ago

There is a new version available (5.0.40), please update and make sure Events is "On" in Account settings. Everything should work then again.

Please donate to Apollon77 using the link above if you rely on this functionality.

claudiopj commented 10 months ago

still not working for me... :(

Chris380 commented 10 months ago

@Apollon77 I can confirm that the "Alexa Event" is working now again (layla.amazon.de is my service host). Great work! As @bbindreiter mentioned it's crucial to set Events to "On". P.S. Ein kleiner Dank ist unterwegs

cymplecy commented 10 months ago

For some reason, V5.0.40 wasn't showing as being available in the palette but installing from command worked and back in the listening business once I'd configured Events = On

@Apollon77 (and @bbindreiter ) for your efforts

Also to everyone who relies on this

https://github.com/bbindreiter/node-red-contrib-alexa-remote2-applestrudel/issues/142#issuecomment-1712012052

Bismar commented 10 months ago

Unsure what's happening with this new update, but it's causing my nodered to continuously crash.

9 Sep 19:59:55 - [info] [server:Home Assistant] Connecting to http://supervisor/core 9 Sep 19:59:55 - [warn] [alexa-remote-account:acd14ce107b43b33] ENOENT: no such file or directory, open '/home/authFile' 9 Sep 19:59:55 - [info] [alexa-remote-account:acd14ce107b43b33] intialising with the PROXY method and NO saved data... 9 Sep 19:59:55 - [warn] [alexa-remote-account:acd14ce107b43b33] open 192.168.1.133:3456 in your browser 9 Sep 19:59:55 - [info] [server:Home Assistant] Connected to http://supervisor/core 9 Sep 19:59:55 - [error] [ha-sensor:Projector Control] InputError: Integration not loaded 9 Sep 19:59:55 - [error] [alexa-remote-routine:3b1dad892822b537] Account not initialised! (node:307) TimeoutOverflowWarning: 2592000000 does not fit into a 32-bit signed integer. Timeout duration was set to 1. (Use node --trace-warnings ... to show where the warning was created) 9 Sep 20:00:23 - [info] [alexa-remote-account:acd14ce107b43b33] auto refreshing cookie... 9 Sep 20:00:23 - [info] [alexa-remote-account:acd14ce107b43b33] intialising with the PROXY method and saved data... (node:307) TimeoutOverflowWarning: 2592000000 does not fit into a 32-bit signed integer. Timeout duration was set to 1. (node:307) TimeoutOverflowWarning: 2592000000 does not fit into a 32-bit signed integer. Timeout duration was set to 1. 9 Sep 20:00:27 - [info] [alexa-remote-account:acd14ce107b43b33] auto refreshing cookie... 9 Sep 20:00:27 - [info] [alexa-remote-account:acd14ce107b43b33] intialising with the PROXY method and saved data... (node:307) TimeoutOverflowWarning: 2592000000 does not fit into a 32-bit signed integer. Timeout duration was set to 1. (node:307) TimeoutOverflowWarning: 2592000000 does not fit into a 32-bit signed integer. Timeout duration was set to 1. 9 Sep 20:00:31 - [info] [alexa-remote-account:acd14ce107b43b33] auto refreshing cookie... 9 Sep 20:00:31 - [info] [alexa-remote-account:acd14ce107b43b33] intialising with the PROXY method and saved data... 9 Sep 20:00:31 - [red] Uncaught Exception: 9 Sep 20:00:31 - [error] Error: getaddrinfo ENOTFOUND bob-dispatch-prod-fe.amazon.com.au at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:108:26) [20:00:31] INFO: Service Node-RED exited with code 1 (by signal 0) s6-rc: info: service legacy-services: stopping s6-rc: info: service legacy-services successfully stopped s6-rc: info: service nginx: stopping

Apollon77 commented 10 months ago

Hm. One thing is this error about timeout value. Please use the mentioned

node --trace-warnings parameter for modeled start to trace the codeplace and report here. Something tries to set a timeout if 720h or 30d which is too long. Find it because it gives a lot of issue! Maybe also check config if the node?

Other then that the getaddr error means that there is a dns lookup issue.

And btw: show your config of the Alexa node in any case. Wh it tries for you to connect to far east server? Japanese? Australia account?

elgerg commented 10 months ago

Hi all,

Thanks for the work you have all done on this to get events working again.

I updated my installation, set events to on, restarted node-red and the events reset itself to blank so had to set it to on again. After another restart the setting was retained.

However after a couple of minutes the events stopped firing again.

I'm using NodeJS 18 if that is of any help.

Does anyone know how I can get the events to fire all of the time like they used to or what I can do to help debug the issue?

Thanks in advance!

Apollon77 commented 10 months ago

@Bismar locate that file and remove the .au at the end of the Hostname.

https://github.com/Apollon77/alexa-remote/blob/c29aec3fba6acd2404d16b9bc5878d2e74283123/alexa-http2push.js#L41

Does it work then ?

Apollon77 commented 10 months ago

@elgerg show your node config. Especially the domains names in there.

elgerg commented 10 months ago

@elgerg show your node config. Especially the domains names in there.

Here you go: image

Apollon77 commented 10 months ago

Should work. Other users reported it working. Try a restart. Else need debug logs

elgerg commented 10 months ago

Ok, so it worked for a few minutes then stopped again.

How do I get the debug logs? Sorry for the noob question but I've not had to do this before..

Thanks

spants commented 10 months ago

also in the uk but debugging on a flight..... Events do not seem to be working for me

Apollon77 commented 10 months ago

In fact I mainly assuming is not so much about that domain but where your Amazon account is located. So even if you use .co.uk but have an us account then we simply assume wrong.

Apollon77 commented 10 months ago

@bbindreiter i think I add a new config variable to set/override that settings. Most likely easier on the long run.

elgerg commented 10 months ago

In fact I mainly assuming is not so much about that domain but where your Amazon account is located. So even if you use .co.uk but have an us account then we simply assume wrong.

How can we tell where our account is located?

Apollon77 commented 10 months ago

You should know where you registered them? ;-))) or maybe in the Amazon settings somewhere? I'm fact we would see in a debug log when it connects.

bbindreiter commented 10 months ago

@bbindreiter i think I add a new config variable to set/override that settings. Most likely easier on the long run.

Yes, good idea. So folks can try different domains.

Bismar commented 10 months ago

@Bismar locate that file and remove the .au at the end of the Hostname.

https://github.com/Apollon77/alexa-remote/blob/c29aec3fba6acd2404d16b9bc5878d2e74283123/alexa-http2push.js#L41

Does it work then ?

Ok I'm completely confused as to how to access the back end of nodered for these files. Nothing in Studio Code Server that I can immediately identify. Additionally I tried running node --trace-warnings in the init_commands config section, but that didn't work either. Appreciate any pointers!

elgerg commented 10 months ago

You should know where you registered them? ;-))) or maybe in the Amazon settings somewhere? I'm fact we would see in a debug log when it connects.

I registered on the UK amazon and in my settings in the app it's UK.

I am more than happy to try debugging but I'd need a pointer on how to do that from NR.

Thanks

spants commented 10 months ago

You should know where you registered them? ;-))) or maybe in the Amazon settings somewhere? I'm fact we would see in a debug log when it connects.

I registered on the UK amazon and in my settings in the app it's UK.

I am more than happy to try debugging but I'd need a pointer on how to do that from NR.

Thanks

same with me.....

bdydrp commented 10 months ago

I still had issues with this after updating for an AU account. But after removing the .au from host = 'bob-dispatch-prod-fe.amazon.com.au'; to host = 'bob-dispatch-prod-fe.amazon.com'; it now works!!

Apollon77 commented 10 months ago

@bdydrp good to know. Will fix.

Bismar commented 10 months ago

I still had issues with this after updating for an AU account. But after removing the .au from host = 'bob-dispatch-prod-fe.amazon.com.au'; to host = 'bob-dispatch-prod-fe.amazon.com'; it now works!!

Could i trouble you with identifying where the files are to modified in HA?

tkkt111 commented 10 months ago

In a JP account, it doesn't work properly with 'bob-dispatch-prod-fe.amazon.co.jp', but it does work with 'bob-dispatch-prod-fe.amazon.com'.

bdydrp commented 10 months ago

I still had issues with this after updating for an AU account. But after removing the .au from host = 'bob-dispatch-prod-fe.amazon.com.au'; to host = 'bob-dispatch-prod-fe.amazon.com'; it now works!!

Could i trouble you with identifying where the files are to modified in HA?

@Bismar Apologies mate, i run node red via docker on unraid Not sure where they would be for HA (im assuming your talking abt Home Assistant) You could try asking in the Home Assistant community

Apollon77 commented 10 months ago

Ok, AU/JP fixed in new verison of my library

@bbindreiter 6.1.1 on npm soon. new parameter ... maybe leave empty by default

https://github.com/Apollon77/alexa-remote/commit/c4fc6c9b720c69af14cfd400e9f0d1588bc75d67

I also added a protection from enteringn too high refresh intervals for cookie because a nodejs timeout is int-32 max! Else it is changed to 1ms! (which is worst idea ever) :-)

Apollon77 commented 10 months ago

@bbindreiter 6.1.1. coming :-))

bbindreiter commented 10 months ago

5.0.41 released! Thanks everyone.

Apollon77 commented 10 months ago

Thank you!

claudiopj commented 10 months ago

5.0.41 released! Thanks everyone.

thank you! i will test some features! many tnx!!

bdydrp commented 10 months ago

Prior to 5.0.41, the node stopped working again for my AU account. Updated to latest, still no good. I needed to delete cookie and re-authorise So far so good!!

spants commented 10 months ago

5.0.41 working for me too (UK) - thanks!

elgerg commented 10 months ago

5.0.41 working for me too (UK) - thanks!

Did you change/set the push URL? If so what did you set it to as I am getting rather odd results. It connects and I get events, then it stops and then it randomly works for a few minutes then stops again.

Thanks

spants commented 10 months ago

I deleted the file that stored the auth json (I use unRaid) and restarted. I am remote debugging as I am away from home but my wife is shouting commands at it successfully. Only just got it working so I am not saying that it works long term just yet

Apollon77 commented 10 months ago

For all such strange cases I would need the debug output of the Library.

In fact: After the update on first start there should be an automatic cookie update and afterthis a "dataVersion: 2" should be in the data. Then it should be prepared for the new Push Messages. if this cookie update do not happen and/or dataverison:2 is not there (which means it did not happened) then yes you would need to do a reloagin to get fresh cookies. But also here after is "dataVersion: 2" should be there. If not then this is the reason that it do not work.

All rest would be questions to maybe understand based on debug log

Bismar commented 10 months ago

Appears bob-dispatch-prod-fe.amazon.com is no longer working. I keep timing out. Anything else I can try to help debug? Service Host is alexa.amazon.com.au, Page is alexa.amazon.com.au.

(node:307) TimeoutOverflowWarning: 2592000000 does not fit into a 32-bit signed integer. Timeout duration was set to 1. 10 Sep 21:16:30 - [info] [alexa-remote-account:acd14ce107b43b33] auto refreshing cookie... 10 Sep 21:16:30 - [info] [alexa-remote-account:acd14ce107b43b33] intialising with the PROXY method and saved data...

msp1974 commented 10 months ago

5.0.40 fixed the issue (UK) and 5.0.41 also working well. Thanks for fixing this quickly. I use it to control all lamps and lights in the house via NR in HA as a room aware alexa control. You can imagine what a PITA is was when it stopped working! Again thank you!