IR Sender/Receiver built, now what?

Moderator: leecollings

ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

IR Sender/Receiver built, now what?

Post by ThinkPad »

I received the IR Sender/receiver parts (€1,92) today so i could built the MySensors IR thingy: http://www.mysensors.org/build/ir
Quickly connected the receiver to my Arduino and pointed my TV remote (Samsung) at it... it seems to work:

Code: Select all

send: 2-2-0-0 s=3,c=0,t=3,pt=0,l=0,sg=0,st=ok:
Decoded NECx: Value:E0E040BF (32 bits)
Raw samples(68): Gap:54250
  Head: m4400  s4500
0:m500 s1700	1:m550 s1700		 2:m500 s1700	3:m500 s600		 
4:m500 s650	5:m500 s600		 6:m500 s600	7:m500 s600		 
8:m500 s1750	9:m500 s1700		 10:m500 s1700	11:m500 s600		 
12:m500 s650	13:m500 s600		 14:m500 s600	15:m500 s600		 

16:m500 s600	17:m500 s1750		 18:m500 s600	19:m500 s600		 
20:m500 s600	21:m450 s650		 22:m550 s600	23:m500 s600		 
24:m500 s1700	25:m500 s600		 26:m500 s1750	27:m500 s1700		 
28:m500 s1750	29:m500 s1700		 30:m500 s1700	31:m500 s1750		 

32:m500
Extent=60450
Mark  min:450	 max:550
Space min:600	 max:1750

send: 2-2-0-0 s=3,c=1,t=24,pt=0,l=8,sg=0,st=ok:e0e040bf
Decoded Unknown: Value:0 (0 bits)
Raw samples(68): Gap:46650
  Head: m4400  s4500
0:m400 s1800	1:m450 s1750		 2:m450 s1800	3:m400 s700		 
4:m500 s600	5:m450 s650		 6:m500 s600	7:m450 s700		 
8:m500 s1700	9:m450 s1750		 10:m500 s1750	11:m400 s700		 
12:m500 s600	13:m500 s600		 14:m500 s650	15:m400 s700		 

16:m500 s600	17:m450 s1750		 18:m500 s600	19:m500 s650		 
20:m400 s700	21:m500 s600		 22:m450 s650	23:m500 s600		 
24:m450 s1800	25:m400 s700		 26:m500 s1700	27:m500 s1750		 
28:m500 s1700	29:m500 s1700		 30:m500 s1750	31:m500 s1700		 

32:m500
Extent=60400
Mark  min:400	 max:500
Space min:600	 max:1800

send: 2-2-0-0 s=3,c=1,t=24,pt=0,l=8,sg=0,st=ok:00000000
(Red powerbutton on the remote). Cool part is that it seems to be a wider used format, if i search for E0E040BF on Google i find more pages that talk about "Samsung" and "powerbutton" :mrgreen:

Haven't tried the sending part yet, don't know how to use that.

But now the question: can this be linked to Domoticz? It would be cool to 'learn' switches to an IR-command just like with the RFXCOM....
Will this become the killer device for already existing IR blasters?

Let me know if i can help in any way...
I am not active on this forum anymore.
User avatar
gizmocuz
Posts: 2394
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: IR Sender/Receiver built, now what?

Post by gizmocuz »

As you see, you got 68 pulses.
My remote for a HVAC has 149 pulses.

one way of doing it (as also shown by the example code), is to present light switches to the gateway.

the gateway/domoticz can send a switch command (on/off), the sketch picks this up, and sends an IR command

what i did is record the raw pulses, made a new sketch, added the pulses as arrays, and depending on what switch command is received i send the right pulses

for known protocols like

irsend.send(NEC, 0x1EE17887, 32);

you could present a switch with that ID

but most/not all protocols are known and you have to work with large pulse arrays

Sending back/forth 150 pulses to/from the node over wifi will not work, or is very slow.

One option is maybe to connect and sd card to the node, so it can read/write the pulses
Quality outlives Quantity!
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

Re: IR Sender/Receiver built, now what?

Post by ThinkPad »

That's too bad, didn't expect that IR could have more bandwith than 2,4Ghz of nRF24 can handle.....
I would have expected an easier implementation :p
I am not active on this forum anymore.
Justintime
Posts: 228
Joined: Thursday 21 May 2015 9:08
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: IR Sender/Receiver built, now what?

Post by Justintime »

Indeed too bad.
I was also hoping that this node could replace my JB light manager.
But if you add a sd card to the node. He still have to send those pulses. Or do you mean the Array command?
Let's hope someone could manage to get that working would be great to Integrate with the Harmony.
Justintime
Posts: 228
Joined: Thursday 21 May 2015 9:08
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: IR Sender/Receiver built, now what?

