From Thymian

In this Howto I want to show you that controlling infrared devices is nearly as easy as controlling 433Mhz devices. I really did little on my own because there are already tons of tutorials for lirc (Linux Infrared Remote Control).

A ) Set up your hardware
Pictures say more than 1000 words.

This is not my picture, but i included some important information for beginners.
You can see my soldered hardware here: http://forum.pimatic.org/topic/182/show-your-hardware/11

B ) Set up the software
As i completly followed THIS guide i wont repeat every single command. Its a very well written article and easy to understand, so i got nothing to do here :rainbow:

C ) Learning your remote
This section is also described on the website given above but i want to add one more thing:
After you successfully recorded your own remote and copied it in /etc/lirc/ you may want to give it a name in the config file so you can later send commands like irsend SEND_ONCE <YourRemoteName> KEY_MUTE.

  1. Stop lirc if running: sudo /etc/init.d/lirc stop
  2. Open config file sudo nano /etc/lirc/lircd.conf You can change the name of your remote by changing (guess what:) the line ‘name’.
  3. Close and save config file and start lirc again: sudo /etc/init.d/lirc start

D1) Infrared :arrow_right: Pimatic (scripts by @georg90)
Create and open file lircrc: sudo nano /etc/lirc/lircrc like following picture:

Then create and open the used script (in this example first make the directory /opt/scripts/)

  1. Go to /opt/ directory: cd /opt/
  2. Create new folder: mkdir scripts
  3. Go into the folder: cd scripts/
  4. Create following python script: sudo nano pimatic.py

(if you want to copy+paste: pastebin)

If you didnt yet work with api commands this thread should be helpful: http://forum.pimatic.org/topic/46/trigger-by-url/3

Still got Errors? Try this:

  1. If lirc is running you can execute sudo irw and then press the recorded buttons of your remote to look if lirc does recognize your remote buttons. In the following picture i tested if my volume buttons are recognized:

  2. If you are curious about your python script you can also run it manually with:
    sudo python /opt/scripts/pimatic.py an

D2) Pimatic :arrow_right: Infrared
Of course there is also a way to send IR signals with the Pimatic GUI. Follow these few steps:

  1. Add a new device to your config file:
{
    "id": "yamaha",
    "name": "Yamaha",
    "class": "ButtonsDevice",
    "buttons": [
      {
        "id": "yamahavoldown",
        "text": "Vol-"
      },
      {
        "id": "yamahamute",
        "text": "Mute"
      },
      ...
      ...
    ]
}
  1. Add rules for each button:
if yamahavolumedown is pressed then execute "irsend SEND_ONCE yamaha KEY_VOLUMEDOWN"
if yamahamute is pressed then execute "irsend SEND_ONCE yamaha KEY_MUTE"
...
  1. Voila! There you are:

Resources:
http://opensourceuniversalremote.com/
http://alexba.in/blog/2013/06/08/open-source-universal-remote-parts-and-pictures/
http://forum.pimatic.org/topic/218/tsop4838-and-pimatic-homeduino/7 thanks @georg90