Page 4 of 11

Re: Indigo / Node-Red / Alexa

PostPosted: Thu Feb 06, 2020 6:25 am
by siclark
Great. I created a speaker device yesterday that lets me say Alexa pause cable or Alexa pause Apple TV. And it sends right commands to the indigo action. Seems to be quicker than using routines.

I can also now mute the tv or change volume by asking for that. Not asking to turn off the volume. A bit more intuitive.

Re: Indigo / Node-Red / Alexa

PostPosted: Thu Feb 06, 2020 6:53 am
by MarcoGT
Great, very good news.

I am trying to the same setup on my dad's Indigo and I get an exception when opening the device details (after the double-click on the indigo-set-device).

Code: Select all
getting devices
(node:13614) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'requestAsync' of undefined
    at /Users/domotica/.node-red/node_modules/indigodomo-node/dist/index.js:128:31
    at Generator.next (<anonymous>)
    at /Users/domotica/.node-red/node_modules/indigodomo-node/dist/index.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/domotica/.node-red/node_modules/indigodomo-node/dist/index.js:3:12)
    at Get (/Users/domotica/.node-red/node_modules/indigodomo-node/dist/index.js:127:12)
    at Object.<anonymous> (/Users/domotica/.node-red/node_modules/indigodomo-node/dist/index.js:43:22)
    at Generator.next (<anonymous>)
    at /Users/domotica/.node-red/node_modules/indigodomo-node/dist/index.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/domotica/.node-red/node_modules/indigodomo-node/dist/index.js:3:12)
    at Object.GetDevices (/Users/domotica/.node-red/node_modules/indigodomo-node/dist/index.js:42:12)
    at /Users/domotica/.node-red/node_modules/node-red-contrib-indigo/77-indigo.js:149:14
    at Layer.handle [as handle_request] (/usr/local/lib/node_modules/node-red/node_modules/express/lib/router/layer.js:95:5)
    at next (/usr/local/lib/node_modules/node-red/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/usr/local/lib/node_modules/node-red/node_modules/express/lib/router/route.js:112:3)
(node:13614) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:13614) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
^C6 Feb 13:47:58 - [info] Stopping flows
6 Feb 13:47:58 - [info] Stopped flows

Re: Indigo / Node-Red / Alexa

PostPosted: Thu Feb 06, 2020 7:54 am
by MarcoGT
And this happens when trying to load the devices defined in red-cb website

Code: Select all
TypeError: RED.warn is not a function
    at /Users/domotica/.node-red/node_modules/node-red-contrib-alexa-smart-home/alexa.js:992:17
    at Layer.handle [as handle_request] (/usr/local/lib/node_modules/node-red/node_modules/express/lib/router/layer.js:95:5)
    at next (/usr/local/lib/node_modules/node-red/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/usr/local/lib/node_modules/node-red/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/usr/local/lib/node_modules/node-red/node_modules/express/lib/router/layer.js:95:5)
    at /usr/local/lib/node_modules/node-red/node_modules/express/lib/router/index.js:281:22
    at param (/usr/local/lib/node_modules/node-red/node_modules/express/lib/router/index.js:354:14)
    at param (/usr/local/lib/node_modules/node-red/node_modules/express/lib/router/index.js:365:14)
    at Function.process_params (/usr/local/lib/node_modules/node-red/node_modules/express/lib/router/index.js:410:3)
    at next (/usr/local/lib/node_modules/node-red/node_modules/express/lib/router/index.js:275:10)
    at expressInit (/usr/local/lib/node_modules/node-red/node_modules/express/lib/middleware/init.js:40:5)
    at Layer.handle [as handle_request] (/usr/local/lib/node_modules/node-red/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/usr/local/lib/node_modules/node-red/node_modules/express/lib/router/index.js:317:13)
    at /usr/local/lib/node_modules/node-red/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/usr/local/lib/node_modules/node-red/node_modules/express/lib/router/index.js:335:12)
    at next (/usr/local/lib/node_modules/node-red/node_modules/express/lib/router/index.js:275:10)

Re: Indigo / Node-Red / Alexa

PostPosted: Thu Feb 06, 2020 8:59 am
by racarter
siclark wrote:
If you have a look at the documents on the site it shows you how to feed status back into the Alexa device to have it updated in the app. It’s not needed as Alexa will send the off command for instance even if she thinks the device is off.

However it’s certainly possible just a bit harder. You need to understand to format of the message to feed back, and I haven’t worked that out yet.

I use the iOS home app to see devices on my phone so don’t care what Alexa thinks the device state is as I never open the app other than testing.



For switches etc., try a function block with this code:

