Indigo / Node-Red / Alexa

Posted on
Thu Jan 16, 2020 10:29 am
stuartcolman offline
Posts: 81
Joined: Nov 01, 2015
Location: Essex, United Kingdom

Indigo / Node-Red / Alexa

I had been using the Alexa Plugin for a while and had just got it to a good place when it stopped working due to the issues detailed in the Plugin Forum about newer devices not working with the discovery process.

I wanted a solution to be able to use my Amazon Echos to turn on/off the lights which are all ZWave. And I think I have found a suitable solution. I have been playing around with Node-Red for a little, and found it quite useful, using for a few MQTT things and bridging a few other things. Then I found an Indigo Node which would interface directly with Indigo to control devices. I have now just found an Alexa Node which works with the latest devices over port 80, so plugging all of this together gives Alexa control of Indigo devices with very little (if any) delay at all. I have following in Node-Red:

https://flows.nodered.org/node/node-red-contrib-indigo
https://flows.nodered.org/node/node-red ... mazon-echo

I have Node-Red installed on the same machine as Indigo and it seems fine. Discovery of the published devices worked fine, and as mentioned I have control over my lights via Amazon Echos.

So I thought I would share this solution until the Indigo plugin is back up and running.

Stuart

Posted on
Thu Jan 16, 2020 10:54 am
jay (support) offline
Site Admin
User avatar
Posts: 16307
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Indigo / Node-Red / Alexa

If you don't mind my asking, how did you get the listener working on port 80? macOS generally blocks any user apps from using protected ports (of which 80 is one).

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Jan 16, 2020 11:26 am
siclark offline
Posts: 1333
Joined: Jun 13, 2017
Location: UK

Re: Indigo / Node-Red / Alexa

Very interested in this.. now need some time to learn more red

Posted on
Thu Jan 16, 2020 2:10 pm
mundmc offline
User avatar
Posts: 720
Joined: Sep 14, 2012

Re: Indigo / Node-Red / Alexa

Interesting! I did a quick read on Node Red, though I am a little confused on one thing- does this offer any functionality the alexa-hue hub does not offer???

I continue to endeavor to find a way to intercept the raw text Alexa hears.

Posted on
Thu Jan 16, 2020 2:44 pm
Colly offline
Posts: 347
Joined: Jan 16, 2016
Location: Ireland

Re: Indigo / Node-Red / Alexa

Hi Stuart,

Very interested in trying this out. Would you mind documenting the steps to set it up? My kids are missing Alexa and her magic powers to switch lights and open doors


Sent from my iPhone using Tapatalk

Posted on
Sat Jan 18, 2020 9:35 am
Londonmark offline
Posts: 378
Joined: Feb 29, 2012

Re: Indigo / Node-Red / Alexa

+1

Posted on
Sat Jan 18, 2020 5:12 pm
Barilko offline
Posts: 12
Joined: Feb 29, 2016
Location: Ontario, Canada

Re: Indigo / Node-Red / Alexa

I've been checking back for an Alexa solution that didn't involve getting a gen 1 echo and this has been the first hope I've found. I had never heard of node red an hour ago and now I have Alexa control of one of my lights back.
Here's what I did:
Watched a 10 minute youtube video of getting started with node red.
Installed node.js on my mac from here:
https://nodejs.org/en/#home-downloadhead
Ran install for node red from mac terminal:
sudo npm install -g --unsafe-perm node-red
Started node red with this command in terminal:
node-red
Connected to node red in browser:
http://127.0.0.1:1880/
From node red menu go to Manage Palette
Click the Install tab
Search for and install both of these:
node-red-contrib-amazon-echo
node-red-contrib-indigo
Dragged the following items into the flow window:
Amazon Echo Hub
Amazon Echo Device
Indigo Set Device
Connect those 3 devices with a wire in that order (Echo Hub - Echo Device - Indigo Set Device)
Hit Deploy (Echo node shows green i.e. connected)
Set the Amazon Echo Device name to "Test Light"
Hit Deploy again
Tell Alexa to discover new devices (Alexa found "Test Light")
Now, double click the indigo device in the flow window to bring up the properties
hit the pencil icon to add details for your indigo server (ip address, port, username, password, and give it name eg. MyIndigoServer)
Hit Deploy Again
Double click the indigo device again and select the controller by the name you gave it in the last step (i.e. MyIndigoServer)
Click the "ItemName" drop down box and you will see the list of your indigo devices
Select the Indigo light you want to control
Click the "Key" drop down" box and select "On/Off State"
Leave the "Value" blank
Hit Deploy again

