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

Jibbonator commented 4 years ago

@moryoav Did you set the "Amazon Echo Hub" to port 80? Maybe Windows has less strict rules port of assigment.

moryoav commented 4 years ago

By default the input box had 80 in it, I didn't have to do anything. Just dragged the hub node and connected to devices, that's all. I didn't even have to open any ports in firewall or redirect anything. Just worked.

thePhilipp commented 4 years ago

I also use the Alexa local node. And of course, nothing works for me anymore. I'll probably try this with the port forwarding, but I hope somebody fixes the local node so that I can spare myself the manual intervention in the system.

regards

Jibbonator commented 4 years ago

For everyone who needs help or want to talk about this solution here is a Discord server, so this issue Topic is less full

And the Manual will be updated for better understanding on the Discord

https://discord.gg/Turn7Mm

nob0dy80 commented 4 years ago

since i guess there is no more development process in this node, nobody cares about length. as you see i used that thread like a chat too :-D :-D

oh damn ..i'm old... i have to google what discord is. why not use telegram at least ;)

Jibbonator commented 4 years ago

Yeah i thought, since there are several sites, addons, users with the same problem we could centralise it´s solution.

in Discord you can make text channels and Speak channels.

scargill commented 4 years ago

I could not find anyone in discord. Node Red Alexa local now (last few days since Amazon update) gets stuck in discovery even with discussed IP redirection.. Node Red amazon echo works perfectly. The double discovery was my fault (2 servers). NRCAE is difficult to inject colour values but it is doable as I discovered this morning. Working on that but on a 3 day beach trip now with no pc.

Jibbonator commented 4 years ago

just write in the text channels

slopsjon commented 4 years ago

I could not get the Amazon Echo Hub node to work by doing the ipTables changes but found this on the troubleshooting page Solution 1 Run Node-RED as root user sudo node-red

So I tried that and the hub node connected and Alexa discovered the device. This might explain why some people have not had to do any iptables changes as they are running node-red as root user. I am running DietPi distro so I will have to do more investigation on getting iptables to work.

torinnguyen commented 4 years ago

I'm the author of this node.

TL;DR; Please replace my node with this node node-red-contrib-amazon-echo


A few things to confirm: • My nodes is no longer working with any Alexa devices after recent updates. • The reason is discovery procedure needs to be hosted on port 80 of your NodeRed. • Newer generation of Alexa devices are not working with my node for the same reason. • I recommend switching over to this node node-red-contrib-amazon-echo. It is basically a clone of my node, with a separate Node for discovery, running on port 80 by default.

VERY IMPORTANT NOTE: • You probably need to restart the system after replacing my nodes to clear them from the system. • You need to make sure your port 80 is free & allowed to be used by NodeRED. You can either: • Run NodeRED as root user, which allow you to open any port on the system. OR • Use iptables to redirect xxxxx port to 80. Instructions are available here.

This hassle is exactly why I have designed my node to run on random ports, pretty newbie-proof for most users & did not change the implementation for newer generation of Alexa devices.

scargill commented 4 years ago

IP tables works, no need for root user. IP tables works with node-red-contrib-amazon-echo. I put my normal pi web pages on port 86 to free up port 80 and in the Amazon node I refer to a high up port. Works with echo rev 2 and 3. If anyone needs more I'm home late on Wednesday.

slopsjon commented 4 years ago

Thanks Torin for the update and your work on the node.

gordonthree commented 4 years ago

Echo hub working great me, I did have to delete all old devices from the Alexa app first. Although the brightness BRI is handled a bit different, had to tweak a few scripts.

I'm running nodered in a docker container with its own IP address, added --user 0 to the docker run command. Yes I know bad form to run something as root.

thePhilipp commented 4 years ago

Thanks Torin, I waited for this information

3ative commented 4 years ago

@gordonthree Same here, that last one had a "brightness_pct" output that came in quite handy, for 0-100% brightness and sliders, etc. To get the same now, was just a li'bit of maths to convert it.

