originallyus / node-red-contrib-alexa-local

An easy-to-use NodeRED node for adding Alexa capability to NodeRED. NO Alexa Skills required.
107 stars 25 forks source link

Alexa local stop working!! #100

Closed delta010 closed 4 years ago

delta010 commented 4 years ago

After a few hours ago Alexa local on node-red stop working. I am using a 2nd gen echo dot .but node red Alexa home skill working fine

scargill commented 4 years ago

As I said I can’t remember that whole port 80 thing but yes of course there is a redirect to port 80…. To keep Alexa happy. My internal PI pages are on port 86.

All of this has been working correctly for months, used on a daily basis until a few days ago.

I’ll move the conversation about node-red-contrib-amazon-echo to the relevant github if that’s ok, as I also have a query about colours on inputs. I cant seem to inject an RGB colour array into the input of nrc-amazon-alexa – to cater for another control changing the colour.

Pete

From: nob0dy80 notifications@github.com Sent: 14 September 2019 17:09 To: originallyus/node-red-contrib-alexa-local node-red-contrib-alexa-local@noreply.github.com Cc: Peter Scargill pete@scargill.org; Mention mention@noreply.github.com Subject: Re: [originallyus/node-red-contrib-alexa-local] Alexa local stop working!! (#100)

@scargill https://github.com/scargill

answer the question from @Jibbonator https://github.com/Jibbonator . Did you do a port redirect to 80? I guess you were getting your alexa firmware update a bit later and thats the reason why you are facing the problems now.

If you dont do a redirect to port 80 yet, follow the steps @Jibbonator https://github.com/Jibbonator posted some postings above.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/originallyus/node-red-contrib-alexa-local/issues/100?email_source=notifications&email_token=AAONJA7C5G5ICRPM5PNLQHDQJT5ATA5CNFSM4IUGT462YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6W5TPY#issuecomment-531487167 , or mute the thread https://github.com/notifications/unsubscribe-auth/AAONJA4QNPOU42PCYYGDQETQJT5ATANCNFSM4IUGT46Q . https://github.com/notifications/beacon/AAONJA4HBAFCAAHELMLKQXLQJT5ATA5CNFSM4IUGT462YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6W5TPY.gif

nob0dy80 commented 4 years ago

first. Stop posting what i said. This is not a forum and makes the text long ! Just write your answer. Dont reply to the email. Come to github and write there!

if you didnt do any changes the last day, this is your problem.

enter in your pi this command and post the reply: sudo iptables -t nat -L

if you dont follow and just persist on your "it was working for month" we dont get any further and i stop my support for you! All you do is guessing... "cant remember" is like guessing!

and colors are not your problem right now, lets start with the basic to get it working again, deal?

scargill commented 4 years ago

Pete. At this point you are not wrong here even its for alexa-local and not for alexa-echo. i know that everything worked for long time. That is why we are talking here. We are all facing the same problem. Updates are not always coming at the same time to all users. some have the problems for a month now, i'm facing the problem 3 days ago.

But the solution is here! Just read what @Jibbonator wrote here: #100 (comment)

now its up to you to follow the instructions.

@Jibbonator it wasnt the best decission to explain iptables redirections with a german site, but @scargill the commands are all there. Redirect your port 8980 to 80 on the Pi with the instructions @Jibbonator posted! then delete all your devices in the alexa app (or alexa.amazon.com) and start detection again

Now you mention it, I've been using IPTABLES for months to do this redirection. And yes I have tried deleting the devices and re-adding - did that last week and all was well for a while - but then yesterday I had to do the same again - that's not right, surely...

nob0dy80 commented 4 years ago

waiting for the "sudo iptables -t nat -L" output

focus dude, focus ;)

scargill commented 4 years ago

Whoever nob0dy80 is - I AM at GITHUB - sorry I didnt realise I was reposting what had already been said. No need to be terse about it? I'm not a Linux whiz... and I have a wife trying to get me to do jobs hile I'm trying to sort this out.

Here are the results of your requested test.. are they ok?

pi:~:18:19[0]> sudo iptables -t nat -L Chain PREROUTING (policy ACCEPT) target prot opt source destination REDIRECT tcp -- anywhere anywhere tcp dpt:http redir ports 8980

Chain INPUT (policy ACCEPT) target prot opt source destination

Chain POSTROUTING (policy ACCEPT) target prot opt source destination MASQUERADE all -- 10.8.0.0/24 anywhere MASQUERADE all -- 10.8.0.0/24 anywhere

