User:Martinus/IR Gateway

From Let's Control It
Jump to navigation Jump to search
IR Gateway

Introduction

User-Martinus-IR Gateway.JPG

This small box has been my IR gateway for many years and it will likely serve many years to come. It started out using Nodo firmware (the ESP module socket wasn't there yet) but is has been replaced with a small RFLink edition that runs on Atmage328P. The ESP socket was added and it runs ESP Easy Mega edition.

The module has always worked autonomously so it does not depend on other controllers. It has always been rock solid stable and it controls several Kaku lights around my house.

It uses 3.5" jack plugs to connect two IR sensors that are located in other rooms (living and bedroom). These are the two jack connectors at the bottom side. The right side jack plug is for serial communications, for debugging or to upgrade the RFLink firmware when needed.

Hardware

  • Atmega 328P (but any Arduino Uno, Pro mini will also work)
  • IR receiver
  • 433MHz transmitter
  • ESP8266 ESP01 module (1MB Flash version)
  • Marmitek IR Control Pro 8 (used to distribute all IR traffic to several devices (DVD, PVR, HDMI switch)

User-Martinus-Marmitek.png

  • Logitech Harmony 650 (added the Kaku device)

User-Martinus-Harmony625.png

The Marmitek and Harmony are optional but very convenient. IR sensors are wired to livingroom and bedroom and all equipment is centralized in another room. Media output goes to HDMI switch and splitter so we can watch in more than one location.

Software

Configuration

RFLink

The RFLink firmware does not need any runtime config, but this configuration has been used to compile the firmware:

// ****************************************************************************************************************************************
// RFLink List of Plugins that have RECEIVE funcionality
// ****************************************************************************************************************************************

#define PLUGIN_003              // Kaku : Klik-Aan-Klik-Uit (with code wheel) aka ARC
#define PLUGIN_004              // NewKAKU : Klik-Aan-Klik-Uit with automatic coding aka Intertechno.
#define PLUGIN_015              // Home Easy EU 
#define PLUGIN_100              // DKW2012 weatherstation
#define PLUGIN_250
#define PLUGIN_251

// ****************************************************************************************************************************************
// RFLink List of Plugins that have TRANSMIT functionality
// ****************************************************************************************************************************************

#define PLUGIN_TX_003           // Kaku : Klik-Aan-Klik-Uit (with code wheel) aka ARC
#define PLUGIN_TX_004           // NewKAKU : Klik-Aan-Klik-Uit with automatic coding aka Intertechno.
#define PLUGIN_TX_250           // Addons for Nodo Small hardware boards
#define PLUGIN_TX_251           // Pulsecounter addon for Nodo Small hardware boards

ESP Easy

The ESP Easy module has only the Serial Server configure to listen to the serial output from the RFLink module. While another server could connect to the Serial Server, it is not in use. The Serial Server creates events that can be handled within the rule engine. The SerialSend command from the plugin can control the RFLink module.

User-Martinus SerialRFLinkConfig.png

Incoming events are to be treated as literal strings so these events are preceded with the '!' symbol. This means that the '=' symbol is ignored and the entire event can be used as a trigger.

In my case, the Logitech harmony emulates a Kaku transmitter on IR using the same protocol. So RFLink just thinks that is gets events from a real KAKU transmitter.

ESP Easy rules sample

on !RFLink#Kaku;ID=44;SWITCH=1;CMD=ON; do
  SerialSend 10;NewKaku;000001;2;2;
  delay 500
  SerialSend 10;NewKaku;000002;2;7;
  delay 500
  SerialSend 10;NewKaku;00000A;2;5;
endon

on !RFLink#Kaku;ID=44;SWITCH=2;CMD=ON; do
  SerialSend 10;NewKaku;000001;2;15;
  delay 500
  SerialSend 10;NewKaku;000002;2;15;
  delay 500
  SerialSend 10;NewKaku;00000A;2;8;
endon

on !RFLink#Kaku;ID=44;SWITCH=1;CMD=OFF; do
  SerialSend 10;NewKaku;000001;2;OFF;
  delay 500
  SerialSend 10;NewKaku;000002;2;OFF;
  delay 500
  SerialSend 10;NewKaku;00000A;2;OFF;
endon