Now say... "Alexa, turn on the test light".
Mine WORKED!

I haven't tried any dimming yet.

Sorry if I missed anything or if this isn't clear... I'm pretty excited to get this working again so I quickly put out this post in case anyone else wanted to try it.
I'll add a screenshot here of my setup as well.
Attachments
Screen Shot 2020-01-18 at 5.26.31 PM.png
Screen Shot 2020-01-18 at 5.26.31 PM.png (218.86 KiB) Viewed 1217 times

Posted on
Sat Jan 18, 2020 5:14 pm
Barilko offline
Posts: 12
Joined: Feb 29, 2016
Location: Ontario, Canada

Re: Indigo / Node-Red / Alexa

FYI... that msg.payload object just shows the message that is being sent to the indigo device in the debug window in node red. It is not required, I just wanted to see what it was sending.

Posted on
Sun Jan 19, 2020 4:19 am
siclark offline
Posts: 1333
Joined: Jun 13, 2017
Location: UK

Re: Indigo / Node-Red / Alexa

Amazing. Thank you. Even I should be able to follow that. Can't wait to get Alexa back.

Posted on
Sun Jan 19, 2020 8:23 am
mundmc offline
User avatar
Posts: 720
Joined: Sep 14, 2012

Re: Indigo / Node-Red / Alexa

Barilko wrote:
I've been checking back for an Alexa solution that didn't involve getting a gen 1 echo and this has been the first hope I've found. I had never heard of node red an hour ago and now I have Alexa control of one of my lights back.
Here's what I did:
Watched a 10 minute youtube video of getting started with node red.
Installed node.js on my mac from here:
https://nodejs.org/en/#home-downloadhead
Ran install for node red from mac terminal:
sudo npm install -g --unsafe-perm node-red
Started node red with this command in terminal:
node-red
Connected to node red in browser:
http://127.0.0.1:1880/
From node red menu go to Manage Palette
Click the Install tab
Search for and install both of these:
node-red-contrib-amazon-echo
node-red-contrib-indigo
Dragged the following items into the flow window:
Amazon Echo Hub
Amazon Echo Device
Indigo Set Device
Connect those 3 devices with a wire in that order (Echo Hub - Echo Device - Indigo Set Device)
Hit Deploy (Echo node shows green i.e. connected)
Set the Amazon Echo Device name to "Test Light"
Hit Deploy again
Tell Alexa to discover new devices (Alexa found "Test Light")
Now, double click the indigo device in the flow window to bring up the properties
hit the pencil icon to add details for your indigo server (ip address, port, username, password, and give it name eg. MyIndigoServer)
Hit Deploy Again
Double click the indigo device again and select the controller by the name you gave it in the last step (i.e. MyIndigoServer)
Click the "ItemName" drop down box and you will see the list of your indigo devices
Select the Indigo light you want to control
Click the "Key" drop down" box and select "On/Off State"
Leave the "Value" blank
Hit Deploy again

Now say... "Alexa, turn on the test light".
Mine WORKED!

I haven't tried any dimming yet.

Sorry if I missed anything or if this isn't clear... I'm pretty excited to get this working again so I quickly put out this post in case anyone else wanted to try it.
I'll add a screenshot here of my setup as well.


Thank you for this!


Sent from my iPhone using Tapatalk

Posted on
Sun Jan 19, 2020 10:03 am
Barilko offline
Posts: 12
Joined: Feb 29, 2016
Location: Ontario, Canada

Re: Indigo / Node-Red / Alexa

I'm still having trouble getting dimming to work properly. I can get dimming by creating another Indigo Set Device node and setting the Key to Brightness instead of "On/Off State" and then add a Change Node in between the Echo light device and the Indigo Light device. The change node takes the value of the msg.percentage part of the message and puts it into the msg.payload (default) property of the message that passes along to the Indigo Light device. This works, but I always have to say "Alexa set the Test Light to 0" to turn it off.

I haven't been able to get it working where I can say "Alexa, turn on the test light" and then "Alexa set the test light to 50" for the same light device. So far, I can either have a light that I can control with and on/off command, or I can have a light that I always have to control by speaking in dimming percentages. I can't figure out how to be able to use both types of commands on the same light device. I'm sure I'm missing something obvious due to my lack of experience with red-node and the indigo and echo palettes.

I was hoping the original poster might come back and give some details of the red-node flow they built if they have this working with dimming.

I'll add a screenshot of the flow I have where the dimming device is enabled and working when I speak in percentages to Alexa. I just disable the indigo device node with the on/off Key and leave the one with "brightness" key enabled and then redeploy. The extra grey inject nodes in the screenshot were just used while I was testing. They just force the correct msg into the Indigo devices to make sure they are working.... eg. Click the "on" inject node button to send "on" to the indigo light that is set to "on/off state" as the key, or click the 40 inject node to send "40" to the indigo light that is set to the "brightness" key. And again, the green boxes are just debug output.

...struggling, but having fun.
Attachments
Screen Shot 2020-01-19 at 10.39.01 AM.png
Screen Shot 2020-01-19 at 10.39.01 AM.png (165.15 KiB) Viewed 1129 times

Posted on
Sun Jan 19, 2020 2:58 pm
mundmc offline
User avatar
Posts: 720
Joined: Sep 14, 2012

Re: Indigo / Node-Red / Alexa

Barilko wrote:
I'm still having trouble getting dimming to work properly. I can get dimming by creating another Indigo Set Device node and setting the Key to Brightness instead of "On/Off State" and then add a Change Node in between the Echo light device and the Indigo Light device. The change node takes the value of the msg.percentage part of the message and puts it into the msg.payload (default) property of the message that passes along to the Indigo Light device. This works, but I always have to say "Alexa set the Test Light to 0" to turn it off.

I haven't been able to get it working where I can say "Alexa, turn on the test light" and then "Alexa set the test light to 50" for the same light device. So far, I can either have a light that I can control with and on/off command, or I can have a light that I always have to control by speaking in dimming percentages. I can't figure out how to be able to use both types of commands on the same light device. I'm sure I'm missing something obvious due to my lack of experience with red-node and the indigo and echo palettes.

I was hoping the original poster might come back and give some details of the red-node flow they built if they have this working with dimming.

I'll add a screenshot of the flow I have where the dimming device is enabled and working when I speak in percentages to Alexa. I just disable the indigo device node with the on/off Key and leave the one with "brightness" key enabled and then redeploy. The extra grey inject nodes in the screenshot were just used while I was testing. They just force the correct msg into the Indigo devices to make sure they are working.... eg. Click the "on" inject node button to send "on" to the indigo light that is set to "on/off state" as the key, or click the 40 inject node to send "40" to the indigo light that is set to the "brightness" key. And again, the green boxes are just debug output.

...struggling, but having fun.


Just to be clear- is that what one would have to do for EACH indigo device that they want to control through NodeRed and Alexa?

Posted on
Mon Jan 20, 2020 7:00 am
siclark offline
Posts: 1333
Joined: Jun 13, 2017
Location: UK

Re: Indigo / Node-Red / Alexa

Wow, this was less than 5 mins to get working.

A couple of extra points in the instructions. Use 8176 as port if you havent changed it from default, not 1176 that is prompted.

I used Host as localhost as its on the same machine.

Once deployed, I had to change teh Key from On/Off State to brightness to get it to show my a list of all the ItemNames.

The biggest problem was getting Alexa to forget devices as she kept remembering all the old ones, but all now good.

Not tried dimming yet.

If doesnt seem to reflect status back into Alexa app, but if Alexa thought light was on, but was in fact off, and I asked to turn on, it was still turned on, so no big issues there.

This is amazing.

Posted on
Mon Jan 20, 2020 8:28 am
siclark offline
Posts: 1333
Joined: Jun 13, 2017
Location: UK

Re: Indigo / Node-Red / Alexa

Got the dimming working, although still requires 2 flows. Watching the indigo log, the problem was the set brightness was coming after the turn off and so was turning the light back on.
So, I added a switch, that checks if the message.on is true, and only then sends the brightness command. If works, and you can set brightness, or say turn off. What you cant do is when the light is off, ask alexa to set a brightness to turn it on. Sure another flow would work there, but not worked that out, and we are on the way to making a complex flow for each device. I have have 30 I probably want to setup.

@mundmc, yes giving example of 2 devices, this would be repeated for number of devices, although its very quick to do. seconds per device .
Attachments
Screenshot 2020-01-20 at 14.22.45.png
Screenshot 2020-01-20 at 14.22.45.png (134.95 KiB) Viewed 1019 times

Posted on
Mon Jan 20, 2020 8:29 am
siclark offline
Posts: 1333
Joined: Jun 13, 2017
Location: UK

Re: Indigo / Node-Red / Alexa

I also think we can get rid of the set msg.payload box but it doesnt work as I expect to set the value to be msg.percentage in the indigo-set-device node.

It only saves 5 seconds per device so not a big deal once you know what you are doing.

Who is online

Users browsing this forum: No registered users and 0 guests