node-red-contrib-alexa-home
node-red-contrib-alexa-home copied to clipboard
Echo does not detect devices if the node ID have a dot.
1. Unique device ID is generated with a dot for some devices and Echo does not detect them:
https://github.com/mabunixda/node-red-contrib-alexa-home/blob/008baa9f57b9a7331768aa38aa86e2528b0b6753/alexa/alexa-home.js#L144-L154
The . should be deleted from the node ID.
const nodeid = uuid.replace('.', '').split("");
Or filter to be sure to only have hexadecimals characters.
PS: Should be great to add a field to set this node ID to not loose all the routines on new installation.
2. Add 3 curly braces so mustache does not encode the URL:
https://github.com/mabunixda/node-red-contrib-alexa-home/blob/008baa9f57b9a7331768aa38aa86e2528b0b6753/alexa/templates/setup.xml#L7
<URLBase>{{{baseUrl}}}</URLBase>
<device>
<deviceType>urn:schemas-upnp-org:device:Basic:1</deviceType>
<friendlyName>Amazon-Echo-NodeRed-Bridge {{{baseUrl}}}</friendlyName>
3. The bridge ID is not the same
In alexa-hub.js it ends with a 0 who is shown when scanning SSDP devices.
https://github.com/mabunixda/node-red-contrib-alexa-home/blob/3c1c8e8b117b9bb10549a3e33ee55f0bdc29ced0/alexa/alexa-hub.js#L148
In the setup XML displayed it ends with the controller ID.
https://github.com/mabunixda/node-red-contrib-alexa-home/blob/3c1c8e8b117b9bb10549a3e33ee55f0bdc29ced0/alexa/alexa-home-controller.js#L318
But I don't know If this could be an issue. As we can only have one on port 80, In alexa-hub.js I replaced node.id with node.controller.id
Thanks for you input - can you create a pull request for your changes that everybody is able to use these?
The nodeId is stored in a configuration file on disk, so this should not be lost anyway