more G-Labs products

Author Topic: Lights IR remote controller module  (Read 1803 times)

June 20, 2015, 11:59:53 PM
Read 1803 times

amin

  • *
  • Information
  • Newbie
  • Posts: 3
Hi All,

I have wrote a small program which allows adding conditional IR code for Lights, Switches and Dimmers.
When you press the the assigned remote button it will turn on the light, and when you press again it will turn it off.
Also it lets you dim last light using Up/Down button which you can define in configuration.

Skip Command IR code is designed for disabling the next command and it is useful in case you just want to change the dimmer value.

I hope this is useful to everyone, and let me know if you have any suggestion
« Last Edit: June 22, 2015, 06:00:09 PM by amin »

June 22, 2015, 01:29:06 PM
Reply #1

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
This is something I wanted to have too :) Can I include this in HG?
I was wondering why are you checking the module address != "1001" in the code.
Does it referer to the program address itself?
Can it be changed with module.Address != Program.Module.Address then?
I am also planning to add a new feature field type called "capture" that will be a text field where you can specify what kind of parameter have to be captured and stored in the field (eg. "Receiver.RawData"). So the user will not have to type the IR code, but rather press the remote button to associate it to the IR toggle code field.
Thanks for sharing.

Cheers,
g.


June 22, 2015, 06:04:06 PM
Reply #2

amin

  • *
  • Information
  • Newbie
  • Posts: 3
Gene,

Yes please do include it in HG, it would be fantastic.
Thanks for reviewing the code.
The point you mentioned on module.Address is correct, and actually we can totally removed that condition. I have attached a new version to the original post without that condition which works just fine.
Adding a capture button would be great, I am new to HG so I was not sure how to do that, but if you can add that, it would be really useful.

Thanks
Amin

June 22, 2015, 11:42:40 PM
Reply #3

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Hi amin,

I added the capture field. It will be available with next hg update.
I also found out another issue in your program. It is missing the

Code: [Select]
Program.GoBackground();

instruction at the end of the program code.

Cheers,
g.

June 23, 2015, 01:03:22 PM
Reply #4

kevin1

  • *****
  • Information
  • Hero Member
  • Posts: 330
What type of lights are you using this with?  I have a couple led strips on top of our cabinets that use an IR remote, but the remote has to be aimed up towards the IR receiver near the ceiling.  I was wondering how do you locate an Arduino/Pi with IR transmitter near each light bulb(strip?)?

June 23, 2015, 02:16:43 PM
Reply #5

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
I would not suggest using IR I/O as a way to route commands from one point to another, unless they all are in sight from each other.

This is my setup:

- Z-Wave
- X-10
- Philips Hue
- TV, AC
- Some more "networked" things

all of these are controlled by two HG on RPi.
The first one is the main home automation controller with Z-Wave and X-10 interfaces and it's located in another room (the computer room).

http://www.homegenie.it/docs/diy/jeannie.php

The second one is this one:

http://www.homegenie.it/docs/diy/eden.php

and it is located in the living room and it has the IR transceiver, temperature and luminace sensor plus a numeric keypad that can be programmed just like your IR app.
Both are "Interconnected" and communicate each other via TCP/HTTP:

http://www.homegenie.it/docs/interconnecting.php

So, "Eden" is able to see and control by IR input or Keypad input any device in the house including the ones connected to "Jeannie".

I also have another Pi located in another room but it is currently "out of order":

http://www.homegenie.it/docs/diy/mirage.php

The IR transmitter of Eden has a action range of about 4-5 meters and this is only used for controlling TV or AC, anything else is controlled using networking.
So "Eden" act as a gateway between IR input and all other connected things.

g.