more G-Labs products

Author Topic: ADD custom IR remote codes to HG database  (Read 3832 times)

August 31, 2014, 07:39:27 AM
Read 3832 times

MadHouse

  • *
  • Information
  • Newbie
  • Posts: 13
Hello guys,

i am trying to control my A/C trough HG linked with fibaro motion sensor/temperature, i am a total noob on this and i have been looking around the way to do it but could anyone tell me how to add a custom made remote code to the HG database so we can select it from the IR pop out menu?

Thanks

August 31, 2014, 06:49:02 PM
Reply #1

Jens

  • *****
  • Information
  • Global Moderator
  • Posts: 211
Hi MadHouse,

this is quite easy

- stop homegenie: sudo /etc/init.d/homegenie stop
- stop lirc: sudo service lirc stop
- the important file is /etc/lirc/lircd.conf
- now record your commands: sudo irrecord -n -d /dev/lirc0 mycommands
- once you're done copy the content of my commands into lircd.conf (or rename my commands to it)
- if you want to include more than one remote you have to add the part from begin remote until end remote (including these statements) into lircd.conf for each remote
- restart lirc: sudo service lirc restart
- start homegenie: sudo /etc/init.d/homegenie start
- enable lirc in interfaces (do not try to add another remote! via homegenie settings)
- sometimes you have to: sudo reboot the box

You have to have an ir receiver and sender connected to homegenie (in my example via GPIO Pins). In wizard scripts you can capture now with the original remote the program instructions for IRsend.

Regards
Jens


August 31, 2014, 10:41:06 PM
Reply #2

MadHouse

  • *
  • Information
  • Newbie
  • Posts: 13
Ok, Thanks a lot Jens, very well explained, i will test and let you know.

Anyhow why is that i shouldn´t try to add another remote via homegenie settings?

Regards.

September 01, 2014, 07:07:36 AM
Reply #3

Jens

  • *****
  • Information
  • Global Moderator
  • Posts: 211
This is because HG thinks it knows the content from lircd.conf. If you add a remote via HG and delete it afterwards HG erases the complete lirc config file as it thinks it has to. At least this was my experience, that I could screw up the config this way if it is not complete under HGs control.

BTW, instead of using capture, you can also specify the IR command to be sent by entering remotename/remotebutton in the wizard script popup window for commands to be sent.
« Last Edit: September 01, 2014, 07:13:08 AM by Jens »

September 03, 2014, 06:46:50 PM
Reply #4

MadHouse

  • *
  • Information
  • Newbie
  • Posts: 13
Ok, seems to be more complicated that i thought, first of all because the remote pulses that are being send by the A/C are not the usual ones like any TV,VCR,DVD....

I had to use mode2 to capture RAW data and then convert and create to have a proper conf file, which by the way i think i did already but can not test it because i do not know why HG is not sending any IR codes, no matter what i do.

i have try several ways, until i realize that it is not sending any IR at all, receiving is ok, HG captures all the comands whitout a problem but even if i select the LIRC remote control from the pop up configuration the "transmision" of any IR codes are not working.

would you have any clue why could be causing the problem?

thanks for the help Jens

September 03, 2014, 09:48:41 PM
Reply #5

Jens

  • *****
  • Information
  • Global Moderator
  • Posts: 211
Are you running HG on raspian?
- there was a timing bug for lirc in a previous version (have to dig it up), so you have to have a recent build, mine is 3.12.26+

Are you able to send IR commands from OS level?
- irsend send_once <name of the remote> <remote command>
- e.g. irsend send_once TV ON (like recorded for lircd.conf)

Sure that no commands are sent and not a wrong code is sent?
- check it with a digital camera and you can see the code interval during the irsend command if there is anything beeing sent at all

Right version of HG?
- i know for sure that 372 is working fine, later we had a bug and 411 is working fine again

I had success with raw data as well without any conversion after having the recent version of raspian installed.

Hope that helps

September 04, 2014, 09:20:28 PM
Reply #6

MadHouse

  • *
  • Information
  • Newbie
  • Posts: 13
Hi Jens,

- yes, I am running HG on Raspbian last image build for Raspberry Pi

- No, i am not able to send commands from OS level
     first i do:   
pi@raspberrypi ~ $ irsend LIST "" ""
irsend: Samsung_AA59-00382A

pi@raspberrypi ~ $ irsend LIST Samsung_AA59-00382A ""
irsend: 00000000000040bf KEY_POWER

pi@raspberrypi ~ $ irsend send_once Samsung_AA59-00382A KEY_POWER

and no commands are send.

- i check with a digital camera and nothing, no blink

- version of HG is Raspberry Pi 411 image downloaded from website.


i think my problem is the GPIO PINs, i bought the rpi with a housing including fan and ir sensor,

On etc/modules i see:

snd-bcm2835
lirc_rpi gpio_in_pin=18 gpio_out_pin=17

 i just open it up and i saw the pins used for the IR sensor are the pin 18, the pin 9 from bottom (3,3v) and last pin Ground, so pin 18 is there and is the IN that is why receiving is working but there is no pin 17 conected for the out.

i will try to play around with the pins to see what i get, any sugestions?

September 04, 2014, 10:01:35 PM
Reply #7

Jens

  • *****
  • Information
  • Global Moderator
  • Posts: 211
If you do not have an IR transmitter how should it work? ;-)

You cannot just change pins, the IR receiver needs +/-/data you need to connect an IR Diode to the GPIO Pin via a transistor as driver.

I am not aware of any module which is IR receiver and sender in one

Regards
Jens



September 08, 2014, 09:30:14 PM
Reply #8

MadHouse

  • *
  • Information
  • Newbie
  • Posts: 13
Hahahahah  :o  :o  :o , you are absolutely right Jens, i do not know why but i thought that they were the same until i read a little bit more. Anyway IR emitters on the way.!!

I will let you know when i got them here which by the way it will take a while :(

cheers

September 09, 2014, 05:32:51 AM
Reply #9

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I'm pretty sure Radio Shack carried an IR transceiver.  But, maybe since they really only sell phones these days they stopped carrying them.