IR Sensor on Raspberry Pi 3
Moderators: leecollings, remb0
-
- Posts: 24
- Joined: Sunday 12 March 2017 1:19
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Sweden
- Contact:
IR Sensor on Raspberry Pi 3
Hey all
I have a Raspberry Pi 3 and razberry2 and Domoticz installed and so I would like to install an IR receiver to Domoticz, How to add USB IR receiver in Raspberry to make it work with domoticz. Or there are other solutions for this
someone who can help me with this
/Peter
I have a Raspberry Pi 3 and razberry2 and Domoticz installed and so I would like to install an IR receiver to Domoticz, How to add USB IR receiver in Raspberry to make it work with domoticz. Or there are other solutions for this
someone who can help me with this
/Peter
-
- Posts: 24
- Joined: Sunday 12 March 2017 1:19
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Sweden
- Contact:
Re: IR Sensor on Raspberry Pi 3
No one who can help me
-
- Posts: 722
- Joined: Friday 02 October 2015 12:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Finland
- Contact:
Re: IR Sensor on Raspberry Pi 3
Have you checked out Flirc if it would suit your needs?
https://www.domoticz.com/forum/viewtopi ... 33#p123013
https://flirc.tv/
https://www.domoticz.com/forum/viewtopi ... 33#p123013
https://flirc.tv/
-
- Posts: 14
- Joined: Thursday 07 April 2016 18:57
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: IR Sensor on Raspberry Pi 3
Hello i make a tutorial (in french) for a receiver directly connected to the GPIO.
https://matdomotique.wordpress.com/2016 ... arouge-ir/
Envoyé de mon iPhone en utilisant Tapatalk
https://matdomotique.wordpress.com/2016 ... arouge-ir/
Envoyé de mon iPhone en utilisant Tapatalk
-
- Posts: 24
- Joined: Sunday 12 March 2017 1:19
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Sweden
- Contact:
Re: IR Sensor on Raspberry Pi 3
thanks for the information
But how do I do an installation with FLIRC USB to Raspberry Pi
But how do I do an installation with FLIRC USB to Raspberry Pi
-
- Posts: 24
- Joined: Sunday 12 March 2017 1:19
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Sweden
- Contact:
Re: IR Sensor on Raspberry Pi 3
thanks for the informationsupermat wrote:Hello i make a tutorial (in french) for a receiver directly connected to the GPIO.
https://matdomotique.wordpress.com/2016 ... arouge-ir/
Envoyé de mon iPhone en utilisant Tapatalk
Gets a little difficult when I have RazPberry Z-Wave module installed
-
- Posts: 722
- Joined: Friday 02 October 2015 12:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Finland
- Contact:
Re: IR Sensor on Raspberry Pi 3
It goes something like this:Harlov wrote:thanks for the information
But how do I do an installation with FLIRC USB to Raspberry Pi
1. Install the Flirc configuration software (to pc/mac) and plug in the Flirc to this computer
2. Using the configurator, link IR commands of your choice to key combinations (whatever key combinations you prefer)
3. Plug Flic to your RPi in such way it can receive IR commands (I used a 2m USB extension chord as my RPi is in a cabinet), Flirc is automatically recognised as a keyboard so nothing needs to be installed
4. Raspbian comes pre-installed with a program called Triggerhappy (thd), use this program to link the key combinations to Domoticz json calls
5. Now you can use any IR command to trigger any Domoticz action!

To configure the triggerhappy program, go to "/etc/triggerhappy/triggers.d" and create a new text file (I use domoticz.conf) with lines like (in this example the IR command is tied to SHIFT+CTRL+1):
Code: Select all
KEY_1+KEY_LEFTSHIFT+KEY_LEFTCTRL 1 curl -s "http://url:port/json.htm?type=command¶m=switchlight&idx=IDXofNEOplug&switchcmd=On"
-
- Posts: 24
- Joined: Sunday 12 March 2017 1:19
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Sweden
- Contact:
Re: IR Sensor on Raspberry Pi 3
I thank you very much for this
What I do not understand is how to start Trigger Happy (thd) .. I start it with
Example PUTTY?
Thanks again for your help

