All Projects → piotrC4 → Mqtt Ir Transceiver

piotrC4 / Mqtt Ir Transceiver

ESP8266 based bidirectional bridge between MQTT and IR (change MQTT message to IR signal and change received IR signal to MQTT message)

Projects that are alternatives of or similar to Mqtt Ir Transceiver

Heatpump
Arduino library to control Mitsubishi Heat Pumps via connector cn105
Stars: ✭ 327 (+151.54%)
Mutual labels:  openhab, mqtt, esp8266
SuperLEDstrip
No description or website provided.
Stars: ✭ 13 (-90%)
Mutual labels:  mqtt, esp8266, openhab
Mhi Ac Ctrl
Reads and writes data (e.g. power, mode, fan status etc.) from/to a Mitsubishi Heavy Industries (MHI) air conditioner (AC) via SPI controlled by MQTT
Stars: ✭ 64 (-50.77%)
Mutual labels:  mqtt, esp8266
Blinker Library
An IoT Solution,Blinker library for embedded hardware. Works with Arduino, ESP8266, ESP32.
Stars: ✭ 1,095 (+742.31%)
Mutual labels:  mqtt, esp8266
Hugo Esp8266
Hugo is a 4-button ESP8266 Wi-Fi Remote, Arduino compatible and simple to use.
Stars: ✭ 77 (-40.77%)
Mutual labels:  mqtt, esp8266
Esp mqtt
MQTT client library for ESP8266
Stars: ✭ 1,047 (+705.38%)
Mutual labels:  mqtt, esp8266
Homeautomation.codesys3
Home Automation system build in CoDeSys 3 with MQTT communication to any third party Home Automation software
Stars: ✭ 55 (-57.69%)
Mutual labels:  openhab, mqtt
Tinygsm
A small Arduino library for GSM modules, that just works
Stars: ✭ 1,186 (+812.31%)
Mutual labels:  mqtt, esp8266
Smarthome
💡 智能电器管理综合系统
Stars: ✭ 33 (-74.62%)
Mutual labels:  mqtt, esp8266
Awtrix1.0
(Outdated) Smart RGB Matrix Clock
Stars: ✭ 99 (-23.85%)
Mutual labels:  mqtt, esp8266
Homie Esp8266
💡 ESP8266 framework for Homie, a lightweight MQTT convention for the IoT
Stars: ✭ 1,241 (+854.62%)
Mutual labels:  mqtt, esp8266
Coogleiot
A ESP8266 Library for easy IOT device development
Stars: ✭ 118 (-9.23%)
Mutual labels:  mqtt, esp8266
Wavin Ahc 9000 Mqtt
Esp8266 mqtt interface for Wavin AHC-9000/Jablotron AC-116
Stars: ✭ 47 (-63.85%)
Mutual labels:  mqtt, esp8266
Hass Yaap
Yet another alarm (control) panel for Home Assistant.
Stars: ✭ 44 (-66.15%)
Mutual labels:  mqtt, esp8266
Pysmartnode
Micropython Smarthome framework
Stars: ✭ 58 (-55.38%)
Mutual labels:  mqtt, esp8266
Mclighting
The ESP8266 based multi-client lighting gadget
Stars: ✭ 977 (+651.54%)
Mutual labels:  mqtt, esp8266
Espuino
RFID-controlled musicplayer powered by ESP32
Stars: ✭ 71 (-45.38%)
Mutual labels:  openhab, mqtt
Mqtt433gateway
MQTT 433.92 MHz radio-frequency device gateway
Stars: ✭ 111 (-14.62%)
Mutual labels:  mqtt, esp8266
Mqtt via esp01
TCP/UDP Applicaton for UNO/MEGA/STM32 using ESP8266's AT firmware.
Stars: ✭ 23 (-82.31%)
Mutual labels:  mqtt, esp8266
Smarthome
SmartHome: firmware per ESP8266 - Casa domotica
Stars: ✭ 28 (-78.46%)
Mutual labels:  mqtt, esp8266

MQTT IR transceiver

ESP8266 based gateway between MQTT and IR. Code compatible with PlatformIO. Works with ESP-01 (debug mode have to be disabled in globals.h)

Features

  • Receiving of IR transmission and publish it as MQTT messages
  • Receive MQTT messages and send IR signal (multiple formats supported - NEC, RC5, LG, SONY, Global Cache )
  • Storing raw IR messages on flash and transmitting via IR
  • Constant current IR LED emitter circuit (based on Analysir schematic )
  • MQTT over SSL support
  • OTA updates

Working modes

IR transmitting

alt text

IR receiving

alt text

Used librariers

Installation

GPIO connections:

GPIO WEMOS GPIO ESP01 Usage
13 0 IR receiver
14 3 (Uart RX) IR LED - connected via simple transistor amplifier
15 (to +3,3V) 2 (to GND) Button - used for reset configuration
2 (Wemos buildin) not used LED

For ESP01 following changes have to take place:

  • in platformio.ini change board from d1_mini to esp01_1m
  • in globals.h comment out line "#define DEBUG X"

Schematic

alt text

BOM

  • D1,D2 - 1N4148
  • Q1 - NPN transistor
  • IR1 - IR receiver
  • IR LED1, IR LED2 - Infrared LED
  • R1 - 3.3kΩ
  • R2 - 2.5Ω

Requirements:

1. Clone the Repository into VS Code