@torinnguyen I would also like to "echo" the thanks for your node. :)

3ative commented 4 years ago

I'm Un-subb-ing from this thread - as I consider it [SOLVED]-somewhat!

"So long... and thanks for all the fish. x"

gordonthree commented 4 years ago

Thanks David for the code, more elegant than my solution.

On Mon, Sep 16, 2019, 11:21 David Martin notifications@github.com wrote:

@gordonthree https://github.com/gordonthree Same here, that last one had a "brightness_pct" output that came in quite handy, for 0-100% brightness and slider, etc. To get the same now, was just a li'bit of maths to convert it.

  • I used this:

msg = {"payload": (msg.bri/254)*100}; return msg

@torinnguyen https://github.com/torinnguyen I would also like to "echo" the thanks for your node. :)

— 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=AEAWMMZLFLNQNIEDHG7PQULQJ6P6LA5CNFSM4IUGT462YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6ZQKBA#issuecomment-531825924, or mute the thread https://github.com/notifications/unsubscribe-auth/AEAWMM33C7BLSYH6UZF2EXTQJ6P6LANCNFSM4IUGT46Q .

scargill commented 4 years ago

You mean by email? pete@scargill.org

On 16 September 2019 20:31:56 David Martin notifications@github.com wrote:

@scargill How do I get in contact with you?— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

scargill commented 4 years ago

I wrote code to convert hsv to RGB - worked ALMOST 100%. would be better if I knew how to put Amazon echo node into RGB mode.

On 16 September 2019 20:31:56 David Martin notifications@github.com wrote:

@scargill How do I get in contact with you?— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

3ative commented 4 years ago

@scargill No worries Pete, I had a problem with BigTimer but, I sorted it.

As for the RGB, the 'amazon-echo-device' node already gives the 3 RBG values out. it's "msg.rgb"

scargill commented 4 years ago

It's not the OUT that worries me, it's the IN. I may set the colour in Alexa OR some other way like dashboard and I need the Amazon Echo node to be aware I changed colour externally. Up to now it seems to insist on working in hsv mode even though it has RGB out. If I'm missing something please do tell to save me using a convertor node.

3ative commented 4 years ago

@scargill Oh, I didn't know Alexa could take an input like that... although, I can't see the use of having her know such data. As far as I can see she's just a voice input device. Can you ask her the status of a light then?

scargill commented 4 years ago

Alexa can control light colour or temperature via the app but if you also need non speech control is node red dashboard or Blunk then you need to be able to sync the Alexa node to whatever other control system you are using .Ive manage with hsv input but RGB would be better which means changing mode via the Alexa node input to RGB.

On 17 September 2019 14:21:58 David Martin notifications@github.com wrote:

@scargill Oh, I didn't know Alexa could take an input like that... although, I can't see the use of having her know such data. As far as I can see she's just a voice input device. Can you ask her the status of a light then?— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

3ative commented 4 years ago

I'm still not sure why Alexa would need to know. Either your cpanel's input or Alexa would control the colour... Unless to only way to get Node-Red to update dashboard or Blink is back via Alexa... Or your Alexa is one of the ones with its own display.

scargill commented 4 years ago

The Alexa node needs to know that colour any other system like node red dashboard has set, say an esp based light controller to and vice versa, the other system(s) need to know if you changed the colour using the Alexa node.

scargill commented 4 years ago

One of us is missing something here. There is no Cpanel on my Raspberry pi. I have this working incidentally, I'm just not 100% happy about the RGB to HSV conversion, the NR Amazon Echo app uses 0-65k for H and S and the convertor a vastly different range. One day I may want to set colour using Alexa, another day I might be remote and want to use NR dashboard via VPN. I would be happier if I coul use the NR Amazon Echo node input to use RGB mode. If it can't be changed there is no point did n having that mode indicator on the output.

thePhilipp commented 4 years ago

Maybe that's helpful for you. I did not understand everything your problem is but the feedback to Alexa is, I think, what you are looking for