Chain OUTPUT (policy ACCEPT) target prot opt source destination

n.r.c.a.e. is working after clearing out the node and telling the Amazon app to forget the device - then adding back in the node and asking the Alexa app to find devices (it found 2 identical devices and I had to delete one. Problem is I've had to do this 3 times in the past few days - which of course is no good.

I did the sudo ip tables save ages ago to sort out initial port 80 problems - has anything changed?

It took me a while to get my head back into this.

scargill commented 4 years ago

In the ABOUT for my DOT- it says DEVICE SOFTWARE VERSION 2785574276

nob0dy80 commented 4 years ago

You let your wife do? let me bop that honey ;) so here you are... you are just redirecting tcp packets to 8980 ... i'm pretty sure that discovery stuff works with udp (not 100% sure, but highly)

and redirecting all to 8980 is pretty "bull-shit".

clear the REDIRECT tcp -- anywhere anywhere tcp dpt:http redir ports 8980 rule

and do sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8980 sudo iptables -t nat -A PREROUTING -p udp --dport 80 -j REDIRECT --to-port 8980

delete all your alexa devices again and try a new search. got pretty hope that will fix it dont know what n.r.c.a.e. is but since its all based on node-red all system act the same way!

and yes. something has changed in the alexa firmware and thats why we are talking.

the version you posted seems to differ from the german ones.. but for sure they all got the same changes.

nob0dy80 commented 4 years ago

damn, not sure if "to bop" was the right word i wanted to say ...my english isnt perfect and some translate it as beating! of cause i dont want to beat her hahahah

scargill commented 4 years ago

n.r.c.a.e. is node-red-contrib-alexa-echo- I'm also not the fastest typist in the world since an incident 2 years sgo (I WAS VERY fast) so I used the abbreviation so it didnt take all day to reply I know nothing about IPTABLES and this is what I was advised to do some months ago to my PI.

sudo apt-get install iptables-persistent sudo iptables -I INPUT 1 -p tcp –dport 80 -j ACCEPT sudo iptables -A PREROUTING -t nat -i eth0 -p tcp –dport 80 -j REDIRECT –to-port 8980 sudo netfilter-persistent save sudo netfilter-persistent reload

Your version seems slightly different. Will it work better or is it just different? I don;t know HOW to clear what's there? Given the above, do I need to clear out something somehow befor using your revised version of the above?

nob0dy80 commented 4 years ago

dude, dont care, its weekend, i've got time as i said i guess the problem is you are missing the UDP packets. Your only forward TCP!

your posting is only half of the stuff, i cant see what "input 1" is configured at.

just for now, do the two lines i wrote: sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8980 sudo iptables -t nat -A PREROUTING -p udp --dport 80 -j REDIRECT --to-port 8980

as long you dont reboot this is active. thats enough for testing.

since the udp rule is "added" this is not an replacement.

give in that two commands and post me the result of "sudo iptables -t nat -L" again please

3ative commented 4 years ago

I have read this thread (and others) and I still can't see a solution (among all the 'chatter') about what I need to change to get this working again. My setup: Running Hassos from an unRraid VM - Node-Red installed via Hass.io add-on within Home Assistant. "node-red-contrib-alexa-local" v0.3.24 installed via Palette within Node-Red.

Could someone please explain to me how to get this working again - Many Thanks.

nob0dy80 commented 4 years ago

@3ative then you didnt read exactly. we are not talking about alexa-local ..we replaced it with alexa-echo.

if you read that thread and understand you get your fix. i can only advise you to this: https://github.com/originallyus/node-red-contrib-alexa-local/issues/100#issuecomment-531302942

or... maybe my english is so bad that nobody can undestand it

scargill commented 4 years ago

nob0dy80 - now we understand each other :-) can you confirm, do I need to change the one (central) line in my IPtables setup to your 2 line version... and if so can you be specific (and simple) about any clear out I need to do first?

scargill commented 4 years ago

and @3ative - I would imagine the same applies to alexa-local and alexa-echo - and probably espurna too - all acting up recently. .

nob0dy80 commented 4 years ago

@scargill dont make it so complicated. just open a root shell on your Pi and enter the two commands sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8980 sudo iptables -t nat -A PREROUTING -p udp --dport 80 -j REDIRECT --to-port 8980

delete all your devices again and do a new search. if that work, we talk about the rest.

nob0dy80 commented 4 years ago