What I do not understand is how to start Trigger Happy (thd) .. I start it with
Example PUTTY?
Thanks again for your help
-
- Posts: 24
- Joined: Sunday 12 March 2017 1:19
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Sweden
- Contact:
Re: IR Sensor on Raspberry Pi 3
I think it worked now
Is this right?
Play Button
EV_KEY KEY_PLAYPAUSE 1 /dev/input/event0
# KEY_PLAYPAUSE 1 command
EV_KEY KEY_PLAYPAUSE 0 /dev/input/event0
# KEY_PLAYPAUSE 0 command
Pause Button
EV_KEY KEY_PLAYPAUSE 1 /dev/input/event0
# KEY_PLAYPAUSE 1 command
EV_KEY KEY_PLAYPAUSE 0 /dev/input/event0
# KEY_PLAYPAUSE 0 command
Stop Button
EV_KEY KEY_X 1 /dev/input/event0
# KEY_X 1 command
EV_KEY KEY_X 0 /dev/input/event0
# KEY_X 0 command
Is this right?
Play Button
EV_KEY KEY_PLAYPAUSE 1 /dev/input/event0
# KEY_PLAYPAUSE 1 command
EV_KEY KEY_PLAYPAUSE 0 /dev/input/event0
# KEY_PLAYPAUSE 0 command
Pause Button
EV_KEY KEY_PLAYPAUSE 1 /dev/input/event0
# KEY_PLAYPAUSE 1 command
EV_KEY KEY_PLAYPAUSE 0 /dev/input/event0
# KEY_PLAYPAUSE 0 command
Stop Button
EV_KEY KEY_X 1 /dev/input/event0
# KEY_X 1 command
EV_KEY KEY_X 0 /dev/input/event0
# KEY_X 0 command
-
- Posts: 722
- Joined: Friday 02 October 2015 12:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Finland
- Contact:
Re: IR Sensor on Raspberry Pi 3
Well, in my Raspbian Wheezy it was running automatically by default, no need to install or do anything. Just check that you have a file called "triggerhappy" in /etc/init.d/ (check it e.g. by running cat /etc/init.d/triggerhappy - if you are running Jessie it might be something else). For testing purposes I used (http://manpages.ubuntu.com/manpages/tru ... thd.1.html) thd --dump /dev/input/event* which dumps all events processable by thd to the console (useful to find out the correct event name for a specific key). Some info also here: https://github.com/wertarbyte/triggerhappy. Both links contain examples of the .conf file as well.Harlov wrote:I thank you very much for this![]()
What I do not understand is how to start Trigger Happy (thd) .. I start it with
Example PUTTY?
Thanks again for your help
edit. just in case you don't have it, the content of the triggerhappy file in /etc/init.d/ is:
- Spoiler: show
-
- Posts: 722
- Joined: Friday 02 October 2015 12:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Finland
- Contact:
Re: IR Sensor on Raspberry Pi 3
Depends entirely on what you want to achieve and this I do not know...Harlov wrote:I think it worked now
Is this right?
....

Code: Select all
EV_KEY KEY_PLAYPAUSE 1 curl -s "http://url:port/json.htm?type=command¶m=switchlight&idx=IDXofNEOplug&switchcmd=On"
-
- Posts: 24
- Joined: Sunday 12 March 2017 1:19
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Sweden
- Contact:
Re: IR Sensor on Raspberry Pi 3
Thanks again for your help, I appreciate it
it looks like I've gotten it to work
then I have to create a new conf file for each button?
Have tried to think of where to save (play.conf) file somewhere
in which folder, I do not know where to place the conf file so domoticz can find it
it looks like I've gotten it to work
then I have to create a new conf file for each button?
Have tried to think of where to save (play.conf) file somewhere
in which folder, I do not know where to place the conf file so domoticz can find it
-
- Posts: 722
- Joined: Friday 02 October 2015 12:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Finland
- Contact:
Re: IR Sensor on Raspberry Pi 3
First of all, the .conf file is for triggerhappy, not Domoticz. It tells triggerhappy to listen for certain key (combination) and then perform an action if it catches one of them. You save them in /etc/triggerhappy/triggers.d/Harlov wrote:Thanks again for your help, I appreciate it
it looks like I've gotten it to work
then I have to create a new conf file for each button?
Have tried to think of where to save (play.conf) file somewhere
in which folder, I do not know where to place the conf file so domoticz can find it
And what comes to number of .conf files one is enough, you can list everything you need there. But if you want to categorise them somehow then maybe more than one file is in order. I put all my commands going towards Domoticz to one file (domoticz.conf) and then other commands for controlling my squeezebox players to another file (squeezebox.conf). But as mentioned, no matter if you use one file, two or 100

-
- Posts: 71
- Joined: Saturday 13 July 2013 2:45
- Target OS: Linux
- Domoticz version: 3.5877
- Location: Scotland
- Contact:
Re: IR Sensor on Raspberry Pi 3
Probably the important point here that OP might not realise - is that when you change a conf file - in order to test it works with trigger happy - you will need to restart trigger happy.
probably - "sudo /etc/init.d/triggerhappy restart"
probably - "sudo /etc/init.d/triggerhappy restart"
AEOTEC ZStick, 11 ZWave Nodes, RFXCOMM, 50ish Byron Sockets.. HE851 (PIR), 2x HE852 (DoorContact)
WS2300, CM180, CC128, 2xTHGR122NX, 2xPiZeroW w/DS18B20, 8Ch 1W Relay Board.
8 Panasonic IP Cams, 1 16ch CCTV DVR + 15 CCTV Cams
WS2300, CM180, CC128, 2xTHGR122NX, 2xPiZeroW w/DS18B20, 8Ch 1W Relay Board.
8 Panasonic IP Cams, 1 16ch CCTV DVR + 15 CCTV Cams
-
- Posts: 722
- Joined: Friday 02 October 2015 12:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Finland
- Contact:
Re: IR Sensor on Raspberry Pi 3
Excellent point which is often overlooked when testing new .conf setup!asjmcguire wrote:Probably the important point here that OP might not realise - is that when you change a conf file - in order to test it works with trigger happy - you will need to restart trigger happy.
probably - "sudo /etc/init.d/triggerhappy restart"

-
- Posts: 24
- Joined: Sunday 12 March 2017 1:19
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Sweden
- Contact:
Re: IR Sensor on Raspberry Pi 3
I can't seem to save config files in the root system (eg: /etc/triggerhappy/triggers.d/); it just says "permission denied" or the save option is blocked in the text editor.
-
- Posts: 722
- Joined: Friday 02 October 2015 12:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Finland
- Contact:
Re: IR Sensor on Raspberry Pi 3
Open some command line tool (e.g. telnet or something from the Raspbian desktop) and then "sudo nano /etc/triggerhappy/triggers.d/play.conf". Write or copy/paste the planned content and then close the nano editor by pressing CTRL+x (and press Y to save the file). Then reload Triggerhappy.Harlov wrote:I can't seem to save config files in the root system (eg: /etc/triggerhappy/triggers.d/); it just says "permission denied" or the save option is blocked in the text editor.
By the way, I though you were planning to buy some IR receiver, but I guess you already had one? Which type is it, some sort of media controls remote? That should work in similar way as I described my setup wit Flirc as long as the commands are recognized by Triggerhappy and based on the earlier posts (like "EV_KEY KEY_PLAYPAUSE") it seems they are...

-
- Posts: 24
- Joined: Sunday 12 March 2017 1:19
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Sweden
- Contact:
Re: IR Sensor on Raspberry Pi 3
I think I have got it working with savings in /etc/triggerhappy/triggers.d/ but when I need to type in Domoticz
EV_KEY KEY_PLAYPAUSE 1 curl -s "http://192.168.0.???:8080/json.htm?type ... t&idx=1=On"
EV_KEY KEY_PLAYPAUSE 1 curl -s "http://192.168.0.???:8080/json.htm?type ... &idx=1=Off"
I get the error message in Domoticz saying Invalid ON Action!
Of course I have changed the IP ich idx
Yes i have Flirc Ir
EV_KEY KEY_PLAYPAUSE 1 curl -s "http://192.168.0.???:8080/json.htm?type ... t&idx=1=On"
EV_KEY KEY_PLAYPAUSE 1 curl -s "http://192.168.0.???:8080/json.htm?type ... &idx=1=Off"
I get the error message in Domoticz saying Invalid ON Action!
Of course I have changed the IP ich idx
Yes i have Flirc Ir
Last edited by Harlov on Tuesday 14 March 2017 23:36, edited 3 times in total.
-
- Posts: 722
- Joined: Friday 02 October 2015 12:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Finland
- Contact:
Re: IR Sensor on Raspberry Pi 3
I would first verify it ( = http: // url: port / json.htm? Type = Command & param = Switch light & idx = IDXofNEOplug & switchcmd = On) works in the browser. I think it's case sensitive so the string you have there will not work like that but I'm not sure if you just wrote something there and have the correct format in the .conf file (there are also some extra spaces on your example but perhaps those are because of some copy/paste issue?Harlov wrote:I think I have got it working with savings in /etc/triggerhappy/triggers.d/ but when I need to type in Domoticz
EV_KEY KEY_PLAYPAUSE 1 curl -s "http: // url: port / json.htm? Type = Command & param = Switch light & idx = IDXofNEOplug & switchcmd = On"
I get the error message in Domoticz saying Invalid ON Action!
Of course I have changed the IP ich idx

It could also be security (disable authentication on local network), protected switch or something like that. Check the correct json syntax here: https://www.domoticz.com/wiki/Domoticz_ ... Fswitch_on
edit: I see you edited the post but the syntax is still wrong. Should be something like:
Code: Select all
http://192.168.0.???:8080/json.htm?type=command¶m=switchlight&idx=1&switchcmd=On
-
- Posts: 722
- Joined: Friday 02 October 2015 12:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Finland
- Contact:
Re: IR Sensor on Raspberry Pi 3
This I don't quite get. You should not be typing anything in Domoticz (not sure though if I understand the sentence correctlyHarlov wrote:...but when I need to type in Domoticz...

Also, why are you trying to link both On and Off to same ir command?Harlov wrote: EV_KEY KEY_PLAYPAUSE 1 curl -s "http://192.168.0.???:8080/json.htm?type ... t&idx=1=On"
EV_KEY KEY_PLAYPAUSE 1 curl -s "http://192.168.0.???:8080/json.htm?type ... &idx=1=Off"

Who is online
Users browsing this forum: No registered users and 1 guest