hardillb / node-red-alexa-home-skill-web

Apache License 2.0
45 stars 28 forks source link

IncrementPercentageRequest & DecrementPercentageRequest aren't working correctly. #52

Closed prabbit237 closed 6 years ago

prabbit237 commented 6 years ago

I've setup a simple test device named "test" with "on", "off", "+%" and "-%" and the type is a light. Telling Alexa to turn test on and off works fine. Saying "Alexa, turn test down" gets me:

{"topic":"","name":"test","_messageId":"f675a8f3-0c70-4616-8754-891347f2c79e","_applianceId":"18589","_confId":"5af8adf0.7c5f94","command":"DecrementPercentageRequest","extraInfo":{},"payload":-25,"_msgid":"c8649dc.ad5cd6"}

Well, I can convert the -25 to some other number so it's OK that it's using "-25" instead of "-10" for the payload. But saying "Alexa, turn test up", instead of the expected:

{"topic":"","name":"test","_messageId":"f675a8f3-0c70-4616-8754-891347f2c79e","_applianceId":"18589","_confId":"5af8adf0.7c5f94","command":"IncrementPercentageRequest","extraInfo":{},"payload":25,"_msgid":"c8649dc.ad5cd6"}

I get:

{"topic":"","name":"test","_messageId":"674a2e3a-8644-47fd-b5ab-914f3d557c8c","_applianceId":"18589","_confId":"5af8adf0.7c5f94","command":"TurnOffRequest","extraInfo":{},"payload":false,"_msgid":"4c1973b8.7d11fc"}

So it's turning it OFF, instead of turning it up. Maybe I'm using the wrong command for Alexa and maybe it should be something like "Alexa, make test brighter" (although dimmer/brighter don't see to work at all.) It'd be nice to have not only the list of responses like:

but also have how to trigger them, like:

(Those are just the commands I'd use, personally, and I do know Alexa ignores some words so that "Alexa, light on" and "Alexa, turn the light on" are the same. But just having an example request would help immensely to avoid the trial-and-error of "I say this to Alexa...what does node-red get from Alexa?")

prabbit237 commented 6 years ago

Actually, I did find in the code where you're doing the commands (devices.ejs) and thus how to trigger them but the above mention of examples was meant more for the page at https://alexa-node-red.bm.hardill.me.uk/docs#buildFlows than for here on github, anyways.

hardillb commented 6 years ago

The list of example utterances can be found in the Amazon doc here: https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/archive/shv2-smart-home-skill-api-reference

hardillb commented 6 years ago

Also feel free to raise a pull request against the docs.ejs page to improve the doc if you want

prabbit237 commented 6 years ago

OK, I did look through the Amazon page some and came away with:

  1. Someone really could write that documentation clearer (yours is much better even without the suggested examples) and
  2. the command to turn up a lap is "increase device by number percent" (rather stilted if you ask me.)

So I WAS using the wrong phrasing. But if it's going to let me use "Alexa, turn device down" then why not allow the more natural "Alexa, turn device up"?

Anyways, thanks for your response and your hard work on all of this/