if thats not working we have an other problem

nob0dy80 commented 4 years ago

my alexa is dead too ! all i'm saying is regarding @Jibbonator instructions. i give that tomorrow a try but i'm pretty sure that will do it. no doubt that his instructions do it

so for more informations and input from me, you have to wait till tomorrow at this time

nob0dy80 commented 4 years ago

if you look here https://github.com/mabunixda/node-red-contrib-alexa-home/issues/53#issuecomment-531469979

this one seems to work...just to proof what i'm saying

slopsjon commented 4 years ago

@3ative

The option I went for which is different to what nobody80 and peter are discussing was to switch to using node-red-contrib-alexa-home-skill node which requires an account. You have to create the devices on this account and then discover then in the Alexa App. The output from the node is True/False so you may have to process that if the receiving nodes wants say Yes/No.

nob0dy80 commented 4 years ago

@slopsjon you should mention that you get loss of privacy and this one is cloud based and messing up completely with the original sense of alexa-local and alexa-echo!

and at least, i heared that its much slower... saw discussions over switching times at 3-5 seconds some times

eRudy commented 4 years ago

It seems indeed that something changed in the way Alexa is doing handshake with new devices.

I tried redirecting port 80 to the port associated with one specific device (as seen in node-red, for example "discovery (p:34495)" ) with iptables (iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 34495).

After that, device state changes from "discovery..." to "/light" ! but unfortunately it doesn't go further and association fails :/

nob0dy80 commented 4 years ago

@eRudy dont see the sense telling the things what are mentioned here longer ago what you tell is exactly written here in the same thread: https://github.com/originallyus/node-red-contrib-alexa-local/issues/100#issuecomment-531307419

you dont know how alexa-local acts with his ports but it must be associate with port 80. if you route the one port to 80 it must not be the solution at all. alexa-local works with random ports and this will always end up in a problem right now

nob0dy80 commented 4 years ago

Guys really....if you are to lazy to read i'm loosing interest in helping anyone.

3ative commented 4 years ago

@nob0dy80 Thanks for reply... I did read that "100" post but, the actual solution got lost in all the noise of people saying "Same problem here" and others pasting in their entire life stories LMAO

Done and Done... Old nodes removed, new ones added, 'Discovered'... and we're working.

Once again, Thank you.

nob0dy80 commented 4 years ago

@3ative get used to it ! shouting "it doesent work" is the most expected reaction from end users...

now you learned for the future... reading is a god bless.

nob0dy80 commented 4 years ago

@3ative just for interest because i'm starting with this tomorrow. you also had to do the port 80 redirection? I'm not sure about that situation till i tested it

nob0dy80 commented 4 years ago

so at least @eRudy @scargill nothing of what i said seems to be wrong. so follow the instructions and you get your alexa back to work

and just to mention ..most benefit goes to @Jibbonator

scargill commented 4 years ago

I added your 2 lines without rebooting. I removed all devides from NR and told the Alexa app to delete the devices. I then told the app to "find devices. It found 2 of "brian" and one "my bench light". I deleted one brian from the app and turned on "brian". That worked, so I tried turning on "my bench light". "I found more than one device with the name 'my bench light"'"- etc.

Same problem, multiple devices appearing, often not working. In the app I reduced this down to one "brian" and one "my bench light". Alexa, turn brian on. Alexa turn brian off. All working. "Alexa turn my bench light on"... flashing light on alexa, beep - but no action - ie no output from Amazon echo device "my bench light" in NR. Deleted "my bench light" in the app. "Alexa - find devices" - "I found 3 new devices" - WHY ? Two brians and two bench lights...

nob0dy80 commented 4 years ago

@scargill are you fine if we can get on with this tomorrow? i'm not so far yet. all i told you was blind out of the box. For sure i can help you more when i'm on the same situation. but at least, it detects devices so we are on the right way. just relax, time brings solutions.

why devices show up twice is a problem i have too. that was the way the problems startet. one guess is that not all your alexas work on the latest firmware.

go to any alexa and say to her "search for updates" just to be sure

we talk tomorrow...promised

nob0dy80 commented 4 years ago

if anyone finds out something interesting till tomorrow, let us know and dont leave me alone starting from the scratch ;)

eRudy commented 4 years ago

@eRudy dont see the sense telling the things what are mentioned here longer ago what you tell is exactly written here in the same thread: #100 (comment)