Post by Justintime »

To come back at this.... You said back and forth is to heavy.

But what if you only want to receive the ir signals of the remote and control switches in Domoticz. So no blast from the Transmitter.

That would be great... i think that's the way it's working on the Vera controller?

Is there any way to control Domoticz with an IR remote?
User avatar
gizmocuz
Posts: 2394
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: IR Sender/Receiver built, now what?

Post by gizmocuz »

One thing you can do, if you receive an IR message, is to send it as a Light switch with the IR ID?

At the moment i am waiting for an Ethernet shield for the arduino uno. (with SD card)

I then will try to make a full sketch for arduino (outside of mysensors, with a Ethernet protocol/communication),
that is able to learn/delete/send raw signals, so 'any' remote control message will work.

one problem to overcome is that sometimes you want an On and Off action, on a remote this is most times one button,
but are actually 2 commands, the easiest way of course is to create 2 devices, but probably i will make a learn function for On and Off,
so we could use a normal switch in domoticz.
For other IR commands, they will have to be push buttons to send the commands from domoticz -> IR
Of course you could learn the code to a scene/group
Quality outlives Quantity!
Justintime
Posts: 228
Joined: Thursday 21 May 2015 9:08
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: IR Sender/Receiver built, now what?

Post by Justintime »

gizmocuz wrote:One thing you can do, if you receive an IR message, is to send it as a Light switch with the IR ID?

At the moment i am waiting for an Ethernet shield for the arduino uno. (with SD card)

I then will try to make a full sketch for arduino (outside of mysensors, with a Ethernet protocol/communication),
that is able to learn/delete/send raw signals, so 'any' remote control message will work.

one problem to overcome is that sometimes you want an On and Off action, on a remote this is most times one button,
but are actually 2 commands, the easiest way of course is to create 2 devices, but probably i will make a learn function for On and Off,
so we could use a normal switch in domoticz.
For other IR commands, they will have to be push buttons to send the commands from domoticz -> IR
Of course you could learn the code to a scene/group
I saw the switch indeed.
The only remote which gives a recognized command is my Onkyo receiver and even then sometimes it will send "000000" very strange. I uploaded the recognized code in the arduino (not raw) and the switch doesn't respond.

Panasonic and LG only gives raw. And an old vcr JVC remote also.

But the solution you offer would be great!! Recording the raw commands.
I have an Ethernet shield under dust. So I am all prepared.

I will follow this thread closely. Image
User avatar
gizmocuz
Posts: 2394
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: IR Sender/Receiver built, now what?

Post by gizmocuz »

Arduino Uno

http://www.aliexpress.com/item/Free-shi ... 97946.html

Shields (2x)

http://www.aliexpress.com/item/2PCS-LOT ... 41389.html

Amazing prices... ;)

Hope they arrive soon...

I have also ordered a IR receiver/transmitter as a package, they might work, but at the moment i have this one working for my airco

https://www.cooking-hacks.com/hvac-ir-r ... spberry-pi

maybe the normal IR receiver/transmitter would also work

i based my code on the expensive one (recorded raw, made this in to a c++ array, and using a sketch that sends the raw commands)
This was the first one that could actually learn my AC, but i had to modify the amount of max. raw pulses to 180 (mine has 149)

bdw.. the range from the above expensive one was... not good... i had to duck-tape my arduino uno to the wall, at a maximum range of 2 meters
Quality outlives Quantity!
Justintime
Posts: 228
Joined: Thursday 21 May 2015 9:08
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: IR Sender/Receiver built, now what?

Post by Justintime »

gizmocuz wrote:Arduino Uno

http://www.aliexpress.com/item/Free-shi ... 97946.html

Shields (2x)

http://www.aliexpress.com/item/2PCS-LOT ... 41389.html

Amazing prices... ;)

Hope they arrive soon...

I have also ordered a IR receiver/transmitter as a package, they might work, but at the moment i have this one working for my airco

https://www.cooking-hacks.com/hvac-ir-r ... spberry-pi

maybe the normal IR receiver/transmitter would also work

i based my code on the expensive one (recorded raw, made this in to a c++ array, and using a sketch that sends the raw commands)
This was the first one that could actually learn my AC, but i had to modify the amount of max. raw pulses to 180 (mine has 149)

bdw.. the range from the above expensive one was... not good... i had to duck-tape my arduino uno to the wall, at a maximum range of 2 meters

WOW thats an expensive IR module. Are those HVAC commands so special then?