Code: Select all
if (msg.payload_in == "ON") {
    return { "payload" : { "state" : { "power" : "ON" } }, "acknowledge" : true };
}
else if (msg.payload_in == "OFF") {
    return { "payload" : { "state" : { "power" : "OFF" } }, "acknowledge" : true };
}

Re: Indigo / Node-Red / Alexa

PostPosted: Thu Feb 06, 2020 9:27 am
by siclark
Cheers. Will have a play.

Re: Indigo / Node-Red / Alexa

PostPosted: Thu Feb 06, 2020 4:31 pm
by siclark
MarcoGT wrote:
And this happens when trying to load the devices defined in red-cb website

Code: Select all
TypeError: RED.warn is not a function
    at /Users/domotica/.node-red/node_modules/node-red-contrib-alexa-smart-home/alexa.js:992:17
    at Layer.handle [as handle_request] (/usr/local/lib/node_modules/node-red/node_modules/express/lib/router/layer.js:95:5)
    at next (/usr/local/lib/node_modules/node-red/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/usr/local/lib/node_modules/node-red/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/usr/local/lib/node_modules/node-red/node_modules/express/lib/router/layer.js:95:5)
    at /usr/local/lib/node_modules/node-red/node_modules/express/lib/router/index.js:281:22
    at param (/usr/local/lib/node_modules/node-red/node_modules/express/lib/router/index.js:354:14)
    at param (/usr/local/lib/node_modules/node-red/node_modules/express/lib/router/index.js:365:14)
    at Function.process_params (/usr/local/lib/node_modules/node-red/node_modules/express/lib/router/index.js:410:3)
    at next (/usr/local/lib/node_modules/node-red/node_modules/express/lib/router/index.js:275:10)
    at expressInit (/usr/local/lib/node_modules/node-red/node_modules/express/lib/middleware/init.js:40:5)
    at Layer.handle [as handle_request] (/usr/local/lib/node_modules/node-red/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/usr/local/lib/node_modules/node-red/node_modules/express/lib/router/index.js:317:13)
    at /usr/local/lib/node_modules/node-red/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/usr/local/lib/node_modules/node-red/node_modules/express/lib/router/index.js:335:12)
    at next (/usr/local/lib/node_modules/node-red/node_modules/express/lib/router/index.js:275:10)

Sounds like an issue with the nose red install. Maybe try uninstalling and re installing?

Otherwise the dev has a slack channel and is pretty quick to respond. Think he’s on Europe hours.

Re: Indigo / Node-Red / Alexa

PostPosted: Sat Feb 08, 2020 7:28 am
by MarcoGT
After a uninstall and complete reinstall everything works fine, thanks :D

This is awesome, finally we have the control with Alexa; but, much more, it would be nice to be able to integrate Alexa devices directly in Indigo :mrgreen: :mrgreen: :lol: :lol: 8) 8)

Re: Indigo / Node-Red / Alexa

PostPosted: Tue Feb 18, 2020 4:01 pm
by siclark
Thanks to autolog I'm now trying to setup my own server on ECS to host the nodered alexa skill.
If I can get this working and the costs seem free/cheap I'll get the instructions up here.

Re: Indigo / Node-Red / Alexa

PostPosted: Tue Feb 18, 2020 4:39 pm
by Londonmark
Great. Hope you win.

Re: Indigo / Node-Red / Alexa

PostPosted: Tue Feb 18, 2020 5:20 pm
by siclark
2 hours in and thought I had made progress. I have a Ubuntu Vm running. Have cloudflare securing it but the nginx webserver doesn’t seem to work for me.

Re: Indigo / Node-Red / Alexa

PostPosted: Thu Feb 20, 2020 1:52 am
by MarcoGT
Just a quick question: I am super happy with node-red but this allows only to have in Alexa devices that are properly integrated in Indigo; the other way round is not possible, right?

Thanks
Marco

Re: Indigo / Node-Red / Alexa

PostPosted: Thu Feb 20, 2020 4:05 am
by siclark
Do you mean read devices from Alexa that have been natively set up in Alexa, or not your dummy devices?

Re: Indigo / Node-Red / Alexa

PostPosted: Thu Feb 20, 2020 5:17 am
by MarcoGT
Yes, exactly; if I have a device that works only with Alexa, if I can control it in Indigo (I think this is what Matt/Jay are working on).

Re: Indigo / Node-Red / Alexa

PostPosted: Thu Feb 20, 2020 5:22 am
by siclark
I'm sure I saw a node-red node that lets you do that but can't find it now. I think that gets the device into node-red then you could use mqtt or the indigo nodes to get it into indigo.

Re: Indigo / Node-Red / Alexa

PostPosted: Thu Feb 20, 2020 5:28 am
by MarcoGT
That would be nice, if you can find it again :D