https://github.com/datech/node-red-contrib-amazon-echo/wiki/Integration-with-Sonoff-Tasmota

3ative commented 4 years ago

@scargill Cpanel i mentioned = NR Dashboard - I'm assuming there's some sort of status display going on. :)

I think I get it now, in order for Alexa to know what the state of an entity is, and therefore display that in its own App / other integration, 'she' needs some sort of input / status update.

scargill commented 4 years ago

Thanks but oñ/off is easy.. what I've not figured out is how to use input to change the mode NRCAE is using. Ie from hsv to RGB as the latter is easier for me and doesn't require conversion.

nob0dy80 commented 4 years ago

switched over now to contrib-amazon-echo

Maybe i'm missing some point of logical thinking, but why is the last value of msg.bri also send when i say to turn the light off ? This results for me in sending a false to the state (thats fine) and the last value of msg.bri to brightness which results in turning the lights on again ... any tips for me ?

gordonthree commented 4 years ago

@nobody80 I don't have my code in front of me but there is an on/off flag you can test for the state of the light. If it matches the off state, I send an off command to my device and ignore the brightness.

nob0dy80 commented 4 years ago

@gordonthree damn it.. that really helped. Thanks alot. i connected the dimmer directly to the device. that was the error. after connecting it to the "on" output of a switch, it works.

now the last problem is that "turn light on" will turn it on with the last known brightness value. would prefer if a "on"-command always starts with 50% brightness. only a question of time to fix this too :-D

gordonthree commented 4 years ago

For that you'll have to keep track of your device on/off state separately from Alexa. Either a database or persistent variable depending on how many of these lights you want working this way.

nob0dy80 commented 4 years ago

@gordonthree i guess that will work at best within javascript and keeping track with "on change" at the datapoint, right?

3ative commented 4 years ago

@nob0dy80

If this helps, this is my Node-Red Function node code for controlling my RGB LED strip light.

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 it I can turn on/off and set both brightness and colour.

nob0dy80 commented 4 years ago

@3ative on/off and brightness isnt a problem any longer. But i tried to started with color now.

my problem is, the Philips Hue RGB Strip accepts only HEX for colorchanging .. Is there a best practice way to convert it ?

maybe you can show me one of your flows for changing colors.

nob0dy80 commented 4 years ago

tried with NODE-RED-CONTRIB-COLOR-CONVERT

when connected directly to the device, i get msg.rgb undefined

if i add a function between it with your code shortened to filter only the rgb string out like msg.payload = { data: {"rgb_color": msg.rgb} }; return msg

i get "array wrong size" :-/ maybe i just shortened the code wrong

3ative commented 4 years ago

@nob0dy80 Working on it.... gimme a few minutes

3ative commented 4 years ago

@nob0dy80 I put your code in my Function node - It works here.

3ative commented 4 years ago

@nob0dy80 I don't have that "NODE-RED-CONTRIB-COLOR-CONVERT" but, I guess it's changing the msg.rgb to something other than an array of 3. I.E: it's no longer something like - [255,255,255]

nob0dy80 commented 4 years ago

@3ative talked with developer..with my code, it cant work because its msg.payload.data at the end

correct code is msg.payload = msg.rgb return msg

working now.. now i have to fix the problem when i turn on the light, it starts with with the color that was last set. e" and not with warm white.

its like dimming. if you turn the light on, it starts with the last dim-status.

but i think i will work on that problem tomorrow..

so using color with contrib-amazon-echo and philips hue bulbs on a zigbee adapter should look like this:

image

nob0dy80 commented 4 years ago

@3ative yeah it changes the 3 digit array to an hex code which is needed for philips hue on a zigbee adapter

DarrenSchwartz commented 4 years ago

I put my normal pi web pages on port 86 to free up port 80 and in the Amazon node I refer to a high up port.

I considered doing this too, but since LetsEncrypt needs port 80 open, it seems I can't move my web server off port 80. Am I out of options (assuming I don't want to run node red as root)?