Alexa Control of RV Lights

Today I finally got all the pieces working to allow Alexa to control my RV lights. It turns out that the Alexa code only took a couple hours to implement, using a great tutorial posted by Kevin Utter on the developer.amazon.com site. This tutorial shows how to implement in under an hour a trivia game using Alexa. I followed the tutorial, created first a Reindeer trivia game, and then modifying it to be a Lisles Trivia game.

Once I was familiar with the process, I followed similar steps to create my own RvDuino Echo app. This app uses Alexa to listen for commands, and then forwards them to Particle.io which forwards them to a Photon Arduino.

I didn’t have to write any code on Particle.io. Code running on the Photon instructs Particle.io what commands to listen for, and which Arduino functions to run as a result. It really doesn’t get any easier than that. This has really made me a big Particle.io fan now!

I then used the Particle web IDE to write a fairly small Arduino sketch on the Photon that routes commands received from Particle.io to the desired Arduino Pro Mini over a simple RF24 network.

I’ve posted all the information and code on Github: https://github.com/rlisle/alexaParticleBridge.

Playing with Arduino

I’ve been busy playing with Arduinos these past few months. I think I must have been locked in a cave the past 8 years or so. I’ve been shocked by how advanced and inexpensive these things have become. These things are awesome, and very inexpensive. I plan on installing a dozen or so throughout my RV to control just about everything. Couple that with my iPhone programming skills, HomeKit, Siri, and the new Amazon Echo, and this is going to be a high tech playground for me. Woohoo!

I had been struggling with getting nRF24+ radios working, to provide cheap communication between Arduinos. It turns out that a bunch of folks at MySensors have already implemented a very cool, open source solution along the same lines. This is an incredible site. The information there really helped me get my radios working. They’ve done a lot of good work to provide clear instructions on how to connect multiple Arduinos together using open source software. These Arduinos can then read various types of sensors in order to control all sorts of things. I feel like a kid in a candy store (“ooh, which one do I want next?”). The crazy part is the price of these parts. They have a really well done page listing out links to buy all the various parts at unbelievable prices. Thank you MySensors!

Unfortunately, I think I’ve let myself become spread too thin across exploring and playing with all these cool technologies. I’ve written an iPhone app and Apple Watch extension that uses the Lightblue Bean to display the level of the RV remotely. I got it working well enough to use for myself, but I haven’t taken the final steps to post it to the App Store so that others can use it also. It’s very close to being in a state that can be released to the app store, but I’d rather play with new Arduino projects instead of spending the time to finish and submit it. I’ve also setup several Arduinos to control fans and lights in the RV, but they’re still sitting on the workbench. I’m trying to get them connected to the internet so the Echo and iPhone can control them.

So now I’m going to try to be disciplined with myself, and focus on getting a few basic pieces done and installed before worrying about adding more advanced features. With the 3 day weekend coming up, I’m hoping to get the Lightblue Bean installed in my closet to control a string of led lights based on sliding door microswitches, and an Arduino Uno hooked up to control dimming some LED recessed spotlights that I installe over my booth workbench. I’ll post back later about how that goes.

Amazon Echo Arrived Today!

Another piece of my RV Automation project arrived today: the Amazon Echo. I’ve gone back and forth about whether to include an Echo in my project. My mind was made up last month though, when I received notification that Amazon was releasing an API to Alexa’s voice interface to developers. So I signed up for the developer program, and upon confirmation, I ordered an Echo.

Upon opening the box, I found the Echo, power cord, and remote control. Taking these out of the box, I found a single 2″ x 8″ instruction card that told me to plug it in, and then download the free Echo app. So I plugged-in the Echo, and a blue ring appeared at the top, with a cyan spot rotating around it. About 30 seconds later, the ring turned orange, and I was greeted with a very pleasant “Hello. Your Amazon Echo is ready for setup. Just follow the instructions in your Echo pack.”

Amazon Echo showing blue light ring

So far this is looking pretty good. Packaging is top notch, visual appearance is very modern and attractive, and the sound of Alexa’s voice is very pleasing.

So next I downloaded and installed the Echo app. I was a bit surprised to see that the Echo app only had a rating of 2.5 out of 5 stars. But proceeding on, the app downloaded quickly, then prompted me for my Amazon.com login upon starting. I was then instructed to wait for the orange light ring, and pressed Continue.

Amazon Echo showing orange light ring

I was then instructed to switch my iPhone’s Wi-Fi to connect to the Echo’s Wi-Fi hub (“Amazon-XXX”). Once I did that, Alexa told me it was setup, and to continue in the Echo app.

The app then prompted me for my network name and password. It then confirmed that I’d entered the password correctly, and completed the setup, ending with an introduction video.

The Echo app then walked me through saying a few things to Echo, like “Alexa, what’s the weather” and “Alexa, play It’s a Long Way There by Little River Band.”

I then explored the Echo app, providing information in the Settings pages, and running through Voice Training. This took about 30 minutes total.

Overall, setup was quite painless, and Echo seems to work great. Now my mind is racing on to all the things I’d like to do with it:

  • Control the lights in my RV
    Since my RV runs on 12v, I’m hooking up Arduino’s to control them. But there aren’t off-the-shelf solutions, like there are for normal 120v house lighting. So I’m expecting to need to use the Alexa API to route commands to a web server running on one of the Arduinos with an Ethernet Shield.
  • Control my Home Theatre and Stereo system
    Again, I may need to use the Alexa API to route commands to an Arduino with an IR interface. Someday I may be able to upgrade my TV and stereo to be directly controllable via WiFi or BTLE, but for now I should be able to simulate a universal remote.
  • Voice control my MIDI keyboard setup
    I’d like to be able to start/stop recording while I’m playing piano.
  • Query status of various inputs (temperature, humidity, level) related to my RV
    Even better yet would be to get notified when something is amiss, such as a leaky RV roof seam.

I could probably dream all night about this sort of stuff, but I think I need to pick something and try my hand at using the Alexa API. I’ll report back later my experiences doing so.