Had a bit of fun over the weekend… Got my Amazon Echo controlling a digital output on my garage rack of Opto 22 I/O.
First the hardware. I have a free standing bank of 6 fluorescent tubes to use as a work light.
When they are not in use, they hook on some chain hanging from my garage roof.
Since they are free standing, I have a longish extension cord that they plug into. On the Opto end, I simply have a 120AC plug and socket with a break in the active line that goes to a SNAP-OMR6-C mechanical relay module. It simply turns power on and off to the light just like a light switch.
For the longest time, I have been using groov as the only way of flipping the digital point state. For the most part, its not a problem. In the kitchen we have computer that always has a Chrome browser running, so you just hit the button the way through to the garage.
Yesterday, all that changed.
Enter Node-RED.
There is a Node that emulates a Belkin Wemo. This is important for two reasons, firstly, it means that this flow only works on digital outputs. Secondly, it means that everything stays inside your network. No phoning out to the cloud just to turn a switch on or off.
This means that its pretty quick, and it means that you don’t have a major pile of security / https / applications / skills to jump through to get going.
So, here is how it looks in my Node-RED web dashboard.
Pretty simple huh.
The Wemo node is simply configured for a payload of 0 when off and 1 when on.
The PAC Node just points to the digital output. That’s it.
Here is the flow, you will need to tweak the digital output to match your PAC IP address and I/O name.
(Remember, your PAC needs to be running Firmware Ver 9.5a or better).
[{“id”:“fc2dedfc.7edbd”,“type”:“wemo-emulator”,“z”:“de358902.74cf18”,“name”:“garage light”,“friendlyName”:“garage light”,“serial”:“1”,“port”:“44001”,“onTopic”:“on”,“onPayload”:“1”,“offTopic”:“off”,“offPayload”:“0”,“x”:132.85714285714283,“y”:105.71428571428571,“wires”:[[“d0c1c672.ba4cd8”]]},{“id”:“d0c1c672.ba4cd8”,“type”:“pac-write”,“z”:“de358902.74cf18”,“device”:“47fe29ec.29b8e8”,“dataType”:“dig-output”,“tagName”:“garage_light_6_fluro”,“tableStartIndex”:“”,“value”:“”,“valueType”:“msg.payload”,“name”:“”,“x”:403.3333282470703,“y”:106.66667175292969,“wires”:[]},{“id”:“47fe29ec.29b8e8”,“type”:“pac-device”,“z”:“”,“address”:“192.168.1.9”,“protocol”:“http”}]
So, now the only thing you need to know is that last week (honestly, this is the real reason I got all this going) Amazon added a new wake word… Now you have a choice of Amazon (boring), Echo (Okish), Alexa (Who?) and … Computer.
Yeah!
On the way out to the garage, just yell ‘Computer, turn on the garage light’.
Before you can get there… You can see the light!