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

Apache License 2.0
45 stars 28 forks source link

No Device found in nodered #57

Closed SpeedyRS2 closed 6 years ago

SpeedyRS2 commented 6 years ago

I have a problem with the alexa skill.

I added a device under https://alexa-node-red.bm.hardill.me.uk/devices in my account and installed the alexa skill in the alexa app. image

After searching for devices in the alexa App, the 2 new devices are found. image

but the nodered plugin doesn't find any device, even after refresh. The node is connected, but the device list stays empty. image

Do you have any suggestions for me?

Thanks and best regards, Andreas

hardillb commented 6 years ago

I'll try and have a look tonight

hardillb commented 6 years ago

Can you check the node-red logs to see if there is any output when you hit the refresh button

hardillb commented 6 years ago

Also what version of Node-RED and NodeJS are you using

SpeedyRS2 commented 6 years ago

Good morning and thank you for your repley.

22 Mar 08:07:05 - [info] Node-RED version: v0.18.3 22 Mar 08:07:05 - [info] Node.js version: v6.13.0 22 Mar 08:07:05 - [info] Linux 4.14.18-v7+ arm LE

The Log, even in trace mode dosn't show something from the plugin. 22 Mar 08:10:23 - [debug] red/nodes/flows.start : starting flow : 2c174318.8fafec 22 Mar 08:10:24 - [trace] runtime event: {"id":"runtime-state","retain":true} 22 Mar 08:10:24 - [info] Started flows 22 Mar 08:10:24 - [trace] runtime event: {"id":"runtime-deploy","payload":{"revision":"0c17a407d6f60967de8390b37b172098"},"retain":true} 22 Mar 08:10:24 - [info] [mqtt-broker:MQTT] Connected to broker: mqtt://127.0.0.1:1883

at 8.11 i pressed the refreshbutton, but there is no log entry

Or must I enable something to get the log from plugins?

hardillb commented 6 years ago

OK, so I'll need to know what your username is to have a look in the logs (have crossed it out in the images earlier).

But in the mean time please edit the alexa.js file in the node-red-contrib-alexa-home-skill directory. On line 324 there should be a commented out console.log() line, please remove the // from the start.

Also please remove the // from the start of line 327 so I can see the details of any error that may be thrown.

Then restart Node-RED

This code should be run on start up so you should see some output in the logs.

The logs should then print out what devices the node is getting back from the service.

SpeedyRS2 commented 6 years ago

I extended the log at line 327 a little bit: err: null id: 7d5d9396.22e9bc devicesURL: https://alexa-node-red.bm.hardill.me.uk/api/v1/devices username: SpeedyRS2 password: xxxxxxxxx res: [object Object] body: Unauthorized

ok, i found the problem. I used a password with special characters like ":" and so on. This was the problem. I registred a new user, with another password (without special characters) and the device was found from the plugin.

Thank you very much for your help.

hardillb commented 6 years ago

Cool, you should have been able to change your password (by saying you forgot it on the login page). But glad it's all working now.

I'll have look at the version of request I'm using because this shouldn't be a problem