0

Note: CommandIR support has moved to www.commandir.com/support/.
Home arrow LIRC Config Help arrow Powering on Devices from Remote
Powering on Devices from Remote PDF Print E-mail

Powering on device using the 'Power' button on your remote is one case of the Remote Translator.  First, we'll look at a basic example then show how to extend it to other devices.

Toggling Power on One Device

 Use LIRC's irexec command to trigger an "irsend" when a certain key is pressed:

  • Test your power command with irsend - eg. irsend send_once my_tv power
  • Pick the remote(s) and button(s) that should trigger your Power toggle
  • Find and edit your .lircrc file (usually /home/mythtv/.lircrc) and add a stanza for irexec similar to this:

begin
 prog = irexec

 remote = hauppauge_pvr

 button = power
 config = irsend send_once my_tv power
end

  • Run irexec as your MythTV user to ensure it uses the .lircrc you just edited
  • Press your power button and watch your device power toggle!
Troubleshooting: you may need to specify a full path to irsend on your config = line.

Power Toggling Multiple Devices

Simply create a script with your irsend commands to be run by irexec:

    #!/bin/bash

    irsend send_once my_tv power

    irsend send_once my_dvd_player power

    irsend send_ once my_audio_receiver power

Modify the original .lircrc to call your script instead of irsend. Ensure your script is executable by your LIRC user.

Add irexec to a start-up script to load at boot-time. 

Example Files and Commands

 main-power-toggle.sh:
#!/bin/bash
irsend set_transmitters 3
irsend send_once big_screen_tv power
irsend set_transmitters 4
irsend send_once audio_amp power

 irexec /home/mythtv/lircrc

 begin
    prog = irexec
    button = power
    repeat = 0
    config = /path/to/power-on-toggle.sh
    flags = quit
end

 

 
Free Joomla Templates