[mythtv-users] LIRC irsend to turn on TV

Robin Gilks g8ecj at gilks.org
Fri Jan 19 00:34:10 UTC 2007


>
> Hi,
>
> I am trying to get lirc to turn on my projector when i push the power
> button.
>
> I bought the remote bundled with the PVR-150MCE Kit.
>
> It works just like a MCE USB remote.  Thats the config file im using in
> /etc/lircd.conf  and irw detects all button pushes.
>
> I want to get lirc to turn on the projector (infocus 4805) when i push the
> power button.  To this is I *think* i would just put in the
> ~/.mythtv/lircrc file as program irsend and then the command/script to
> run.
>
> The problem is that i cannot figure you how to use irsend.  I did find
> this remote file on the lirc page for a Infocus 5000.  I am hopeing that
> the power is the same on the 4805.  Otherwards I will need to use the
> capture prog.
>
> Please help
>
> Thanks,
> Mitchell
>

This is how I've done it - I turn the power on my TV & Theatre amp on/off
using a script that remembers the current state.

In my lircd,conf file I have the codes for both the TV and the amp (so
they can be generated by IRSEND) as well as the codes for the remote
control.

This is a grep of the power button codes out of that file (the file itself
is rather large due to having codes for a STB as well as TV, amp and
remote!!
          Power    0x00007bf3
          S_power  0x000000000000847B
          T_power  0x000000000100BCBD


In my lircrc file I have the following:

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

The shell script, which uses a serial sender set up as /dev/lircd1, is as
follows:

#!/bin/sh

TV=panasonic_tv_01
AMP=rm-aap013
FILE=/home/mythtv/.power

# Use the presense of a flag file to see if we are powering up or down
if [ -e $FILE  ]
then
# power down - just blindly do it
/usr/bin/irsend -d /dev/lircd1 SEND_ONCE $TV T_power
sleep 1
# the amp needs the code repeated to get it to work
/usr/bin/irsend -d /dev/lircd1 SEND_ONCE $AMP A_power
/usr/bin/irsend -d /dev/lircd1 SEND_ONCE $AMP A_power
/usr/bin/irsend -d /dev/lircd1 SEND_ONCE $AMP A_power
rm -f $FILE

else
# 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/lircd1 SEND_ONCE $TV T_one
sleep 1
/usr/bin/irsend -d /dev/lircd1 SEND_ONCE $AMP A_video2
/usr/bin/irsend -d /dev/lircd1 SEND_ONCE $AMP A_video2
/usr/bin/irsend -d /dev/lircd1 SEND_ONCE $AMP A_video2
sleep 4
/usr/bin/irsend -d /dev/lircd1 SEND_ONCE $TV T_av
touch $FILE

fi

-- 
Robin Gilks




More information about the mythtv-users mailing list