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

Full deploy causes Node-Red to crash #6

Closed juggledad closed 6 years ago

juggledad commented 6 years ago

osx 10.12.6 nr v0.17.5 node.js v6.11.0 node-red-contrib-alexa-local v0.1.10

When I do a Deploy (Full) - even if I haven’t touched the Alexa node) or a deploy (Modified Flows) - when I’ve changed the Alexa node like adding a Name - node-red crashes with the following:

10 Oct 06:02:25 - [red] Uncaught Exception: 10 Oct 06:02:25 - Error: listen EADDRINUSE :::61360 at Object.exports._errnoException (util.js:1018:11) at exports._exceptionWithHostPort (util.js:1041:20) at Server._listen2 (net.js:1258:14) at listen (net.js:1294:10) at Server.listen (net.js:1390:5) at new AlexaLocalNode (/Users/Paul/.node-red/node_modules/node-red-contrib-alexa-local/index.js:25:20) at createNode (/usr/local/lib/node_modules/node-red/red/runtime/nodes/flows/Flow.js:305:18) at Flow.start (/usr/local/lib/node_modules/node-red/red/runtime/nodes/flows/Flow.js:89:35) at start (/usr/local/lib/node_modules/node-red/red/runtime/nodes/flows/index.js:300:29) at /usr/local/lib/node_modules/node-red/red/runtime/nodes/flows/index.js:137:21 Pauls-mini:.node-red Paul$

Let me know if you need more information

torinnguyen commented 6 years ago

I've just made a fixed. Please try the latest version.

juggledad commented 6 years ago

Now I get:

11 Oct 13:50:30 - [info] Stopped modified flows 11 Oct 13:50:30 - [info] Starting modified flows 11 Oct 13:50:30 - [info] Started modified flows 11 Oct 13:50:30 - [red] Uncaught Exception: 11 Oct 13:50:30 - ReferenceError: server is not defined at Immediate. (/Users/Paul/.node-red/node_modules/node-red-contrib-alexa-local/index.js:51:17) at runCallback (timers.js:672:20) at tryOnImmediate (timers.js:645:5) at processImmediate [as _immediateCallback] (timers.js:617:5) Pauls-mini:.node-red Paul$

juggledad commented 6 years ago

Also Alexa no longer can discover the device

scargill commented 6 years ago

Yup, I just grabbed the version - which in the Node-Red install section says 0.2.0 but according to this is 0.2.1 - well, either way, it crashes Node-Red for me - sometimes, not ENTIRELY sure I can pin it down - I think it did it when I took the node OFF the workspace... anyway, neither Yesterday's version nor today's version is being picked up by Alexa - in my setup Alexa always picks up devices including Ha-Bridge... so I'd be very surprised if it is my setup. Eagerly awaiting a working version of this...

juggledad commented 6 years ago

Ok, loks like v0.2.2 is working...for now (grin)

torinnguyen commented 6 years ago

I've discovered a couple more bugs. Just published v0.2.2. If you don't see it, try installing it directly with npm install node-red-contrib-alexa-local inside ~/.node-red If it still doesn't work. Maybe you want to double check your firewall/ufw, if any.

scargill commented 6 years ago

Direct is often best… my node-red-contrib-bigtimer usually takes hours before the flows web page shows the update….

Grabbing 0.2.4 within Node-Red – you must’ve been busy….

Erm, checking….. I don’t have a Firewall on the PI that I’m aware of…. Certainly not installed – bog standard Raspbian – then Node-red added.

So – installed in the palette system – refreshed screen – dragged to the main screen…. So far so good. Did selective deploy as usual… realised I wanted it on a new tab – CUT - new tab – paste - “lost connection – reconnecting” – Node-Red NEVER does this to me.. deployed on new tab…… “Alexa – find devices”. 11 devices becomes 12. Wheeeeee.

Discovering now… but you might just want to experiment with loading and dropping that node and moving it about etc… I can’t narrow that down. It DOES however appear to work – I’ll blog this.

Pete.

