Thank you very much Madgeni! Using your code and instructions, I was able to make Alexa turn on and turn off a z-wave light bulb. It worked 50% of the time. When it does not work I get a message saying the device does not support "turn off/turn on" command. In the logs I see the same exception many times (pasted at the bottom), but I'm not sure it is related. I will debug it when I have time.
I have a question regarding the Authorization URL and the Access Token URI (
https://ve0kyj5tp5.execute-api.us-east- ... horization and
https://ve0kyj5tp5.execute-api.us-east- ... ccessToken). Are these actually used? If these services go down, my home automation will not work? I would prefer to host these myself if possible. It would be great to share the fake OAUTH server code and how to use it.
Another observation: the code does not handle thermostat. I like how Domoticz is hosted locally, but I don't have much free time. I'm tempted to buy SmartThingsi instead of extending myself Domoticz.
Error taken out of Amazon CloudWatch log:
START RequestId: 84933feb-5cfe-11e6-86cb-ff24bcce851d Version: $LATEST
2016-08-08T00:24:49.724Z 84933feb-5cfe-11e6-86cb-ff24bcce851d Input { header:
{ namespace: 'Alexa.ConnectedHome.Control',
name: 'TurnOnRequest',
payloadVersion: '2',
messageId: 'ab994c71-1210-4caf-89d5-00b5269f5388' },
payload:
{ accessToken: 'AnythingCanBeAToken',
appliance: { applianceId: '1', additionalApplianceDetails: [Object] } } }
2016-08-08T00:24:49.724Z 84933feb-5cfe-11e6-86cb-ff24bcce851d I'm in the Light case
2016-08-08T00:24:49.882Z 84933feb-5cfe-11e6-86cb-ff24bcce851d SyntaxError: Unexpected token u
at Object.parse (native)
at Request._callback (/var/task/node_modules/domoticz-api/api/domoticz.js:69:49)
at self.callback (/var/task/node_modules/domoticz-api/node_modules/request/request.js:200:22)
at emitOne (events.js:77:13)
at Request.emit (events.js:169:7)
at Request.onRequestError (/var/task/node_modules/domoticz-api/node_modules/request/request.js:831:8)
at emitOne (events.js:77:13)
at ClientRequest.emit (events.js:169:7)
at Socket.socketErrorListener (_http_client.js:256:9)
at emitOne (events.js:77:13)
END RequestId: 84933feb-5cfe-11e6-86cb-ff24bcce851d
REPORT RequestId: 84933feb-5cfe-11e6-86cb-ff24bcce851d Duration: 209.76 ms Billed Duration: 300 ms Memory Size: 128 MB Max Memory Used: 32 MB
Process exited before completing request