PIIR is a command line tool to transmit IR-signals like remote controls do. PIIR is created as a generic tool that supports configuration and transmission of any signal, eg. including long aircondition signals.
Examples:
piir --remote tv_sony --feature action=TURN_ON
piir --remote hvac_panasonic --feature temperature=21 --feature mode=HEAT
- Send infrared commands to control aircondition etc.
- Transmit any IR signal using any protocol.
- Integration to home automation and other systems.
- Customization by configuration and plugins.
To control an IR-receiver you need to know the IR-signals to transmit to it. Either, you can:
- Use the protocol definitions that exists already inside PIIRs remote folder conf/remotes
- Reverse engineer your remote control, e.g. using IR decoder for Arduino which I did for Panasonic airconditioner
The tool is developed in C to support deployment on any platform.
The tool supports IR transmission by:
- Raspberry PI using GPIO
- more platforms to come
To be able to transmit IR signal you need an IR led, either:
- build the electronics yourself, e.g. as mentioned at Raspberry-PI-Geek
- apply an premade pHAT, eg. ANAVI Infrared pHAT
You need to identify a device you want to control by IR-signals, e.g. an airconditioner, a TV or similar.
Update package list:
sudo apt update
PIIR uses the library PIGPIO which you can install by:
sudo apt install -y pigpio
Install Autotools to enable compilation
sudo apt-get install -y autoconf automake libtool
Download and extract latest released PIIR software:
curl -s https://api.github.com/repos/mortenmathiasen/piir/releases/latest | sed -n 's/.*tarball_url":\s"\(.*\)".*/\1 -O piir.tar/p' | xargs wget
mkdir piir
tar xf piir.tar -C ./piir
mv ./piir/*/* ./piir
Now compile it:
cd piir
./autogen.sh
./configure
make
After compilation you can install the PIIR tool by:
sudo make install
After compilation you can test the PIIR tool by:
make check
You can deploy the PIIR tool to any live system. Either you can compile the sourced code directly on the live system as explained above or you can compile it on another development system and then move the execution file to your live system.
You kan get command line help running:
piir --help
Output will be like:
Available configuration files in /home/pi/piir/conf/remotes/:
hvac_panasonic
...
Available configuration files in /usr/local/share/piir/conf/remotes/:
hvac_panasonic
...
usage: piir
--remote, -r CONFIGFILE
[--feature, -f NAME=VALUE]
[--verbose, -v (TRACE|DEBUG|INFO|WARN|ERROR|FATAL|NOTHING)]
[--help, -h]
examples: piir --help
piir --remote hvac_panasonic --help
piir --remote hvac_panasonic --feature temperature=21
piir --remote tv_sony --feature action=TURN_ON
Specific help on available features for a particular remote can be achieved by:
piir --remote hvac_panasonic --help
Output will be like:
Features in config file /home/pi/piir/conf/remotes/hvac_panasonic.json:
temperature:
8
10
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
mode:
AUTO
HEAT
COOL
FAN
OFF
option:
AUTO
QUIET
POWERFUL
fan:
AUTO
VERYSLOW
SLOW
MEDIUM
FAST
VERYFAST
updown:
AUTO
VERYLOW
LOW
MIDDLE
HIGH
VERYHIGH
leftright:
AUTO
VERYLEFT
LEFT
MIDDLE
RIGHT
VERYRIGHT
usage: piir
--remote, -r CONFIGFILE
[--feature, -f NAME=VALUE]
[--verbose, -v (TRACE|DEBUG|INFO|WARN|ERROR|FATAL|NOTHING)]
[--help, -h]
examples: piir --help
piir --remote hvac_panasonic --help
piir --remote hvac_panasonic --feature temperature=21
piir --remote tv_sony --feature action=TURN_ON
A working example combining more features into the IR signal:
sudo piir --remote hvac_panasonic --feature temperature=21 --feature mode=HEAT --feature option=AUTO --feature fan=AUTO --feature updown=HIGH --feature leftright=MIDDLE --verbose=DEBUG
If everything goes well output from the command will be like this:
gpioWaveTxSend OK: 15897
Contribution to implement more transmitters is welcome.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
- Morten Mathiasen - Initial work - repositories
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details
- Thanks to Leon (https://anavi.technology/) for hardware and encouragement