From: Torin Nguyen [mailto:notifications@github.com] Sent: 12 October 2017 10:33 To: originallyus/node-red-contrib-alexa-local node-red-contrib-alexa-local@noreply.github.com Cc: Peter Scargill pete@scargill.org; Comment comment@noreply.github.com Subject: Re: [originallyus/node-red-contrib-alexa-local] Full deploy causes Node-Red to crash (#6)

I've discovered a couple more bugs. Just published v0.2.2. If you don't see it, try installing it directly with npm install node-red-contrib-alexa-local inside ~/.node-red If it still doesn't work. Maybe you want to double check your firewall/ufw, if any.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/originallyus/node-red-contrib-alexa-local/issues/6#issuecomment-336075002 , or mute the thread https://github.com/notifications/unsubscribe-auth/ABzUg1rtis16X7KxDxfvQF6Dv9e2vmFuks5srdzngaJpZM4P1h-S . https://github.com/notifications/beacon/ABzUg19A4Lzfgl0GUaFsGYeIALAGpHqAks5srdzngaJpZM4P1h-S.gif

scargill commented 6 years ago

Just something…

“Alexa, decrease little boy temperature”…. I’m half sure that should work – and Alexa says ok – but nothing out of your node… similarly “increase little boy temperature” – THIS time there IS an output and Alexa says ok and there is output – but no change in values.

Care to tackle that, I think they should both work…..

Pete.

From: Torin Nguyen [mailto:notifications@github.com] Sent: 12 October 2017 10:33 To: originallyus/node-red-contrib-alexa-local node-red-contrib-alexa-local@noreply.github.com Cc: Peter Scargill pete@scargill.org; Comment comment@noreply.github.com Subject: Re: [originallyus/node-red-contrib-alexa-local] Full deploy causes Node-Red to crash (#6)

I've discovered a couple more bugs. Just published v0.2.2. If you don't see it, try installing it directly with npm install node-red-contrib-alexa-local inside ~/.node-red If it still doesn't work. Maybe you want to double check your firewall/ufw, if any.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/originallyus/node-red-contrib-alexa-local/issues/6#issuecomment-336075002 , or mute the thread https://github.com/notifications/unsubscribe-auth/ABzUg1rtis16X7KxDxfvQF6Dv9e2vmFuks5srdzngaJpZM4P1h-S . https://github.com/notifications/beacon/ABzUg19A4Lzfgl0GUaFsGYeIALAGpHqAks5srdzngaJpZM4P1h-S.gif

scargill commented 6 years ago

Here’s where I’m up to – by all means pass comments… I think people will be interested in this … https://tech.scargill.net/more-alexa-marvels/

From: Torin Nguyen [mailto:notifications@github.com] Sent: 12 October 2017 10:33 To: originallyus/node-red-contrib-alexa-local node-red-contrib-alexa-local@noreply.github.com Cc: Peter Scargill pete@scargill.org; Comment comment@noreply.github.com Subject: Re: [originallyus/node-red-contrib-alexa-local] Full deploy causes Node-Red to crash (#6)

I've discovered a couple more bugs. Just published v0.2.2. If you don't see it, try installing it directly with npm install node-red-contrib-alexa-local inside ~/.node-red If it still doesn't work. Maybe you want to double check your firewall/ufw, if any.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/originallyus/node-red-contrib-alexa-local/issues/6#issuecomment-336075002 , or mute the thread https://github.com/notifications/unsubscribe-auth/ABzUg1rtis16X7KxDxfvQF6Dv9e2vmFuks5srdzngaJpZM4P1h-S . https://github.com/notifications/beacon/ABzUg19A4Lzfgl0GUaFsGYeIALAGpHqAks5srdzngaJpZM4P1h-S.gif

torinnguyen commented 6 years ago

Thanks for your article.

I'll troubleshoot the deployment issues. I do get it myself from time to time.

The problem with increase/decrease temperature commands is that I need to keep track of the current state/value of the devices inside my node. Currently it's just hardcoded values. here https://github.com/originallyus/node-red-contrib-alexa-local/blob/master/index.js#L126

I have no problem storing the values based on the last command issues, but that would not be consistent if you interact with the device via other input. Alternatively I can add a input to my node to let you update the value yourself. What do you think?

Btw, the reason why decrease command didn't work is because the device's state is already "on":false as seen in line 126.

scargill commented 6 years ago

Ok so two things here..

Firstly – consistency - increase returns a value (but no change) – decrease doesn’t return anything at all… that needs a fix…

You don’t need to store the value if that’s a worry because that could be stored in the next stage…. but – if you don’t want to store anything – here’s a thought..

Return a field that says + or – OR a value.

So if I say set the temperature to 30 - then you return 30

If I say increase the temperature then you return +

If I say decrease the temperature then you return –

That way the user gets to control the temperature or brilliance increase instead of Alexa – which is a GOOD thing – but we need to know when an absolute has been specified so that we Can reset the value..

Does that make sense?

From: Torin Nguyen [mailto:notifications@github.com] Sent: 12 October 2017 13:26 To: originallyus/node-red-contrib-alexa-local node-red-contrib-alexa-local@noreply.github.com Cc: Peter Scargill pete@scargill.org; Comment comment@noreply.github.com Subject: Re: [originallyus/node-red-contrib-alexa-local] Full deploy causes Node-Red to crash (#6)

Thanks for your article.

I'll troubleshoot the deployment issues. I do get it myself from time to time.

The problem with increase/decrease temperature commands is that I need to keep track of the current state/value of the devices inside my node. Currently it's just hardcoded values. here https://github.com/originallyus/node-red-contrib-alexa-local/blob/master/index.js#L126

I have no problem storing the values based on the last command issues, but that would not be consistent if you interact with the device via other input. Alternatively I can add a input to my node to let you update the value yourself. What do you think?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/originallyus/node-red-contrib-alexa-local/issues/6#issuecomment-336115809 , or mute the thread https://github.com/notifications/unsubscribe-auth/ABzUg2cMNQfINE_a0-cUllIMHQijh3oUks5srgU8gaJpZM4P1h-S . https://github.com/notifications/beacon/ABzUgzAVit1dfEQz7s2vMsbvrjTakrYMks5srgU8gaJpZM4P1h-S.gif

torinnguyen commented 6 years ago

I've just added 'change_direction' parameter when the command is increase/decrease. This was done by some black magic in the code.

node-red 2017-10-13 00-07-11

When you give Alexa an increase/decrease command, Alexa first perform a GET to my Node to retrieve the current 'bri' of the light, then she always decides to increase/decrease 25% from that value; that's how I detected her magic.

Note that this 'change_direction' does not work with commands like "Alexa, increase/decrease XXX temperature by 10%".

scargill commented 6 years ago

In the process of uninstalling and installing (Node-Red palette) – I lost Node-Red momentarily… when it came back, no install. I installed again.

It does seem to work. Will update blog accordingly. Thanks.

There is an issue – not sure if it is Node-Red – or the node- or Alexa…. Rename the node – and when you re-check Alexa it reports the same number of devices – but sometimes still seems to know about the original name…

Pete

From: Torin Nguyen [mailto:notifications@github.com] Sent: 12 October 2017 18:13 To: originallyus/node-red-contrib-alexa-local node-red-contrib-alexa-local@noreply.github.com Cc: Peter Scargill pete@scargill.org; Comment comment@noreply.github.com Subject: Re: [originallyus/node-red-contrib-alexa-local] Full deploy causes Node-Red to crash (#6)

I've just added 'change_direction' parameter when the command is increase/decrease. This was done by some black magic in the code. https://user-images.githubusercontent.com/767320/31509163-bda5facc-afaa-11e7-8ba1-0c1879a73105.png

When you give Alexa an increase/decrease command, Alexa first perform a GET to my Node to retrieve the current 'bri' of the light, then she always decides to increase/decrease 25% from that value; that's how I detected her magic.

Note that this 'change_direction' does not work with commands like "Alexa, increase/decrease XXX temperature by 10%".

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/originallyus/node-red-contrib-alexa-local/issues/6#issuecomment-336204232 , or mute the thread https://github.com/notifications/unsubscribe-auth/ABzUg9gd1mbzMLxECSncM7oppnWflhURks5srkiwgaJpZM4P1h-S . https://github.com/notifications/beacon/ABzUgxcyapYwLhasvKWcvuq2dDX8gI0lks5srkiwgaJpZM4P1h-S.gif

scargill commented 6 years ago

Something else you might want to look at.

Alexa set big boy brightness to 60%

Does that… but if big boy is OFF – the msg.payload is still “OFF” – personally I’d change that to ON if brightness/temperature is changed or if a new value is sent

The only problem with that is …. If you send OFF command – how does it know you sent OFF and not a brightness command….

Hmmm.

So right now – you really have to send a brightness command AND a command to turn the light on…. Got to be a better way… like – something that says what the last command was – was it a brightness, an up down or an on off….

From: Torin Nguyen [mailto:notifications@github.com] Sent: 12 October 2017 18:13 To: originallyus/node-red-contrib-alexa-local node-red-contrib-alexa-local@noreply.github.com Cc: Peter Scargill pete@scargill.org; Comment comment@noreply.github.com Subject: Re: [originallyus/node-red-contrib-alexa-local] Full deploy causes Node-Red to crash (#6)

I've just added 'change_direction' parameter when the command is increase/decrease. This was done by some black magic in the code. https://user-images.githubusercontent.com/767320/31509163-bda5facc-afaa-11e7-8ba1-0c1879a73105.png

When you give Alexa an increase/decrease command, Alexa first perform a GET to my Node to retrieve the current 'bri' of the light, then she always decides to increase/decrease 25% from that value; that's how I detected her magic.

Note that this 'change_direction' does not work with commands like "Alexa, increase/decrease XXX temperature by 10%".

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/originallyus/node-red-contrib-alexa-local/issues/6#issuecomment-336204232 , or mute the thread https://github.com/notifications/unsubscribe-auth/ABzUg9gd1mbzMLxECSncM7oppnWflhURks5srkiwgaJpZM4P1h-S . https://github.com/notifications/beacon/ABzUgxcyapYwLhasvKWcvuq2dDX8gI0lks5srkiwgaJpZM4P1h-S.gif

scargill commented 6 years ago

Forget that – I just notice ON:true and ON:false. Can work from that. Mind you – you have to check for ON being there at all – bit of a pain – rather than true or false as states – maybe “true”, “false”, “unchanged” ?????

From: Torin Nguyen [mailto:notifications@github.com] Sent: 12 October 2017 18:13 To: originallyus/node-red-contrib-alexa-local node-red-contrib-alexa-local@noreply.github.com Cc: Peter Scargill pete@scargill.org; Comment comment@noreply.github.com Subject: Re: [originallyus/node-red-contrib-alexa-local] Full deploy causes Node-Red to crash (#6)

I've just added 'change_direction' parameter when the command is increase/decrease. This was done by some black magic in the code. https://user-images.githubusercontent.com/767320/31509163-bda5facc-afaa-11e7-8ba1-0c1879a73105.png

When you give Alexa an increase/decrease command, Alexa first perform a GET to my Node to retrieve the current 'bri' of the light, then she always decides to increase/decrease 25% from that value; that's how I detected her magic.

Note that this 'change_direction' does not work with commands like "Alexa, increase/decrease XXX temperature by 10%".

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/originallyus/node-red-contrib-alexa-local/issues/6#issuecomment-336204232 , or mute the thread https://github.com/notifications/unsubscribe-auth/ABzUg9gd1mbzMLxECSncM7oppnWflhURks5srkiwgaJpZM4P1h-S . https://github.com/notifications/beacon/ABzUgxcyapYwLhasvKWcvuq2dDX8gI0lks5srkiwgaJpZM4P1h-S.gif

scargill commented 6 years ago

OH, I’#ve just realised an issue – I don’t know if it is the node.. but

Turn big boy ON - sets it to 100%

Set big boy to 50% - sets it to 50%

Turn big box OFF – sets it to 0%

Turn big box ON – sets it to 100%

That is not what you’d expect from a controllable light – and CERTAINLY not from a heating system

When I set a light to 50% and turn it off and on again – I’d expect it to come on at the level I last used it….

I’m guessing it is possible to do this in a function afterwards – but…. I would have thought that my logic is correct.

Incidentally it is easy for you to keep values in between uses of the node…. Just put the vars outside of any functions and they’ll still be there - I do that in bigtimer…. – ok lost when the power is lost of course…

From: Torin Nguyen [mailto:notifications@github.com] Sent: 12 October 2017 18:13 To: originallyus/node-red-contrib-alexa-local node-red-contrib-alexa-local@noreply.github.com Cc: Peter Scargill pete@scargill.org; Comment comment@noreply.github.com Subject: Re: [originallyus/node-red-contrib-alexa-local] Full deploy causes Node-Red to crash (#6)

I've just added 'change_direction' parameter when the command is increase/decrease. This was done by some black magic in the code. https://user-images.githubusercontent.com/767320/31509163-bda5facc-afaa-11e7-8ba1-0c1879a73105.png

When you give Alexa an increase/decrease command, Alexa first perform a GET to my Node to retrieve the current 'bri' of the light, then she always decides to increase/decrease 25% from that value; that's how I detected her magic.

Note that this 'change_direction' does not work with commands like "Alexa, increase/decrease XXX temperature by 10%".

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/originallyus/node-red-contrib-alexa-local/issues/6#issuecomment-336204232 , or mute the thread https://github.com/notifications/unsubscribe-auth/ABzUg9gd1mbzMLxECSncM7oppnWflhURks5srkiwgaJpZM4P1h-S . https://github.com/notifications/beacon/ABzUgxcyapYwLhasvKWcvuq2dDX8gI0lks5srkiwgaJpZM4P1h-S.gif

torinnguyen commented 6 years ago

That is the issue with consistency I mentioned previously. Yes, I can save the value inside my node using node-persistent so it will persist even after a full reboot.

However, assuming I have implemented such feature, there is always this scenario: • Turn big boy ON - sets it to 100% -> save 100% value • Set big boy to 50% - sets it to 50% -> save 50% value • Turn big box OFF – sets it to 0% -> the saved value is still 50% • Someone manually set it to 30% either physically or via MQTT or whichever other input you have in your NodeRed flow. • Turn big box ON – it will be set to 50% -> because the saved value is still 50%

Unless my node has an Input for you to update the value, this scenario cannot be workaround any other ways.

Last note, when you rename a device, you will need to ask Alexa to discover it again. This cannot be done automatically.

scargill commented 6 years ago

Yes an input to preset the value would be necessary if manual override is possible

On 13 October 2017 03:37:52 Torin Nguyen notifications@github.com wrote:

That is issue with consistency I mentioned previously. Yes, I can save the value inside my node using node-persistent so it will persist even after a full reboot.

However, assuming I have implemented such feature, there is always this scenario: • Turn big boy ON - sets it to 100% -> save 100% value • Set big boy to 50% - sets it to 50% -> save 50% value • Turn big box OFF – sets it to 0% -> the saved value is still 50% • Someone manually set it to 30% either physically or via MQTT or whichever other input you have in your NodeRed flow. • Turn big box ON – it will be set to 50% -> because the saved value is still 50%

Unless my node has an Input for you to update the value, this scenario cannot be workaround any other ways.

Last note, when you rename a device, you will need to ask Alexa to discover it again. This cannot be done automatically.

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/originallyus/node-red-contrib-alexa-local/issues/6#issuecomment-336334124

torinnguyen commented 6 years ago

alright, we got this feature in the latest version.

scargill commented 6 years ago

Erm, if you have an input in the latest version….. not seeing it in the docs here???

https://github.com/originallyus/node-red-contrib-alexa-local

??

From: Torin Nguyen [mailto:notifications@github.com] Sent: 13 October 2017 09:57 To: originallyus/node-red-contrib-alexa-local node-red-contrib-alexa-local@noreply.github.com Cc: Peter Scargill pete@scargill.org; Comment comment@noreply.github.com Subject: Re: [originallyus/node-red-contrib-alexa-local] Full deploy causes Node-Red to crash (#6)

alright, we got this feature in the latest version.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/originallyus/node-red-contrib-alexa-local/issues/6#issuecomment-336392823 , or mute the thread https://github.com/notifications/unsubscribe-auth/ABzUg_AKrOuG-yGQjJrWDoUt6j5yZL04ks5sryW_gaJpZM4P1h-S . https://github.com/notifications/beacon/ABzUg0FxS0NJVU79QrBX1wWy7-1RyVXhks5sryW_gaJpZM4P1h-S.gif

torinnguyen commented 6 years ago

I didn't update README.md. The node info inside is updated.

scargill commented 6 years ago

I have an inject node – the new alexa node – and output.

Turn it on – it goes to 100, inject 45, nothing happens. Turn it off – the output value goes to 0. Turn it on – the value goes to 100.

That is just not right…

But this….

Alexa – increase the temperature of big boy..

That turned it ON at 100.

Set input to 45 (inject input).

Alexa – decrease the temperature of big boy…

That set the value to 24

That’s REALLY not right…

From: Torin Nguyen [mailto:notifications@github.com] Sent: 13 October 2017 11:13 To: originallyus/node-red-contrib-alexa-local node-red-contrib-alexa-local@noreply.github.com Cc: Peter Scargill pete@scargill.org; Comment comment@noreply.github.com Subject: Re: [originallyus/node-red-contrib-alexa-local] Full deploy causes Node-Red to crash (#6)

I didn't update README.md. The node info inside is updated.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/originallyus/node-red-contrib-alexa-local/issues/6#issuecomment-336411359 , or mute the thread https://github.com/notifications/unsubscribe-auth/ABzUg3Mlb3J6MtSx9KyuTfYCZcLrKRFxks5srzeTgaJpZM4P1h-S . https://github.com/notifications/beacon/ABzUgxJUAOxJre20SQNMs4xv9QF24HXsks5srzeTgaJpZM4P1h-S.gif

torinnguyen commented 6 years ago

from your description, it looks like your inject node doesnt give the right format. it should be an inject node, set the payload to Number and type in a number between 0-100. when injection is successful, you should see a blue node status below alexa node showing you the number that you have injected

On Oct 13, 2017 5:52 PM, "Peter Scargill" notifications@github.com wrote:

I have an inject node – the new alexa node – and output.

Turn it on – it goes to 100, inject 45, nothing happens. Turn it off – the output value goes to 0. Turn it on – the value goes to 100.

That is just not right…

But this….

Alexa – increase the temperature of big boy..

That turned it ON at 100.

Set input to 45 (inject input).

Alexa – decrease the temperature of big boy…

That set the value to 24

That’s REALLY not right…

From: Torin Nguyen [mailto:notifications@github.com] Sent: 13 October 2017 11:13 To: originallyus/node-red-contrib-alexa-local < node-red-contrib-alexa-local@noreply.github.com> Cc: Peter Scargill pete@scargill.org; Comment < comment@noreply.github.com> Subject: Re: [originallyus/node-red-contrib-alexa-local] Full deploy causes Node-Red to crash (#6)

I didn't update README.md. The node info inside is updated.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ originallyus/node-red-contrib-alexa-local/issues/6#issuecomment-336411359 , or mute the thread https://github.com/notifications/unsubscribe-auth/ ABzUg3Mlb3J6MtSx9KyuTfYCZcLrKRFxks5srzeTgaJpZM4P1h-S . < https://github.com/notifications/beacon/ABzUgxJUAOxJre20SQNMs4xv9QF24H Xsks5srzeTgaJpZM4P1h-S.gif>

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/originallyus/node-red-contrib-alexa-local/issues/6#issuecomment-336419319, or mute the thread https://github.com/notifications/unsubscribe-auth/AAu1WAn3EmzvlOoyCX-FIOydUiegV3s4ks5sr0DYgaJpZM4P1h-S .

scargill commented 6 years ago

Numeric input on inject node – with value 45 in it. Let’s take the case where the Alexa node is on. Underneath it says “on (p:43417)”. No matter what number I inject into the input, that remains the same (alternative being “off :43427)”

Trust me – it’s a number – and it is going in.

From: Torin Nguyen [mailto:notifications@github.com] Sent: 13 October 2017 12:34 To: originallyus/node-red-contrib-alexa-local node-red-contrib-alexa-local@noreply.github.com Cc: Peter Scargill pete@scargill.org; Comment comment@noreply.github.com Subject: Re: [originallyus/node-red-contrib-alexa-local] Full deploy causes Node-Red to crash (#6)

from your description, it looks like your inject node doesnt give the right format. it should be an inject node, set the payload to Number and type in a number between 0-100. when injection is successful, you should see a blue node status below alexa node showing you the number that you have injected

On Oct 13, 2017 5:52 PM, "Peter Scargill" <notifications@github.com mailto:notifications@github.com > wrote:

I have an inject node – the new alexa node – and output.

Turn it on – it goes to 100, inject 45, nothing happens. Turn it off – the output value goes to 0. Turn it on – the value goes to 100.

That is just not right…

But this….

Alexa – increase the temperature of big boy..

That turned it ON at 100.

Set input to 45 (inject input).

Alexa – decrease the temperature of big boy…

That set the value to 24

That’s REALLY not right…

From: Torin Nguyen [mailto:notifications@github.com] Sent: 13 October 2017 11:13 To: originallyus/node-red-contrib-alexa-local < node-red-contrib-alexa-local@noreply.github.com mailto:node-red-contrib-alexa-local@noreply.github.com > Cc: Peter Scargill <pete@scargill.org mailto:pete@scargill.org >; Comment < comment@noreply.github.com mailto:comment@noreply.github.com > Subject: Re: [originallyus/node-red-contrib-alexa-local] Full deploy causes Node-Red to crash (#6)

I didn't update README.md. The node info inside is updated.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub <https://github.com/ https://github.com/%0b originallyus/node-red-contrib-alexa-local/issues/6#issuecomment-336411359> , or mute the thread <https://github.com/notifications/unsubscribe-auth/ https://github.com/notifications/unsubscribe-auth/%0b ABzUg3Mlb3J6MtSx9KyuTfYCZcLrKRFxks5srzeTgaJpZM4P1h-S> . < https://github.com/notifications/beacon/ABzUgxJUAOxJre20SQNMs4xv9QF24H Xsks5srzeTgaJpZM4P1h-S.gif>

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/originallyus/node-red-contrib-alexa-local/issues/6#issuecomment-336419319, or mute the thread https://github.com/notifications/unsubscribe-auth/AAu1WAn3EmzvlOoyCX-FIOydUiegV3s4ks5sr0DYgaJpZM4P1h-S .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/originallyus/node-red-contrib-alexa-local/issues/6#issuecomment-336426947 , or mute the thread https://github.com/notifications/unsubscribe-auth/ABzUgz8VrmG6CDW9XjW3JNaJXn9gs2PEks5sr0qggaJpZM4P1h-S . https://github.com/notifications/beacon/ABzUg65oL8snDKU8ujDLY5-Ldolq-59hks5sr0qggaJpZM4P1h-S.gif

torinnguyen commented 6 years ago

I misread your comments. The input value are working as it should.

The exception is at the output when you issue an increase/decrease commands. I had to use a little magic number internally in order to be able to differentiate increase/decrease command from normal dimming command. Therefore, when you issue increase/decrease command, the 'bri' output is always 74 & 24 respectively. There is really no other way to make this differentiation while giving you the freedom to decide your own increment/decrement step size.

The correct way to look at the output is: as long as you see a change_direction != 0, simply ignore the 'bri' and use your own logics.