10.6 Conversing with Your Home
The culminating moment of glory has arrived. Speak the command “Time,” and listen for your computer to respond with the current time. Ask it to “play music,” and your computer should respond with “Which artist would you like to listen to?” Respond in kind with an artist in the computer’s iTunes library and select the album from which to start playing. Say “Stop music” when you’re done listening to the music.
Query for unread email in your inbox by asking your computer to “check mail.” Check the computer screen to verify that the computer responds with the correct count and reads the correct email sender and subject lines.
If you have your Android door lock or web-enabled light switch running, say “Unlock door” or “Light on” to watch your door unlock or light turn on accordingly. You now have your own voice-activated home. Pretty cool!
Try issuing commands from different locations. Move around the room, then try from other rooms. See how far your wireless microphone’s signal will reach before it starts to cut out and your commands are no longer being acknowledged. Keep these boundaries in mind when interacting with your computer.
To give the script more permanence, convert it to an executable. Place its icon in the OS X desktop dock and control-click its icon to select Open at Login from the Options section of the pop-up menu. This will automatically launch the script each time you log into your Mac’s desktop, ready to listen to your predetermined voice commands.
Continue to tweak the script and add any new phrases and functionality that best suit your environment. Network-enable the Curtain Automation project and instruct your home to “open drapes” or add a weather option that pulls down the weather forecast from the National Oceanic and Atmospheric Administration’s weather.gov website and reads it aloud. Consider adding more features as suggested in the Next Steps section.