Author Topic: How to send multiple IR codes for one command  (Read 4869 times)

jeangot

  • Guru
  • ****
  • Posts: 233
    • View Profile
How to send multiple IR codes for one command
« on: January 03, 2009, 02:27:24 am »
Hello,

I am trying to control a Panasonic Projector which lacks discrete IR commands for ON/OFF.
I need to send the following keypresses:
For ON: Power then Return
For OFF: Power then Power

I guess this is called a "macro" in regular universal remote language.

In LMCE, I am asked to define one single IR code for the command ON and a single IR code for the command OFF. How can I send several IR codes for ON and OFF? I tried entering multiple IR codes where I define the code for ON and OFF, but that did not work. If I would create a new command called Return, would I be able somehow to create 2 new On and Off Commands that "play" several commands one after another?

Thank you for any help or pointers.

Jean

jondecker76

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 763
    • View Profile
Re: How to send multiple IR codes for one command
« Reply #1 on: January 03, 2009, 04:40:04 am »
There isn't a real "native" way to do this.. In LMCE, you can create a "Command Group" - AKA Scenario..  Crete a scenario that uses multiple commands (an IR off followed by a channel 2 command for example). You can execute this command group (scenario) in response to events, or on command..

If you are really savvy, you can create the command group entirely in SQL, but you would have to study up first....

Maybe somebody knows a better way, but this is how I do such things. In the future it would be nice to create scenarios (command groups) and set a flag to not show them in Orbiter. For now you can just create these scenarios in an unused room for a similar effect.

jeangot

  • Guru
  • ****
  • Posts: 233
    • View Profile
Re: How to send multiple IR codes for one command
« Reply #2 on: January 03, 2009, 05:50:58 am »
Jon,

thanks, that would be good enough, but then how do I tell the system to use my newly created scenarios to turn on and off the device, instead of the normal ON and OFF commands? The idea would be to still have the system turn the device on an off as usual (turn on when I want to watch TV, turn off after 15 mins of inactivity, turn on in security breach etc)

Jean

jondecker76

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 763
    • View Profile
Re: How to send multiple IR codes for one command
« Reply #3 on: January 03, 2009, 12:52:13 pm »
you could try responding to events like Watching Media or Stopped Watching Media, then use Internal command #370 - Execute Command Group to execute the scenario (or macro in other terms) you created.

Of course, you may need to get a bit tricky.. For example, the On and Off IR codes will fire automatically if you learn them.. You could stop this by removing the on and off IR codes, and assigning the on and off IR codes to an unused "dummy" IR command, then referencing these dummy commands manually from within your scenario (you could also use the web admin to create your own command for this purpose and name it for example "Off - unmanaged" or similar for cleaner integration). It will take some experimentation, but doing something like is a step in the right direction for what you are wanting to do. Just remember that you will have to manually create the responses to events to get these scenarios to fire for example on a security breach, etc...
« Last Edit: January 03, 2009, 12:55:35 pm by jondecker76 »

jeangot

  • Guru
  • ****
  • Posts: 233
    • View Profile
Re: How to send multiple IR codes for one command
« Reply #4 on: January 19, 2009, 05:09:32 pm »
If anyone is interested I was able to do this with LMCE's "original" On and Off commands the following way:
- first I setup a custom device template that will use Ruby code, using Thom's very usefull information in this thread:
http://forum.linuxmce.org/index.php?topic=7024.0
- the I use for example the following code for Off:
system ("/usr/pluto/bin/MessageSend 192.168.78.1 0 363 1 191 9 \"0000 0070 0000 003A 0080 0041 0010 0010 0010 0030 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0030 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0030 0010 0010 0010 0010 0010 0010 0010 0030 0010 0010 0010 0010 0010 0030 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0030 0010 0010 0010 0030 0010 0030 0010 0030 0010 0030 0010 0010 0010 0010 0010 0030 0010 0010 0010 0030 0010 0010 0010 0030 0010 0030 0010 0031 0010 0030 0010 0ABB\"")
system ("sleep 1")
system ("/usr/pluto/bin/MessageSend 192.168.78.1 0 363 1 191 9 \"0000 0070 0000 003A 0080 0041 0010 0010 0010 0030 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0030 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0030 0010 0010 0010 0010 0010 0010 0010 0030 0010 0010 0010 0010 0010 0030 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0030 0010 0010 0010 0030 0010 0030 0010 0030 0010 0030 0010 0010 0010 0010 0010 0030 0010 0010 0010 0030 0010 0010 0010 0030 0010 0030 0010 0031 0010 0030 0010 0ABB\"")

Where 192.168.78.1 is the Ip of my core (localhost will not work since the command is mostly executed on MDs), 363 is the device id for my USBUIRT IR Transmitter, and 191 means the "off" command. The data at the end is in Pronto format.

It's not completely kosher since the ID for my USB Uirt is hard coded, and that defeats the purpose of LMCE's message routing intelligence and LMCE templates, but it works.

Jean

Zaerc

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 2256
  • Department of Redundancy Department.
    • View Profile
Re: How to send multiple IR codes for one command
« Reply #5 on: January 20, 2009, 03:38:28 am »
First off, it is asking for trouble to change the IP of the core as 192.168.80.1 is hardcoded in many of the scripts under 0710.

Other then that I would suggest using the "dcerouter" hostname instead of an IP-address, this should always point to the core (whether it is executed on the core or an MD).

Could you be so kind to add a page to the wiki on that projector, and include those instructions please?
"Change is inevitable. Progress is optional."
-- Anonymous


jeangot

  • Guru
  • ****
  • Posts: 233
    • View Profile
Re: How to send multiple IR codes for one command
« Reply #6 on: January 20, 2009, 07:13:16 am »
Zaerc,
unfortunately although the described method for sending the IR commands works perfectly, the result as far as the projector is concerned is a failure. The projector is lacking discrete commands, and someone had posted in a forum a succession of keys to suposedly unequivocally turn the projector on and off, but it turns out than an off command will also turn it on if it's already off (however not the other way around) so every time the system is reloaded the projector goes on, which is useless.
I will know fallback on RS232 and as soon as I have that working, I will be happy to create a wiki page.

Which brings 2 questions for you:

1. Did you guys fix the problem with the captcha on the wiki so that pages with external links can be properly edited? (If so I still have a few things to update)
2. Do you have a USB to Serial converter to recommend that will work for sure with LMCE? (On my MSI Media Live which is lacking a Serial port)

Jean

Marie.O

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3675
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: How to send multiple IR codes for one command
« Reply #7 on: January 20, 2009, 08:46:34 am »
[..]
1. Did you guys fix the problem with the captcha on the wiki so that pages with external links can be properly edited? (If so I still have a few things to update)

The captcha is working if you come in via http://wiki.linuxmce.org

There is a problem if you come in via .com

ladekribs

  • Veteran
  • ***
  • Posts: 86
    • View Profile
Re: How to send multiple IR codes for one command
« Reply #8 on: February 23, 2009, 07:40:43 am »
Hi Jean,

I found this that might help You:
discrete ON/OFF commands for panasonic
http://www.remotecentral.com/cgi-bin/mboard/rc-discrete/thread.cgi?4134

if that does not help, you might merge two IR commands to one:
Command 1:
0000 0070 0000 003A 0080 0041 0010 0010....0ABB

Command 2:
0000 0070 0000 003A 0080 0041 0010 0010....0ABB

new command:
0000 0070 0000 0074 0080 0041 0010 0010....0ABB 0080 0041 0010 0010....0ABB



 I have sucessfully tried that on a Philips TV

BR Stefan