originallyus / node-red-contrib-alexa-local

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

Alexa-App always returns to default when controlling the node. #19

Closed WebOscar closed 6 years ago

WebOscar commented 6 years ago

Hello!

Yesterday I installed your great node and stumbled across the following problem:

When I use the Alexa-App, a device of the node-red-contrib-alexa-local-node always shows up with it's default(?)-settings of switched on and 49% brightness.

When I use the slider, the node becomes updated with the new bri, but a few seconds later the slider steps back to 49%, while the node keeps it's status. When I use the App to switch off, the node becomes updated and again, after a few seconds the status within the app returns to on.

Bad effect: Lets assume, the node is in status off while the App always says it's on. Then I have to touch the bulb-symbol twice, to switch the node on. First to off, which will set the node to off, while it is already off. Then, within a very short time, I have to touch the bulb-symbol again, which will then switch the node to on.

Same issue when I try to control the node via voice. I have to say "Switch off" first and then "Switch on", right after Alexas first "Okay", when the node is actually in state off, to switch in on.

Maybe I'm wrong, but shouldn't the node reply to the Alexa-App with it's actual status?

torinnguyen commented 6 years ago

How do you connect your slider to Alexa node?

torinnguyen commented 6 years ago

you may want to try the following flow. I have no problem with it.

[{"id":"a57684a3.62b398","type":"ui_slider","z":"eb842ff5.66df8","name":"","label":"slider","group":"7ad58dcb.0b8c94","order":0,"width":0,"height":0,"passthru":false,"topic":"","min":0,"max":"100","step":1,"x":210,"y":800,"wires":[["d8020692.1ce5e8"]]},{"id":"d8020692.1ce5e8","type":"alexa-local","z":"eb842ff5.66df8","devicename":"spot light","inputtrigger":false,"x":360,"y":800,"wires":[["461a426f.6828bc"]]},{"id":"df07b077.dd8b7","type":"debug","z":"eb842ff5.66df8","name":"","active":true,"console":"false","complete":"true","x":680,"y":870,"wires":[]},{"id":"461a426f.6828bc","type":"function","z":"eb842ff5.66df8","name":"","func":"msg.payload = msg.bri;\nreturn msg;","outputs":1,"noerr":0,"x":510,"y":870,"wires":[["a57684a3.62b398","df07b077.dd8b7"]]},{"id":"7ad58dcb.0b8c94","type":"ui_group","z":"","name":"Extras","tab":"7dac35ec.28480c","order":4,"disp":true,"width":"6"},{"id":"7dac35ec.28480c","type":"ui_tab","z":"","name":"Home","icon":"dashboard"}]

WebOscar commented 6 years ago

Thank you for your fast reply. I'll try as soon as I'm back home, tonight and let you know.

WebOscar commented 6 years ago

How do you connect your slider to Alexa node?

It's the default slider in the Alexa-App, when I tap the discovered device, which was provided by the alexa-local-node.

WebOscar commented 6 years ago

This is what I mean. A few seconds after any change, it jumps back to "on" and 49%

screenshot_20171108-122830

WebOscar commented 6 years ago

Okay, again: I don't mean a custom UI-Slider. I mean the built in slider within the (Android) Alexa-App.

I tried it again with a new install. Same result. The Slider always jumps back to 49% and the Bulb to status "on".

I'm not sure, if this is a bug in the Alexa-App or the node replys with wrong or no data to Alexa.

As long as I use only voice, it's working without issues. Okay, who else but me is using the Alexa-App? ;)

If nobody else has a problem with it, just close this issue. Thx!

tomsk31 commented 6 years ago

The code that returns the current status sends fixed data, including 'On' and brightness=49% (index.js, line 156)

WebOscar commented 6 years ago

Indeed! I wonder, why? Time for me to dive into Node-Red-Node-Programming. It cannot be too difficult to return the active values, isn't it?

torinnguyen commented 6 years ago

It is implemented that way in order to correct detect increase/decrease commands. Everything was designed to work correctly only in NodeRed. It is possible to return the correct status to Alexa, however, the node will lose a few capability and will not be as versatile as it is now.

Btw, my Alexa app never has that slider, not on iOS nor Android.

WebOscar commented 6 years ago

Okay. If there's a reason for it, I'll take it as it is. Voice control is working like charme and the app isn't really nescessary for me, as I will setup own sliders via node-red.

Strange thing! My Android is a OnePlus 3T. I'm going to revive my Galaxy Note 3 this evening to see if the Alexa-App will provide a slider there, too.

Btw: Thanks for your support!