you dont know how alexa-local acts with his ports but it must be associate with port 80. if you route the one port to 80 it must not be the solution at all. alexa-local works with random ports and this will always end up in a problem right now

I just wanted to tell what I tried, I didn't see anyone mentioning status change after redirecting port 80 to the port used by one device... maybe I'm wrong, but seriously man, what makes you so aggressive ??

nob0dy80 commented 4 years ago

@eRudy you know that feeling you get sometimes when it seems you are talking against a wall? and your solution is not what people want to protect their privacy. if you dont matter, thats fine. but you just missed the point and thats what i told you. sorry if you think thats agggressive

scargill commented 4 years ago

@nob0dy80 - I solved the mystery of why it detects deices twice - a complete red herring - my fault. The devices appear on m clone backup device... at least they did. Fixed. So, without your IP tables mod, it is all working, except for my OTHER issue for which I got no response in the node-red-contrib-alexa-echo github.. that of colour - I'll push my luck and ask in here - everyone assumes the ONLY way a device will be controlled is by ALEXA - not true - if I change the colour in Node-Red-dashboard, I can extract a 3-byte array into msg.payload, but can Iinject this somehow into node-red-contrib-alexa-echo - and what about msg.topic? Do I inject both into the echo hub or the echo device node? I tried a msg.topic of "my-shed-light" and a numeric array into msg.payload and tried the hub snd device one at at time - neither had any effect. Any idea?

nob0dy80 commented 4 years ago

@scargill next time let your wife do dude ! hahahaha kidding.. nice you found out

Dont let it sound like my instructions are wrong..that will drive other users crazy having issues. Since you forwarded everything to port 8090 this may work. as i said..not sure if udp protocol is needed but i thought so... anything i need to know i will learn tomorrow when i change my nodered adapter too.

i'm a bit out of the color thing... i never had a need to tell alexa to change one lamp to an other color. i'm doing this with scenes in iobroker.. i say "turn on relax-mode" and iobroker sets hue and colors directly in values i've setup.

for my needs i dont need to tell a lamp to change color... but , what kind of lamps do you have? Philips hue bulbs? different vendor, different input

nob0dy80 commented 4 years ago

@scargill thought a second about it... really need to know what kind of bulbs you are using..they really act different. especial they differ in the values a bulb needs for color changing..some use hex some use color names ..so i cant give you any clear advice without knowing

but at least this is not a topic for here..that has to go with the broker or vendor u use

nob0dy80 commented 4 years ago

sorry i have to ask again.. is my english sometimes so bad that nobody can understand what i'm sayin' ? Im never clear about that cause everyone seems to prefer ignoring my question. I learned english in german school 20 years ago...thats all

scargill commented 4 years ago

@nob0dy80 - thank you - yes, the multiple devices issue was a red herring (entirely my fault) and as far as I can tell, my existing IP tables solution works as I'm sure does yours. Since your last input I've been struggling with how to force node-red-contrib-alexa-echo to accept RGB colour set somewhere else instead of forcing it's own (input by speech) colours on a device... and for those griping about life stories - talk to the hand, I wrote node-red-contrib-bigtimer (as well as several other NR nodes) and I must've answered a million questions about it. I too do this stuff for "fun" - and yes I'm aware that daft questions are frustrating but that's how things are. Go to https://tech.scargill.net if you want a life story or two :-) OR stay here and help me figure out my RGB selection issue on a node that has nothing to do with node-red-contrib-alexa-local (I use that, too).

Oh you asked what kinds of lamps do I use? My own ESP8266 board with my own "esp-go" software and 5v serial LEDs... but that's academic - the Amazon Echo device node is putting out the info it got by voice and not the info I want to try to inject into it (after I've used dashboard to change colours). For me the easiest is to fill in the RGB array... though I could provide input in any format really. I even tried injecting into "Amazon echo hub the topic of the device, the device id that the hub will use to talk to the device and the rgb array - no effect. I must be missing something.

scargill commented 4 years ago

@nobody80 - your English is a hell of a lot better than my German.

nob0dy80 commented 4 years ago

@scargill i guess "red herring" is a british slang for something that is your fault. not used to that.

i'm with you. that is the reason why i changed it to scenes with direct hex inputs. i never made it work to tell the lamp a color. there were problems as long i can remember. only when the vendor part was inside (like the philips hue bridge) it was workin'. all that non proprietary (right word,right spelled?) software was never completely adaptedable to third-vendor solutions. and even when it works... the vendor only needs to do a little change and all systems crash.

