You may remember my Tiki Room Drummer project I posted about last year which is inspired by Disney’s Enchanted Tiki Room. Since then I have added lights, music, and a talking parrot to my home tiki room. Furthermore I have choreographed all of them together using a variety of IoT (internet of things).

This sequence has been trial and error that I have built upon over the past year. It started simply with having the tiki drummers on an hourly timer. Soon after I added coordinating music using a Mac Automator Calendar event to open and stream an audio file from iTunes to an AirPort Express. Then I found wifi enabled puck lights which I could set to a timer as well that added another level to the experience. This setup worked well for a few months. But with my latest addition, a talking animatronic parrot, the sequence required more than just a timer and calendar event.

Tiki Drummers

The tiki drummers are DC battery powered for which I needed to find a wifi enabled control switch that would work with DC power. After some research and suggestions from others I settled on a Belkin Wemo Maker (now discontinued). The Wemo Maker was made for exactly this type of thing, it allowed me to set times that the tiki drummers turn on as well as control them from my phone.

Talking Parrot

The talking parrot is a Hasbro Squawkers McCaw which was a kids toy in the early 2000s that many have since hacked to have their own controllable animatronic bird. I purchased a control board to be able to animate the bird with any line audio source. Which I set up with audio routed from an old AppleTV I was no longer using.

IoT Components Used

My Process

My experiments in orchestrating all of these devices together took me down a few paths.

Initially, I tried to keep the lights and tiki drummers set on timers. While the audio continued to be handled by using an Automator Calendar event. Unfortunately, the timing on this just wouldn’t work. The lights would turn on too early, the tiki drummers would run too long, and the music was never coordinated. To get everything timed correctly it needed to all be on the same system.

So next, I tried using IFTTT to setup an applet to handle this automation. IFTTT is an web-based service that uses “if this, then that” scenarios to automate workflows of wifi enabled apps and devices. With IFTTT’s extensive library of services I able to find almost everything I needed. But the most disappointing about the IFTTT solution was that there was no way to trigger music to play on a device. And again with this solution the timing was off due to the back and forth communication over the internet between the devices and services.

Another route that I briefly looked into was an Arduino or Raspberry Pi solution. Which would use a show control software called xLights to control the devices and the music. But this option provided to be a little more daunting of a project to take on at the moment. However, I think this method would ultimately be the best solution and I may still try this in the future.

After these failed attempts I decided that the solution needed to be something that I was comfortable working with. Since I was the most familiar with Automator and was already using AirPlay devices it was the clear that Automator would be the best choice. Automator has a library of actions for controlling software and executing scripts on a Mac. I knew that Automator could control the audio and timing easily. Now I just needed a way to turn on and off the switches and lights.

I came across the app WSwitch which allow you to setup keyboard shortcuts to turn on and off Wemo products. Having Automator run AppleScript to key the shortcuts would trigger the devices on and off. This worked great until my screensaver kicked in. Any keystrokes were ignored when the screensaver or lock screen were active. To solve this I needed to do more research to find a workaround.

My research lead me to Node.js and NPM. Node.js is an open-source and cross-platform JavaScript. And NPM is a JavaScript package manager for developers. With these new resources I was able to find code for not only the Wemo products but also for the Magic Home enabled lights control with even more options than I would have ever expected.

Yet there was still a learning curve for me. With little JavaScript experience and with minimal documentation for such specific applications it was up to me to figure out much of the code. Any of poorly written code would kickback errors and cause Automator to stop the workflow. Once I got all the errors in my code sorted out the rest of the workflow came together easily.

Finished Workflow

  1. Turn Wemo Switch on (Parrot control board)
  2. Turn Magic Home lights on with slow seven color crossfade mode
  3. Launch iTunes
  4. Connect iTunes to AirPort Express (audio for room)
  5. Get specified iTunes item (Gong audio file)
  6. Start iTunes playing
  7. Launch QuickTime Player
  8. Launch AirFoil
  9. Set AirFoil source to QuickTime Player and connect AirFoil to AppleTV (audio for Parrot)
  10. Open and play specified item in QuickTime Player (Parrot intro audio file)
  11. Pause Automator
  12. Get specified iTunes item (Tiki Drummer chant audio file)
  13. Start iTunes playing
  14. Turn Wemo Maker on (Tiki Drummers)
  15. Change Magic Home lights to fast seven color crossfade mode
  16. Pause Automator
  17. Change Magic Home lights to seven color jump mode
  18. Pause Automator
  19. Change Magic Home lights to seven color strobe mode
  20. Pause Automator
  21. Turn Wemo Maker off (Tiki Drummers)
  22. Change Magic Home lights to slow seven color crossfade mode
  23. Open and play specified item in QuickTime Player (Parrot end audio file)
  24. Pause Automator
  25. Quit applications iTunes, AirFoil and QuickTime Player

The workflow is then exported as a Calendar event and set it to go off on the hour at 7pm, 8pm, and 9pm every night.

There are still a few kinks to work out and my computer still needs to be running to run the Automator workflow. But this choreographed show really brings the tiki room to life. Now all I need are flowers that croon and it will be just like Disney’s Enchanted Tiki Room!