[mythtv-users] harmony remote and start/stop scripts

Aaron aaron at rb303.net
Fri May 11 14:07:49 UTC 2012


On Fri, May 11, 2012 at 6:09 AM, Mike Perkins
<mikep at randomtraveller.org.uk>wrote:

> On 11/05/12 01:52, Aaron wrote:
>
>> I am trying to get my Harmony remote to start/stop the mythfrontend to
>> make
>> it simpler for my family to do different things. I am on Mythbuntu 12.04
>> 32bit. I have setup a irexec file, and made sure its running in daemon
>> mode. It all seems to kinda work, but not really sure what I'm missing to
>> make it run 100%. Here are my files, I think I just need another pair of
>> eyes to help me see what I am missing.
>>
>> The parts I can't easily show are I have my Harmony remote set to run two
>> different activities. First one is "Watch TV" , second is "Watch Movies".
>> The watch TV activity is set to use the TV for audio (HDMI); then the
>> movies activity is set to use SPDIF to my receiver. I have it set to send
>> KEY_BLUE and KEY_YELLOW as the power on/off sequence from the remote. I
>> have verified it is sending them with irw.
>>
>> The reason behind all this is my wife seems to get easily confused, so I
>> am
>> trying to eliminate all "hassles" with switching applications. I should
>> mention when I run these scripts by hand they run flawlessly. So I'm not
>> really sure where or why its not running correctly. The results are
>> baffling. If I press "Watch TV" MythTV will pop up then close, then XBMC
>> will open. If I press "Watch Movies" it does the opposite. At first I
>> thought I had the Blue and Yellow wrong in the remote, but I've verified
>> it
>> many times. I have also switched KEY_BLUE and KEY_YELLOW in the irexec
>> file, but it didn't seem to make a difference. Any incite would be much
>> appreciated.
>>
>> ~/.lirc/irexec
>> # MythTV
>> begin
>>      remote = mceusb
>>      prog = irexec
>>      button = KEY_BLUE
>>      config = ~/scripts/mythtv_start.sh&
>> end
>>
>> # XBMC
>> begin
>>      remote = mceusb
>>      prog = irexec
>>      button = KEY_YELLOW
>>      config = ~/scripts/xbmc_start.sh&
>> end
>>
>> ~/scripts/mythtv_start.sh
>> #!/bin/bash
>> # Test to see if XMBC is running first
>> if ps -ef | grep xbmc.bin | grep -v grep
>> then
>> killall -v -s9 xbmc.bin
>> fi
>> # Now to see if MythTV is running
>> if ps -ef | grep mythfrontend | grep -v grep
>> then
>> # Do nothing
>> echo “MythTV already Running!”
>> else
>> # Startup MythTV
>> mythfrontend
>> fi
>> exit
>>
>> ~/scripts/xbmc_start.sh
>> #!/bin/bash
>> # Test to see if MythTV is running
>> if ps -ef | grep mythfrontend | grep -v grep
>> then
>>         killall -v -s9 mythfrontend.re
>> fi
>> # Now to see if XBMC is running
>> if ps -ef | grep -v grep | grep -i xbmc.bin
>> then
>> # Do nothing
>> echo “XBMC already Running!”
>> else
>> # Startup XBMC
>> xbmc
>> fi
>> exit
>>
>>  You don't say which model of Harmony remote. That might be significant.
>
> I would add this comment, based on my own experiences: Make sure that both
> the Harmony and *all* your devices are in the same, known, consistent state
> before you do any testing. Harmony remotes have an internal idea of what
> state each device is supposed to be in; if for example something is powered
> up when the remote thinks it should be off (or vice versa) then it is very
> easy to get into a confused state.
>
> My system is a Harmony 600, TV, cable box, mythtv front end and DVD
> player. Currently I don't allow the remote to control the power on the
> cable box or the front end. The cable box is always on (standby saves
> nothing) and the TV gets confused switching inputs when the frontend powers
> up so we do that manually.
>
> Try eliminating issues like power commands and just test a basic system.
> Switch everything on and get the TV to change inputs properly first. You
> can always add extras later.
>
> --
>
> Mike Perkins
>
> ______________________________**_________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://www.mythtv.org/mailman/**listinfo/mythtv-users<http://www.mythtv.org/mailman/listinfo/mythtv-users>
>

Thank you, I have a harmony one. I did eliminate the power commands last
night and it's working as designed now. When I was watching the output from
irw I noticed it would re-send the KEY_BLUE after all the other commands so
I told the remote to leave the devices (xbmc and mythtv) on at all times;
disable power commands. Then I realized from the irw output that I could
just use the switch input keys that the remote was sending (now I use RecTV
for MythTV and KEY_HOME for XBMC). Now everything is working perfectly. I
did disable the corresponding keys on each action, so MyhTV no longer has a
media key (KEY_HOME) and xbmc doesn't have RecTV key. I did this just so
they don't press it and get everything confused.

I have two activities one Watch TV and then Watch Movies, the wife and kids
are very happy.

Thanks Greg G. I will try that!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mythtv.org/pipermail/mythtv-users/attachments/20120511/c51360ef/attachment.html>


More information about the mythtv-users mailing list