I just tested the range of the Arduino receiver. And the data receive led on the PCB is still blinking at 10 meters. So the range is great.

And Aliexpress is my favorite store... ;) They only test your patience with each order.
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

Re: IR Sender/Receiver built, now what?

Post by ThinkPad »

The expensive board doesn't look so special to me actually.... besides the IR transmitter and receiver it doesn't contain any special chips or so, just a bunch of capacitors and some power regulation things or so.
It is also 38khz just like the other one from AliExpress.

But it sounds very interesting what you are up to gizmocuz!
I am not active on this forum anymore.
Timdgr
Posts: 19
Joined: Tuesday 24 March 2015 8:26
Target OS: -
Domoticz version:
Contact:

Re: IR Sender/Receiver built, now what?

Post by Timdgr »

I would also like to have an IR receiver in the living room so I can use my Harmony with Domoticz. I use to have a "Nodo" (http://www.nodo-domotica.nl) where the unit could receive IR commands and then turn on the KAKU receivers through 433MHz transmitter. Would be nice to be able to do the same with Domoticz.

But my RaspberryPi is not in the living room, so how to get the IR data from the living room to the RPI so that I can turn on the lights?
Are you guys sure that this can't be done with Wifi like the ESP module. That would be cheap and small, easy to stuff away somewhere next to the television...
User avatar
gizmocuz
Posts: 2394
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: IR Sender/Receiver built, now what?

Post by gizmocuz »

better to make a code patch, so the domoticz switches will be available in the harmony?
maybe simulate a certain bridge ?
Quality outlives Quantity!
Timdgr
Posts: 19
Joined: Tuesday 24 March 2015 8:26
Target OS: -
Domoticz version:
Contact:

Re: IR Sender/Receiver built, now what?

Post by Timdgr »

gizmocuz wrote:better to make a code patch, so the domoticz switches will be available in the harmony?
maybe simulate a certain bridge ?
Could you please explain this in more detail, because I can't understand what you're trying to say.
And by 'code patch' you mean 'programming'? Unfortunately that's not a competency that I have mastered up to now...

One thing I have tried is to have Domoticz receive some 'bogus' kaku commands from the Nodo and then have Domoticz switch the actual kaku receiver. Kind a weird way of working...

And I had planned to drop the Nodo stuff since this project lacks development. (wiki and forum looks rather abandoned...) Lot of people moved towards Domoticz...
User avatar
gizmocuz
Posts: 2394
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: IR Sender/Receiver built, now what?

Post by gizmocuz »

what domoticz hardware is supported for the harmony ?
If you found one, then we should try to emulate this
Programming is not an option? but mysensors is?
I think this is c programming also ;) This is an open source project, and needs volunteers
Quality outlives Quantity!
Justintime
Posts: 228
Joined: Thursday 21 May 2015 9:08
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: IR Sender/Receiver built, now what?

Post by Justintime »

Timdgr wrote:
gizmocuz wrote:better to make a code patch, so the domoticz switches will be available in the harmony?
maybe simulate a certain bridge ?
Could you please explain this in more detail, because I can't understand what you're trying to say.
And by 'code patch' you mean 'programming'? Unfortunately that's not a competency that I have mastered up to now...

One thing I have tried is to have Domoticz receive some 'bogus' kaku commands from the Nodo and then have Domoticz switch the actual kaku receiver. Kind a weird way of working...

And I had planned to drop the Nodo stuff since this project lacks development. (wiki and forum looks rather abandoned...) Lot of people moved towards Domoticz...
Just have patience. As you maybe have read Gizmocuz is going to implent this in Domoticz. Install Mysensors hardware ( a gateway and an IR/send receive module) and you are half way there.

Then you can take any device in Harmony to learn the codes to Domoticz.

Regards,

An old Nodo user ;)
User avatar
gizmocuz
Posts: 2394
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: IR Sender/Receiver built, now what?

Post by gizmocuz »

hope to receive the 'goods' next week ;) but i do not think this is going to be mysensors project, but a direct communication on ethernet/serial
(because we also need the sd card for the large raw data pulses)
Quality outlives Quantity!
Justintime
Posts: 228
Joined: Thursday 21 May 2015 9:08
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: IR Sender/Receiver built, now what?

Post by Justintime »

gizmocuz wrote:hope to receive the 'goods' next week ;) but i do not think this is going to be mysensors project, but a direct communication on ethernet/serial
(because we also need the sd card for the large raw data pulses)
Ow okay..... i am updated. The Ethernet cable is in the same cabinet where the IR blaster of Harmony is. So still a great solution.

But Tim if you are a new Domoticz user, Mysensors.org is a great project to look in to anyway.

Sidenote:

