[mythtv-users] MCE Remote and also controlling other devices

Robin Gilks g8ecj at gilks.org
Tue Sep 4 22:24:25 UTC 2007

> Hello,
> I have a MythTV box with a MS MCE Remote. What I have understand it can
> also
> control other devices, I mean the "IR Receiver" can also act "IR Sender"
> with the two plugs.
> Would it be possible to press "PC power" button and that put both the TV
> and
> Myth box in standby mode. If so how can it be done?? Any hints ??

I use mine to control both the TV and theatre amp power. No point in using
it to power off the myth box as otherwise it won't wake up again.

My lirc.conf file has the codes for the MCE remote, the TV remote and the
amp remote in it. This is required to generate the correct codes for the
IR senders. I run irexec with an entry in the .lircrc file that uses
irexec to call a script when the power button is pressed. Note that lirc
uses ALL entries in lircrc for a button definition so the same button can
be used by several applications SIMULTANEOUSLY. This allows me to use the
MENU jumppoint mapped to the power button in mythtv so I always 'park'
myth in a known place as well as calling the script.

These are my script and lircrc entries, the latter also maps the volume
controls (so I can use spdif output since mythtv can't then use the
internal alsa mixer controls):

 $ cat power_toggle.sh


DATE=`date +%s`

# Use the presense of a flag file to see if we are powering up or down
if [ -e $FILE  ]
LAST=`cat $FILE`
# ignore unless at least 10 seconds has passed  this stops a keybounce
# from turning us off straight after a turn on
if [ $(($LAST + 10)) -lt $DATE ]
# power down - just blindly do it
/usr/bin/irsend -d $DEV SEND_ONCE $TV T_power
/usr/bin/sleep 1
# the amp needs the code repeated to get it to work
/usr/bin/irsend -d $DEV SEND_ONCE $AMP A_power
/usr/bin/irsend -d $DEV SEND_ONCE $AMP A_power
/bin/rm -f $FILE

# power up - select tuner channel One on TV, that turns it on, then AV to
get to AV1
#           meanwhile, power up and select the correct input on the amp
/usr/bin/irsend -d $DEV SEND_ONCE $TV T_one
/usr/bin/sleep 1
/usr/bin/irsend -d $DEV SEND_ONCE $AMP A_dvd
/usr/bin/irsend -d $DEV SEND_ONCE $AMP A_dvd
/usr/bin/irsend -d $DEV SEND_ONCE $AMP A_dvd
/usr/bin/sleep 4
/usr/bin/irsend -d $DEV SEND_ONCE $TV T_av
echo $DATE > $FILE



 $ tail lircrc

    prog   = irexec
    button = Power
    config = /usr/local/bin/power_toggle.sh

#    prog   = irexec
#    button = *
#    config = /usr/local/bin/mythclick /usr/local/share/mythtv/beep.wav &

    prog   = irexec
    button = VolUp
    config = /usr/local/bin/setvol.sh A_volup

    prog   = irexec
    button = VolDown
    config = /usr/local/bin/setvol.sh A_voldown

    prog   = irexec
    button = Mute
    config = /usr/bin/irsend -d /dev/lircd1 SEND_ONCE rm-aap013 A_mute

Robin Gilks

More information about the mythtv-users mailing list