iTunes Integration (Indigo versions 2-4)

There are many ways to integrate iTunes and Indigo Pro; this page will show you how to perform these integrations:

NOTE: If you are using Indigo 5, please use the iTunes plugin which is quite a bit easier.

Set up the iTunes sync script

Indigo comes with an iTunes Sync script which inserts a bunch of different data into Indigo Variables about what iTunes is doing. These can be shown on Control Pages, etc. This functionality is enabled by default in the sample house - check it out! If it's not already in your database, here's how (it's very simple)

  1. Select TRIGGERS from the outline view on the left
  2. Click the New… button
  3. Name the trigger whatever you want
  4. Select Indigo Server Startup from the Type: popup (this will cause the actions in this trigger to be executed each time the server starts up)
  5. Click the Actions tab
  6. Select Execute AppleScript from the Type popup
  7. Select the File: radio button
  8. A standard Mac file dialog will appear: open Background Tasks and select iTunes sync.scpt
  9. Click OK

That's it. Next time you restart the server it will start up the iTunes sync script.

However, there are much more useful things that you can do to enable iTunes control from all over the house using various hardware controllers and Indigo Pro.

Setting up PalmPad (or other X10 controller) buttons to control iTunes

Difficulty: Simple

These instructions assume you're setting up a PalmPad remote, but the process would be much the same for any other X10 controller (SlimFire, Maxi controller, etc).

Set up the Play/Pause button(s)

  1. Make a note of the X10 house code that your controller is using. The PalmPad has a dial on the lower end of the remote that points to the letter of the house code. Also note which unit codes the remote is going to send: it's either 1-8 or 9-16 on the PalmPad because it only has 8 sets of buttons. You can tell by the switch at the lower end of the remote under the buttons.
  2. In Indigo Pro, select TRIGGERS from the outline view on the left
  3. Click the New… button
  4. Name the trigger “Palm Pad - Play iTunes” (or whatever you want)
  5. Select X10/RF Command Received from the Type: popup
  6. Select On from the popup labeled Received:
  7. Click the Address radio button
  8. Select the appropriate house code (as noted in step 1) and set the unit code (the number) to whichever button you want to use to start iTunes playing. (Make sure it isn't overlapping with a real X10 device, like a light, or the button will start iTunes playing AND turn on the light!)
  9. Click the Actions tab
  10. Select Execute AppleScript from the Type popup
  11. Make sure the Embedded: radio button is checked
  12. Type the following script into the text area below Embedded::
    iTunesPlay()
  13. Click OK (You've just created the trigger that will start iTunes playing - now, let's create the trigger that will pause iTunes)
  14. Click the New… button again
  15. Name the trigger “Palm Pad - Pause iTunes” (or whatever you want)
  16. Select X10/RF Command Received from the Type: popup
  17. Select Off from the popup labeled Received:
  18. Click the Address radio button
  19. Set the house code (the letter) and unit code (the number) to the same values as step 8 above
  20. Click the Actions tab
  21. Select Execute AppleScript from the Type popup
  22. Make sure the Embedded: radio button is checked
  23. Type the following script into the text area below Embedded::
    iTunesPause()
  24. Click OK

That should do it for Play and Pause. When you press the right “On” button on the Palm Pad, iTunes should start playing and it should pause when you press the corresponding “Off” button. NOTE: iTunes should be in a playable state: in other words, a valid playlist should be selected OR the Music Library. At the moment, the iTunes Attachment script (which you use by calling iTunesPlay()) isn't smart enough to first check to see if there is a playable playlist selected.

Set up the Volume Up/Volume Down button(s)

  1. Make a note of the X10 house code that your controller is using. The PalmPad has a dial on the lower end of the remote that points to the letter of the house code. Also note which unit codes the remote is going to send: it's either 1-8 or 9-16 on the PalmPad because it only has 8 sets of buttons. You can tell by the switch at the lower end of the remote under the buttons.
  2. In Indigo Pro, select TRIGGERS from the outline view on the left
  3. Click the New… button
  4. Name the trigger “Palm Pad - iTunes Volume Up” (or whatever you want)
  5. Select X10/RF Command Received from the Type: popup
  6. Select On from the popup labeled Received:
  7. Click the Address radio button
  8. Select the appropriate house code (as noted in step 1) and set the unit code (the number) to whichever button you want to use to start iTunes playing. Make sure it isn't the same you used for Play and Pause above - it's not gonna work as you might expect!
  9. Click the Actions tab
  10. Select Execute AppleScript from the Type popup
  11. Make sure the Embedded: radio button is checked
  12. Type the following script into the text area below Embedded::
    iTunesVolumeUp(5)
  13. Click OK (You've just created the trigger that will increase iTunes volume by 5% each time that button is pressed)
  14. Click the New… button again
  15. Name the trigger “Palm Pad - Pause iTunes” (or whatever you want)
  16. Select X10/RF Command Received from the Type: popup
  17. Select Off from the popup labeled Received:
  18. Click the Address radio button
  19. Set the house code (the letter) and unit code (the number) to the same values as step 8 above
  20. Click the Actions tab
  21. Select Execute AppleScript from the Type popup
  22. Make sure the Embedded: radio button is checked
  23. Type the following script into the text area below Embedded::
     iTunesVolumeDown(5)
  24. Click OK

Now, when you press the right “On” button on the Palm Pad, iTunes will increase the volume by 5% and the corresponding “Off” button will decrease the volume by 5%.

See, that wasn't hard at all! Next, we'll discuss getting it to work with an Insteon ControlLinc. It's really not much different.

Setting up Insteon ControLinc buttons to control iTunes

Difficulty: Simple

The process isn't very different from the PalmPad, but here's the whole thing.

Set up the Play/Pause button(s)

  1. Make a note of which buttons you plan on using on the ControLinc. There are 5 button groups (On and Off).
  2. In Indigo Pro, select TRIGGERS from the outline view on the left
  3. Click the New… button
  4. Name the trigger “ControLinc - Play iTunes” (or whatever you want)
  5. Select Insteon Command Received from the Type: popup
  6. Select On from the popup labeled Received:
  7. Click the Device radio button
  8. Select the ControLinc in the popup list
  9. Select the button/group you want to use (as identified in step 1)
  10. Click the Actions tab
  11. Select Execute AppleScript from the Type popup
  12. Make sure the Embedded: radio button is checked
  13. Type the following script into the text area below Embedded::
    iTunesPlay()
  14. Click OK (You've just created the trigger that will start iTunes playing - now, let's create the trigger that will pause iTunes)
  15. Click the New… button again
  16. Name the trigger “ControLinc - Pause iTunes” (or whatever you want)
  17. Select Insteon Command Received from the Type: popup
  18. Select Off from the popup labeled Received:
  19. Click the Device radio button
  20. Select the ControLinc in the popup list
  21. Select the button/group you want to use (as identified in step 1)
  22. Click the Actions tab
  23. Select Execute AppleScript from the Type popup
  24. Make sure the Embedded: radio button is checked
  25. Type the following script into the text area below Embedded::
    iTunesPause()
  26. Click OK

That should do it for Play and Pause. When you press the right “On” button on the ControLinc, iTunes should start playing and it should pause when you press the corresponding “Off” button. NOTE: iTunes should be in a playable state: in other words, a valid playlist should be selected OR the Music Library. At the moment, the iTunes Attachment script (which you use by calling iTunesPlay()) isn't smart enough to first check to see if there is a playable playlist selected.

Set up the Volume Up/Volume Down button(s)

  1. Make a note of which buttons you plan on using on the ControLinc. There are 5 button groups (On and Off).
  2. In Indigo Pro, select TRIGGERS from the outline view on the left
  3. Click the New… button
  4. Name the trigger “Palm Pad - iTunes Volume Up” (or whatever you want)
  5. Select Insteon Command Received from the Type: popup
  6. Select On from the popup labeled Received:
  7. Click the Device radio button
  8. Select the ControLinc in the popup list
  9. Select the button/group you want to use (as identified in step 1)
  10. Click the Actions tab
  11. Select Execute AppleScript from the Type popup
  12. Make sure the Embedded: radio button is checked
  13. Type the following script into the text area below Embedded::
    iTunesVolumeUp(5)
  14. Click OK (You've just created the trigger that will increase iTunes volume by 5% each time that button is pressed)
  15. Click the New… button again
  16. Name the trigger “Palm Pad - Pause iTunes” (or whatever you want)
  17. Select Insteon Command Received from the Type: popup
  18. Select On from the popup labeled Received:
  19. Click the Device radio button
  20. Select the ControLinc in the popup list
  21. Select the button/group you want to use (as identified in step 1)
  22. Click the Actions tab
  23. Select Execute AppleScript from the Type popup
  24. Make sure the Embedded: radio button is checked
  25. Type the following script into the text area below Embedded::
     iTunesVolumeDown(5)
  26. Click OK

Now, when you press the right “On” button on the ControLinc, iTunes will increase the volume by 5% and the corresponding “Off” button will decrease the volume by 5%.

See, that wasn't hard either! Next, we'll discuss getting it to work with an Insteon KeypadLinc.

Setting up KeypadLinc buttons to control iTunes

KeypadLinc buttons operate inherently differently from other controllers: the buttons, by default, are toggle buttons - which means that they are either on or off as indicated by whether it's lit up or not. We've created a separate How-To that explains how to control those buttons, and specifically how to keep one in sync with the iTunes play state. Read it!

itunes.txt · Last modified: 2014/05/28 16:15 (external edit)
 

© Perceptive Automation, LLC. · Privacy