In VS Code press F1 enter ''git: clone'' + Enter and insert link to my repository (https://github.com/piotrC4/mqtt-ir-transceiver)

2. Modify platformio.ini (optional)

Edit platformio.ini and setup upload_port variable acording to system settings if PlatofmIO can'd identify proper COM port

3. Build binary file

In PlatformIO menu choose PROJECT TASKS -> Build

4. Upload firmware to ESP8266

Connect ESP to PC via serial adapter. In PlatformIO menu choose option PROJECT TASKS -> Upload.

Usage

Configuration

During first boot device will act as AP with SSID IRTRANS-XXXXXXXX (password is XXXXXXXX). Connect to this AP and go to http://192.168.4.1. Configure WIFI and MQTT paramters.

Resetting configuration

If during boot device have is pressed, device will go to configuration mode.

Controller → Device communication

Property Message format Description Example
_mqtt_prefix_/sender/storeRaw/_store_id_ \d+(,\d+) store raw codes sequence in slot no. _store_id_, last number is frequency in kHz Topic: "_mqtt_prefix_/sender/storeRaw/10"
Message: "11,43,54,65,32"
32 - is frequency in kHz
_mqtt_prefix_/sender/sendStoredRaw \d+ Transmit via IR RAW code from provided slot Topic: "_mqtt_prefix_/sender/sendStoredRaw"
Message: "1"
_mqtt_prefix_/sender/sendStoredRawSequence \d+(,\d+)* Transmit via IR sequence of RAW codes from provided slots Topic: "_mqtt_prefix_/sender/sendStoredRawSequence"
Message: "1,2,3"
_mqtt_prefix_/sender/cmd (ls|sysinfo) Execute on device command, replay in topic _mqtt_prefix_/sender/cmd/result Topic: "_mqtt_prefix_/sender/cmd"
Message: "sysinfo"
_mqtt_prefix_/sender/rawMode (1|ON|true|.*) Turn on/off reporting to controller received by device IR raw codes Topic: "_mqtt_prefix_/sender/rawMode"
Message: "1"
_mqtt_prefix_/wipe .* Wipe configuration for next boot Topic: "_mqtt_prefix_/wipe"
Message: "1"
_mqtt_prefix_/sender/(RC_5|RC_6|NEC|SAMSUNG|SONY|LG)/(\d+) \d+ Send IR signal based on type Topic: "esp8266/02sender/RC_5/12"
Message: "3294"
_mqtt_prefix_/sender/sendGC \d+(,\d+) Send Global Cache code Topic: "_mqtt_prefix_/sender/sendGC"
Message: "32000,43,54,65,32,...."
_mqtt_prefix_/sender/sendRAW \d+(,\d+) Send RAW code with given frequency Topic: "_mqtt_prefix_/sender/sendRAW"
Message: "9000,4550,550,600,600,600,...,32"
32 is frequency in kHz
_mqtt_prefix_/sender/otaURL .* Update via HTTP from URL Topic: "_mqtt_prefix_/sender/otaURL"
Message: "http://ota.server/firmware.bin"

Device → Controller communication

Property Message format Direction Example
_mqtt_prefix_/sender/cmd/result .* Result of command
_mqtt_prefix_/receiver/_type_/_bits_/_panas_addr_ \d+(,\d+)* Send to controller received IR code Topic: "_mqtt_prefix_/receiver/RC_5/12"
Message: "3294"
_mqtt_prefix_/receiver/raw \d+(,\d+)* Send to controller received RAW IR code (only when RAW mode is enabled) Topic: "_mqtt_prefix_/receiver/raw"
Message: "9000,4550,550,600,600,600,..."

Integration with OpenHab

  • Run MQTT server (mosquitto is fine)
  • Configure MQTT server for OpenHab transport
  • Register IR Transceiver to the same MQTT server (for example MQTT prefix is 'esp8266/02')
  • Example items configuration:
Group gIR <own_ir> (All)
Switch   ir_philips_on
        "Philips Power" <own_ir> (gIR)
        {mqtt=">[mosquitto:esp8266/02/sender/RC5/12:command:ON:56]", autoupdate="false"}
Switch   ir_philips_volp
        "Vol+"  <own_ir> (gIR)
        {mqtt=">[mosquitto:esp8266/02/sender/RC5/12:command:ON:1040]", autoupdate="false"}
Number ir_in_lg
        "LG IR command [%d]"    <own_ir> (gIR)
        {mqtt="<[mosquitto:esp8266/02/receiver/NEC/32:state:default]"}
Switch ir_adb_star
        "ADB 0" <own_ir) (gIR)
        {mqtt=">[mosquitto:esp8266/02/sender/sendGC:command:ON:38000,1,37,8,34,8,75,8,44,8,106,8,50,8,50,8,39,8,81,8,525,8,34,8,60,8,29,8,44,8,44,8,44,8,29,8,29,8,3058,8,34,8,75,8,44,8,106,8,50,8,50,8,39,8,81,8,525,8,34,8,101,8,70,8,44,8,44,8,44,8,29,8,29,8,3058]", autoupdate="false"}
  • Using in rules:
rule lgTVturnInfoScreen
when
        Item ir_in_lg received update 551549190
then
        // Do somenting after button press
end

rule initIRmodule
when
        System started
then
        // Turn off Philips after system start
        postUpdate(ir_philips_on,OFF)

        // Switch LG TV to HDMI 1 by Global Cache code
        publish("mosquitto","esp8266/02/sender/sendGC","38000,1,69,343,172,21,22,21,22,21,65,21,22,21,22,21,22,21,22,21,22,21,65,21,65,21,22,21,65,21,65,21,65,21,65,21,65,21,22,21,65,21,65,21,65,21,22,21,22,21,65,21,65,21,65,21,22,21,22,21,22,21,65,21,65,21,22,21,22,21,1673,343,86,21,3732")
end
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].