but im also with you working together to find a solution and maybe a solution that is working arround all standards. maybe i can hit your nose on that interesting part: https://github.com/Koenkk/zigbee-shepherd-converters

i think this is the best color transformation table you can find atm

nob0dy80 commented 4 years ago

give your german a try :D

btw here you go...for sure its all about transform ...im pretty sure the converters will help even they are made for zigbee...doesnt matter cause the response and input remains the same

contact me on -delteted- (spam mail) when you contaced me, i give you the real email...dont see in github any contact possiblities

scargill commented 4 years ago

Nooo, I can manage (I can;;t even spell it) "guten aben, guten nacht, guten tag" and that's about it. At least in Spanish I can order 2 beers "dos cerbezas por favor" - except no real Spanish seem to say "por favor".

Don't worry about formats. The question is - what inputs does nrcae accept and where (the hub node or the device node?) Yes, "red herring" means "something that misleads or distracts from a relevant or important question" i.e. I just wasted everyone's time on that. Once we crack this colour thing I'll do my best to fully explain it all SOMEWHERE ELSE (like my blog) together with thanks for help received. I always do.

nob0dy80 commented 4 years ago

contact me on the email above, take a look at the link from the converters. pretty sure there are fucxxxx good informations in it.

the color thing was always anoying me too ...and for sure tons of others too

at least i'm sure you are with me when i'm saying that it has to be kind of universal...esp,hue, huawai, osram or whatever..there will never be a way to get arround a transformation table. so the converters are unavoidable

well at least you can say anything in spanish thats needed for a good holiday :-D

3ative commented 4 years ago

@nob0dy80 Sorry dude, just seen your question: "...you also had to do the port 80 redirection? "

Not here, I un-installed the old palette, deleted all the Alexa nodes from my flows and installed the new 'amazon-echo-hub' as is. Then added and named the 'amazon-echo-device' nodes. (obviously connecting them to the hub)

3ative commented 4 years ago

@scargill @nob0dy80

Not sure if it helps but, I use this to control my lights' Colour / Brightness / On/Off, etc..

Function

Here's the full 'Function Node' Code:

if (msg.payload === "on")
msg.payload =
{
    "service": "turn_on",
    data:
    {"rgb_color": msg.rgb, "brightness": msg.bri}
};
if (msg.payload === "off") msg.payload = {"service":"turn_off"}
return msg

With this you can say: Alexa, Turn [On/Off] [Light name] ... [Light name] [Brightness%] - E.G. 50% ... [Light name] [Colour] - E.G. Red/Blue/Pink.. or any colour she understands!

Or, for non-RGB lights and switches, you can just use this code:

if (msg.payload === "on") msg.payload = {"service":"turn_on"}
if (msg.payload === "off") msg.payload = {"service":"turn_off"}
return msg
nob0dy80 commented 4 years ago

@3ative thanks for your input... im working with iobroker from the first hour and dont know the frontend you are showing. is that homatic based? but at least nice you could adapt it to make it work for you i guess its only count of days till all functions are back to all users

really appreciate your feedback

btw ..take a look at iobroker..iobroker can include HA with more functions ;)

In Germany we call it "Eierlegende-Wollmilch-Sau" :-D :-D

3ative commented 4 years ago

@nob0dy80

OIC, iobroker looks nice.

What I have shown is my Node-Red flow / setup

nob0dy80 commented 4 years ago

@3ative sorry, just know that integrated in iobroker and it looks so differ you are on the bright site of the node-red alexa communication.

so dudes wrote my first entry when i were at work, and im still here..yeah its fuxxxx two days i hate working in IT...

needed to correct this text 5 times...hope i dont fell asleep driving home

alexlinno commented 4 years ago

teh alexa echo way works for me with the iptables....but even when I 'forget everything' I still discover devices I had with the alexa-local..eventhough I removed all nodes and deinstalled alexa-local...wierd,...I have to forget the doubles manually else it seems to confuse alexa....

Jibbonator commented 4 years ago

Now that you´re mentioning it. I had do delete the doubles manually too. One by one. Otherwise they were still there.

moryoav commented 4 years ago

I solved my Node-Red + Alexa problem by switching over to: "node-red-contrib-amazon-echo". This worked for me "out of the box", without doing anything with ports or iptables, just worked (I'm on Windows 10) All I had to do was to remove the old devices from the Alexa App, and after deploy in Node-Red the new devices got discovered automatically.