Harmony is planning to introduce a Zwave addon module. But this way would be much cheaper. ;)
flwvanes
Posts: 7
Joined: Saturday 07 March 2015 10:54
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: IR Sender/Receiver built, now what?

Post by flwvanes »

Hi all,

I have a MySensors IR receiver in combination with domoticz running for some months now and is working perfect for my needs.

I am using the X10 IR codes (because I found a library on the internet to decode the X10 IR codes with an arduino) which I can send via my Harmony remote control.
In domoticz I have defined 16 switches which are controlled by the MySensors sketch.....quite easy but it does the trick for me ;-)

I have included the sketch, the link to the library I could not find anymore but if you are interested in the X10 library please send me a PM.

Greetings Frank

Code: Select all

// Example sketch showing how to control ir devices
// An IR LED must be connected to Arduino PWM pin 3.
// An optional ir receiver can be connected to PWM pin 8. 
// All receied ir signals will be sent to gateway device stored in VAR_1.
// When binary light on is clicked - sketch will send volume up ir command
// When binary light off is clicked - sketch will send volume down ir command

#include <MySensor.h>
#include <SPI.h>
#include <X10ex.h>
#include <X10ir.h>

// X10 Infrared Receiver Library
X10ir x10ir = X10ir(
  1, // Receive Interrupt Number (1 = Standard Arduino External Interrupt)
  3, // Receive Interrupt Pin (Pin 3 must be used with interrupt 1)
  'A', // Default House Code
  infraredEvent // Event triggered when IR message is received
);

#define LED_PIN 4

MySensor gw;
MyMessage msg(0,V_LIGHT);

#define MAX_BTN 16
boolean last_state[MAX_BTN];
int send_btn;



void setup()  
{  
  x10ir.begin();


  gw.begin(incomingMessage);

  // Send the sketch version information to the gateway and Controller
  gw.sendSketchInfo("IR Sensor", "1.1");


  // Register a sensors to gw. Use binary light for test purposes.
  for (int i=0; i<MAX_BTN; i++) 
  {   
     gw.present(i, S_LIGHT);
  }

  pinMode(LED_PIN, OUTPUT); 
  digitalWrite(LED_PIN, 0);

}


void loop() 
{
  gw.process();
  
    //If IR code received
    if(send_btn > 0)
    {
      digitalWrite(LED_PIN, 1);
    
      if(last_state[send_btn-1])
      {  
          Serial.print("IR ");
          Serial.print(send_btn-1);
          Serial.println(" --> Off"); 
          gw.send(msg.setSensor(send_btn-1).set(0));
          last_state[send_btn-1] = 0;
      } 
      else
      {
          Serial.print("IR ");
          Serial.print(send_btn-1);
          Serial.println(" --> On"); 
          gw.send(msg.setSensor(send_btn-1).set(1));
          last_state[send_btn-1] = 1;
      }
      send_btn = 0;
      delay(300);      
      digitalWrite(LED_PIN, 0);
    }
}



void incomingMessage(const MyMessage &message) 
{

  Serial.println("Received from Domoticz");
  // We only expect one type of message from controller. But we better check anyway.
  if (message.type==V_LIGHT) 
  {
      digitalWrite(LED_PIN, 1);

      if(message.sensor<16)
      {
        last_state[message.sensor] = message.getInt();
      }
      delay(100);      
      digitalWrite(LED_PIN, 0);
  }
}
    



// Process commands received from X10 compatible IR remote
void infraredEvent(char house, byte unit, byte command, bool isRepeat)
{
    if(!isRepeat)
    {
      Serial.println(command);
      // Handle Address Command (House + Unit)
      if(command == CMD_ADDRESS)
      {
        Serial.println("cmd == CMD_ADDRESS");
        Serial.println(house);
        Serial.println(unit);
        Serial.println(command);
        
        if(unit <= 16)
        {
           Serial.println("Switch...");
          send_btn = unit;        
        }      
      }
    }
}
flwvanes
Posts: 7
Joined: Saturday 07 March 2015 10:54
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: IR Sender/Receiver built, now what?

Post by flwvanes »

I found the library, thanks to google ;-)

https://github.com/DougC/arduino-x10

Sorry link is from a different library, but is not the one I had used :oops:
Send me an PM if you need X10 library I had used.
Last edited by flwvanes on Tuesday 25 August 2015 20:52, edited 1 time in total.
Justintime
Posts: 228
Joined: Thursday 21 May 2015 9:08
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: IR Sender/Receiver built, now what?

Post by Justintime »

Thanks... I will try this out. Does every command make a new virtual device/switch in Domoticz?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests