Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

Help Me Understand Mapping

pkdowningpkdowning Members Posts: 15 ✭✭
edited November 2011 in Plex Media Center - Mac
I, like many of you on this forum, are wanting to simplify and integrate our Harmony One remotes with Plex as well as other programs. Before I spring to buy a mac mini, I wanted to test out my harmony one remote with my iMac to see just how functional I could make my remote control. If all works as planned, I plan on buying a mac mini to complete the process of making my home theater. I have been following and reading the miniharmony.blogspot.com website as well as others and bought remote buddy. Although Nuno's setup is great and I would love to implement that, I am not sure I would be able to accomplish it as I don't want ALL of the features on the tutorials. I came across this site (http://www.geekzone.co.nz/lotech/7433) and thought that would be simple enough and offers just want I want; the ability to control EyeTV and Plex with the Harmony One remote.
The problem I am having is with mapping my harmony one. I was able to create the ten apple remotes 150-160, but I am not sure how to go about mapping the keys like it says on the website. What does it mean when it says "OK - 150 select" and so on?? When I go to the 150 remote in remote buddy and click on Plex under the "mapping" and "behaviours, I see "select" but under the "perform action" I don't see anywhere it says "ok". I am sure I am going about this the wrong way and that is why I am asking for your help.

If anyone would be willing to walk me through this process, I would be more than grateful. Thank you very much for taking the time to read this post and respond.

Comments

  • needles27needles27 Members, Plex Pass Posts: 31
    edited November 2011
    I was in the same situation as you. I saw a bunch of tutorials - especially nuno's - that looked pretty cool, but I felt lost instantly. I found another thread (a post by Alkie4life which seems to be gone, or hiding) that walked me though another way of controlling my Mini with the Harmony and Remote Buddy. It was step-by-step and did the trick. It took a little time to understand and implement, but now that it is set up everything is working flawlessly. Super easy to switch and control...in my opinion, this is THE way to do it. I will paste the (long) walkthrough in the next message, and hopefully you find it useful. A quick note - this one controls many applications, but you can just leave out the ones you don't need from the setup and applescript. Also, I'll add a few things that weren't listed in this tutorial:
    - You have to turn on "Enable access for assistive devices" in the "Universal Access" pane of the system preferences
    - You have to turn off the Harmony Remote in Plex (so Plex thinks it is just looking at an Apple Remote, I think it is called Standard) and turn off "Always running" Since Remote Buddy makes your Harmony look like a bunch of Apple Remotes, Plex will function if it is looking for an Apple Remote. Let me know if you need help - happy to give more info.
  • needles27needles27 Members, Plex Pass Posts: 31
    edited November 2011
    Here is a paste of the walkthrough: (Again, with all credit to Alkie4life for this write-up)


    After a few weekends of tweaking, I have gotten my Harmony controlling 4 applications: Plex, EyeTV, iTunes, and Hulu Desktop. The remote will seamlessly switch between the 4 with a press of a button. Below are the complete steps that I used to accomplish this, from start to finish. Please keep in mind I’m doing this from memory as I undertook this project over the course of several weekends, so I hope I didn’t leave anything out.
    I am not taking credit for this work. I attribute this to the hard work everyone else did in this thread that I’m capitalizing on. Thanks goes to the great Plex community for helping me get my setup complete, and thus creating this write up.
    Assumptions
    1. Using Remote Buddy (RB).
    2. Using built in IR port on the Mini.
    3. Only using 1 activity on the remote. Recommended as it avoids having numerous power on and power off functions. Also requires far less tweaking in the Harmony itself and rather diverts control to RB, which is far more powerful and user friendly.
    4. I want EyeTV to always be the start application when the activity starts. This is because 90% of what I do with the Mini and my wife is watch live TV.
    5. I always want EyeTV running for recording purposes.
    6. I never want other applications open unless in use.
    Part 1: Add Plex as a device to Harmony remote.
    1. Go into the Harmony software and add Plex as a device.
    2. Create a new activity (or reuse and existing one) and ensure you are building Plex into the activity.
    3. Once activity is created, click “Customize Buttons” at the Activity level to see what functions are mapped to what buttons.
    a. Note: I had to manually force Plex functions to each harmony button. The Harmony software defaulted only the volume controls for my receiver, all other buttons were left blank.
    4. Assign a Plex button for each hard button and soft button. Make sure you note what Plex functions are mapped to which Harmony buttons. You will need these mappings so best to create a spreadsheet at this point. Also make sure you map ALL Plex functions to a button. This will give you extra keys that you can code as you please in RB. Once you are done, you should have a Plex function assigned to every hard button on the remote, and additional soft keys created and assigned so that each Plex function is uniquely assigned to a Harmony button.
    Part 2: Create logical remotes in RB.
    1. Now that every Harmony button is assigned a unique Plex function, you need to “teach” RB the IR codes.
    2. Open RB and click the Hardware tab.
    3. In the far left column, click on the Built-In IR Receiver.
    4. Start pressing each button on the Harmony remote. You should see remotes being added in the far right column with an ID of 150 – 160.
    a. Note: 156 seems to be skipped.
    b. You don’t need to press every button on the Harmony, just press enough buttons to get every remote ID added.
    5. Once all 10 remote IDs have been added, you need to add Logical remotes to correspond. Click the + sign in middle column “Logical Remotes” and add one logical remote for each remote ID.
    a. Note: Recommended to rename each logical remote to something recognizable. I used naming convention AR150 – AR160.
    6. Once the logical remotes are created, you have to map them together. In the far right column, click on each row and assign the ID to a logical remote created in step 5.
    7. If you have done everything correctly, you can now start mapping in RB to assign each button press on the Harmony to do whatever you would like.
    Part 3: Create RB mappings.
    1. Click on the Mapping tab in RB.
    2. Pick one application that you would like to start mapping. I started with EyeTV but you can do whatever you like. Click that behavior in the list on the left side.
    3. I went through and cleared out all existing mappings for all logical remotes. This simplified things for me so I knew what was mapped and what wasn’t.
    4. This is where things get a little tricky until you get it down. You will need your spreadsheet that shows what Plex function each Harmony key is mapped to (from the Harmony software), and also the list of Harmony to RB mappings listed below. (Thanks to Convergent for posting these.)
    Harmony button - RemoteID Button
    OK - 150 Play/Pause
    Up - 150 Plus
    Down - 150 Minus
    Left - 150 Left
    Right - 150 Right
    VolUp - 152 Plus
    VolDn - 152 Minus
    Mute - 152 Play/Pause
    ChUp - 158 Plus
    ChDown - 158 Minus
    Prev - 153 Minus
    Menu - 150 Menu
    Exit - 155 Plus
    Guide - 157 Play
    Info - 153 Plus
    Stop - 151 Play
    Replay - 160 Plus
    Skip - 160 Minus
    Play - 151 Menu
    Rec - 155 Minus
    Rew - 154 Plus
    Fwd -154 Minus
    Pause - 152 Menu
    1 - 151 Plus
    2 - 151 Minus
    3 - 151 Left
    4 - 151 Right
    5 - 152 Left
    6 - 152 Right
    7 - 153 Left
    8 - 153 Right
    9 - 154 Left
    0 - 154 Right
    Clear - 154 Play
    Enter - 153 Menu
    Blue - 159 Menu
    Red - 159 Left
    Green - 159 Right
    Yellow - 159 Play
    Aspect - 157 Plus
    LargeUp - 159 Plus
    LargeDown - 159 Minus
    PwrToggle - 157 Menu
    Queue - 157 Minus
    Sleep - 154 Menu
    F1 - 155 Left
    F2 - 155 Right
    F3 - 155 Play
    F4 - 155 Menu
    F5 - 160 Left
    F6 - 160 Right
    F7 - 160 Play
    F8 - 160 Menu
    F9 - 158 Left
    F10 - 158 Right
    F11 - 158 Play
    F12 - 158 Menu
    F13 - 157 Left
    F14 - 157 Right
    5. The key to this is it takes several look-ups before you are ready to map in RB. What I did to make things easy is start with the obvious keys. I started with the Play button on the remote. First look in your spreadsheet to see what Plex function you assigned to the Play button. (Hopefully you assigned things in a logical way.) Once you know what Plex function you assigned to the button, you need to cross reference the Plex function to the RB ID in the above list. Once you know the RB ID, find that combination of ID and button in the Mapping tab in RB and then assign to whatever function you want.
    a. EX: Harmony Play Button (physical remote) -> Plex Function Play (what I mapped it to in the Harmony software) -> RB 151 Menu (from the above list) -> EyeTV behavior Play (what I assigned it to in RB)
    6. Rinse and repeat for every Harmony button you want to assign to that particular behavior.
    7. Once complete, you should have a functioning remote to control the application. Open the application and test out all the mappings to make sure they do what you’d like. Tweak as needed.
    Part 4: Adding additional applications.
    1. Once you have your starter app working how you like, it’s time to start adding more! To do this, you’ll need AppleScript (AS) to switch applications.
    2. Start by writing your AS and testing it. Below I included all 4 of my AppleScripts that switch to each application. You will want to create one AS for each “switch” you want to make.
    a. Note these are what I wrote to control all 4 of my applications listed above. I always want EyeTV running so I never close it, just close the active windows. All other applications I want closed when not in use. Adjust as needed.
    b. The lines below separate each AS.


    --Switch TO EyeTV, close all other applications.
    if application "Plex" is running then
    tell application "Plex"
    quit
    end tell
    end if
    if application "Hulu Desktop" is running then
    tell application "Hulu Desktop"
    quit
    end tell
    end if
    if application "iTunes" is running then
    tell application "iTunes"
    quit
    end tell
    end if
    tell application "EyeTV"
    activate
    end tell
    --Move the mouse cursor out of the top of the screen.
    tell application "Remote Buddy"
    repeat 5 times
    behaviouraction actionIdentifier "input.mouse.cursordown" event "pressed"
    behaviouraction actionIdentifier "input.mouse.cursordown" event "released"
    behaviouraction actionIdentifier "input.mouse.cursorright" event "pressed"
    behaviouraction actionIdentifier "input.mouse.cursorright" event "released"
    end repeat
    end tell
    tell application "System Events"
    tell process "EyeTV"
    delay 2
    keystroke "o" using command down
    delay 2
    keystroke "0" using command down
    end tell
    end tell


    --Switch TO Hulu Desktop, close EyeTV windows, close all other applications.
    if application "EyeTV" is running then
    tell application "EyeTV"
    activate
    end tell
    tell application "System Events"
    tell process "EyeTV"
    keystroke "w" using command down
    end tell
    end tell
    end if
    if application "Plex" is running then
    tell application "Plex"
    quit
    end tell
    end if
    if application "iTunes" is running then
    tell application "iTunes"
    quit
    end tell
    end if
    tell application "Hulu Desktop"
    activate
    end tell


    --Switch TO iTunes, close EyeTV windows, close all other applications.
    if application "EyeTV" is running then
    tell application "EyeTV"
    activate
    end tell
    tell application "System Events"
    tell process "EyeTV"
    keystroke "w" using command down
    end tell
    end tell
    end if
    if application "Hulu Desktop" is running then
    tell application "Hulu Desktop"
    quit
    end tell
    end if
    if application "Plex" is running then
    tell application "Plex"
    quit
    end tell
    end if
    tell application "iTunes"
    activate
    end tell


    --Switch TO Plex, close EyeTV windows, close all other applications.
    if application "EyeTV" is running then
    tell application "EyeTV"
    activate
    end tell
    tell application "System Events"
    tell process "EyeTV"
    keystroke "w" using command down
    end tell
    end tell
    end if
    if application "Hulu Desktop" is running then
    tell application "Hulu Desktop"
    quit
    end tell
    end if
    if application "iTunes" is running then
    tell application "iTunes"
    quit
    end tell
    end if
    tell application "Plex"
    activate
    end tell


    3. Now that you have you AS written, you need to map those to functions in RB. You need these to be Global actions so they are accessible across all behaviors.
    4. In RB, pick your behavior from Part 3 and click on any blank mapping. Find Custom Actions and click on it.
    5. Create a new Custom Action by clicking the + sign on the bottom left.
    6. Name it whatever you like, I used naming convention “Plex Activate”, “EyeTV Activate”, etc.
    7. Click the “Action available globally and for context menu” check box. This makes the action global for all behaviors.
    8. Click the + on the right under “Actors to run within Action” and add an AS actor.
    9. Paste in the corresponding AS code from above.
    10. Click Compile.
    11. Assuming no compile errors, change the Options to be “Execute on button press”.
    12. Click Close.
    13. On the Mapping tab, select Global mapping on the left and assign the newly created actions to whatever button press you want. Again, follow the steps from part 3 to as you have to cross reference all the mappings.
    a. Note: I am using soft keys for this, but you can use hard keys also if you prefer. If using soft keys, you’ll most likely need to go back into the Harmony software and change the name of soft key to something useful that describes what it’s doing.
    14. Once done, press the button on the remote and it should fire the AS and switch applications for you. RB automatically recognizes what application is active so at this point, you can map all the Harmony buttons to what you want for the new application, again using the steps from Part 3.
    15. Create additional “switchers” as needed and add apps as desired.
    16. At this point, you should have everything functioning with just one sticky point left.
    Part 5: Adding Power On and Power Off procedures.
    1. All that’s left at this point is telling RB what you want it to do when you “power on” the activity (I.E. press “Watch TV” or whatever you named your activity from Part 1) and what happens when you press the power button to shut everything off.
    2. What I did was create PowerOn and PowerOff AppleScripts to fire.
    3. Start by telling the Harmony software to send an extra command at Activity Start and Power Off. Go into the Harmony software, and select “Settings” under your activity.
    4. Click “Review the settings for this activity”.
    5. Click “Yes, but I want to add more control of options and devices for this Activity.”
    6. Keep clicking all the way until you get screen that says “When you enter this activity, these devices are turned on and the following actions occur:”.
    7. Click “Add action for Plex”.
    8. Click the “Send this infrared command” and then select an unused Plex function from the list.
    9. Click Next.
    10. Repeat for the power off action.
    11. Now when you power on your activity, or when you power off the Harmony will send an extra IR command that you can map in RB to run an AS to do whatever you like. Write your AS how you like, and repeat Part 4 to make these global, and map them as you did in Part 3. Below are the PowerOn and PowerOff scripts I’m using. The PowerOn script is identical to the “Switch to EyeTV” script above, but I wanted to map them to separate functions so in the event I ever want to change either script to add more control, I have the option without having to go back into the Harmony software.


    --PowerOn and activate EyeTV, close any other active applications. (Shouldn’t be needed but just in case.)
    if application "Plex" is running then
    tell application "Plex"
    quit
    end tell
    end if
    if application "Hulu Desktop" is running then
    tell application "Hulu Desktop"
    quit
    end tell
    end if
    if application "iTunes" is running then
    tell application "iTunes"
    quit
    end tell
    end if
    tell application "EyeTV"
    activate
    end tell
    --Move the mouse cursor out of the top of the screen.
    tell application "Remote Buddy"
    repeat 5 times
    behaviouraction actionIdentifier "input.mouse.cursordown" event "pressed"
    behaviouraction actionIdentifier "input.mouse.cursordown" event "released"
    behaviouraction actionIdentifier "input.mouse.cursorright" event "pressed"
    behaviouraction actionIdentifier "input.mouse.cursorright" event "released"
    end repeat
    end tell
    tell application "System Events"
    tell process "EyeTV"
    delay 2
    keystroke "o" using command down
    delay 2
    keystroke "0" using command down
    end tell
    end tell


    --PowerOff and close all applications.
    if application "EyeTV" is running then
    tell application "EyeTV"
    activate
    end tell
    tell application "System Events"
    tell process "EyeTV"
    keystroke "w" using command down
    end tell
    end tell
    end if
    delay 1
    if application "Hulu Desktop" is running then
    tell application "Hulu Desktop"
    quit
    end tell
    end if
    delay 1
    if application "iTunes" is running then
    tell application "iTunes"
    quit
    end tell
    end if
    delay 1
    if application "Plex" is running then
    tell application "Plex"
    quit
    end tell
    end if


    And that should be it! You should be all done! At this point you should be able to power on and off your entire setup, and switch applications to whatever you have mapped, along with full control of each app. Now it’s just tweaking everything to get it just right. RB is an incredibly powerful tool and you can make it do just about anything.
    Again, thanks to everyone in the Plex community for helping me get my setup done. It’s truly an amazing community. Hopefully this helps others wanting to take the plunge. It seems complicated but once you get started it’s really pretty quick.
  • hifimachifimac Members, Plex Pass Posts: 39 Plex Pass
    Epic Post!
Sign In or Register to comment.