Skip navigation

Arduino

2 Posts authored by: electronichamsters

I'm still waiting on my LED lights, which is making me nervous.  Perhaps I shouldn't have ordered from eBay

 

So, in the mean time, I've been working on some automation stuff with lights (when I get them).  I've always wanted voice control, but something that is continuous, and does not require pushing buttons prior to the voice command.  I found out about how Tasker can send HTTP Post/Get commands to OpenHAB.  Tasker also has a plugin called Autovoice, which can run in "continuous" mode, so it will always monitor your voice.  So here's an example of how to do this integration.

 

Here's the holiday lights screen.

 

holiday_lights.png

 

 

Video of a quick demo.

 

 

I have an item defined this way:

Switch itm_holiday_on "Lights Enable"

 

Under Tasker, define a new Task to turn off the switch.

New Task > Action > Net > HTTP Get

 

Server:Port

OpenHABuser:OpenHABpassword@192.168.x.x

Path

CMD

 

Attributes

itm_holiday_on = OFF

 

Do a similar task for turning it on, but just replace the attribute with "=ON".  You can test the task by using the play button at the bottom.  Executing these tasks should turn the switch off or on.

 

20150106_213329.jpg

 

 

Next, we use voice commands to activates profiles that run these tasks.

 

 

In the Profiles tab on Tasker, create a new profile.

Event > Plugin > Autovoice > Recognized

 

Edit the configuration for this event.  Set the "Command Filter" to whatever you want the voice command to be.  Then go down to pick a "Trigger Word".  In my case, the Trigger Word is "Computer", and the Command is "on" or "off".  Exit out of the profile creation and you'll be prompted to pick a task for this event.  Pick either the on task or the off task created previously.

 

Next, open up the Tasker plugin called Autovoice.  Set it to run continuously.  This will make it run voice recognition all the time, and act as the "computer" in Star Trek.

Thanks to Element 14 and the sponsors for the Internet of Holiday Lights contest.

 

While I'm waiting for my components to arrive, I'll lay out my plan.

element14.jpg

 

Part 1:  Control of lights

I'll be using MQTT to control the lights attached to the Arduino Yun.  The Yun will subscribe to a MQTT server on the Raspberry Pi.  Also sitting on the Pi is an installation of OpenHAB.  Using the OpenHAB mobile phone app, you can remotely select the color/pattern/on/off of your home lighting - whether that lighting is for windows or trees.  The Yun subscribes to a MQTT topic for the lighting request.  OpenHAB publishes to this MQTT topic to tell the Yun how to operate the lights.

 

Part 2:  Sensor Control

I'd also like to use the lights as an interactive element.  Using a wireless PIR sensor, I'd like to set off different lighting events when someone approaches the door or driveway.  The PIR sensor will initiate an MQTT topic to OpenHAB, which relays the lighting changes based on time of day, whether or not the behavior is desired (via GUI selection).

 

Part 3:  Coordinated Lighting Show

It would be neat if the lighting can be coordinated with a couple of neighbors.  I don't have the funds for a complete demo of this, but I'd like to work out the technique to use MQTT to coordinate many Yuns so that lighting at several near-by houses can be coordinated.  Imagine if you walk up the drive way of one house, and all the houses around you flash in response.  The neighborhood Yuns could connect to a single master MQTT broker to achieve this effect.  And neighbors can control each other's lighting or neighborhood lighting via the OpenHAB app.

Filter Blog

By date: By tag: