Files
OpenMQTTGateway/dev/use/ir.html
2025-12-17 00:48:08 +00:00

136 lines
37 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Infrared gateway | Theengs OpenMQTTGateway DEVELOPMENT SHA:e91086 TEST ONLY</title>
<meta name="generator" content="VuePress 1.9.10">
<link rel="apple-touch-icon" sizes="180x180" href=".apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/dev/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/dev/favicon-16x16.png">
<link rel="manifest" href="/dev/manifest.json">
<link rel="mask-icon" href="/dev/icons/safari-pinned-tab.svg" color="#3eaf7c">
<script type="module" src="https://unpkg.com/esp-web-tools@9.4.3/dist/web/install-button.js?module"></script>
<meta name="description" content="Unlock the potential of Infrared technology with our universal gateway. Decode signals from various devices, and integrate seamlessly with MQTT systems abd controllers like Home Assistant and OpenHAB.">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#3eaf7c">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="msapplication-TileImage" content="/favicon-144x144.png">
<meta name="msapplication-TileColor" content="#000000">
<link rel="preload" href="/dev/assets/css/0.styles.0f5b7756.css" as="style"><link rel="preload" href="/dev/assets/js/app.405a371d.js" as="script"><link rel="preload" href="/dev/assets/js/2.f90febc1.js" as="script"><link rel="preload" href="/dev/assets/js/1.848070c7.js" as="script"><link rel="preload" href="/dev/assets/js/46.a3d8b6f4.js" as="script"><link rel="prefetch" href="/dev/assets/js/10.c6fd02f2.js"><link rel="prefetch" href="/dev/assets/js/11.6556d787.js"><link rel="prefetch" href="/dev/assets/js/12.d5b3a47e.js"><link rel="prefetch" href="/dev/assets/js/13.ddbd1897.js"><link rel="prefetch" href="/dev/assets/js/14.286ec29b.js"><link rel="prefetch" href="/dev/assets/js/15.91304de5.js"><link rel="prefetch" href="/dev/assets/js/16.e4185a57.js"><link rel="prefetch" href="/dev/assets/js/17.923ad7c4.js"><link rel="prefetch" href="/dev/assets/js/18.42cba936.js"><link rel="prefetch" href="/dev/assets/js/19.71e6901b.js"><link rel="prefetch" href="/dev/assets/js/20.fbef6fa1.js"><link rel="prefetch" href="/dev/assets/js/21.0e500e6c.js"><link rel="prefetch" href="/dev/assets/js/22.1fa11360.js"><link rel="prefetch" href="/dev/assets/js/23.d5ff69ee.js"><link rel="prefetch" href="/dev/assets/js/24.23aa6c36.js"><link rel="prefetch" href="/dev/assets/js/25.3cdd6711.js"><link rel="prefetch" href="/dev/assets/js/26.8088da72.js"><link rel="prefetch" href="/dev/assets/js/27.8d8ada9a.js"><link rel="prefetch" href="/dev/assets/js/28.afe597be.js"><link rel="prefetch" href="/dev/assets/js/29.a6f3d105.js"><link rel="prefetch" href="/dev/assets/js/3.2fb8cc22.js"><link rel="prefetch" href="/dev/assets/js/30.a5f4568a.js"><link rel="prefetch" href="/dev/assets/js/31.7ec0b927.js"><link rel="prefetch" href="/dev/assets/js/32.bf6ed2d3.js"><link rel="prefetch" href="/dev/assets/js/33.d1f71bc6.js"><link rel="prefetch" href="/dev/assets/js/34.1144d4cf.js"><link rel="prefetch" href="/dev/assets/js/35.790d5635.js"><link rel="prefetch" href="/dev/assets/js/36.adfdf2f5.js"><link rel="prefetch" href="/dev/assets/js/37.2e8c2d14.js"><link rel="prefetch" href="/dev/assets/js/38.55a68009.js"><link rel="prefetch" href="/dev/assets/js/39.089b560c.js"><link rel="prefetch" href="/dev/assets/js/4.ee469e2f.js"><link rel="prefetch" href="/dev/assets/js/40.54f66a91.js"><link rel="prefetch" href="/dev/assets/js/41.c56bed06.js"><link rel="prefetch" href="/dev/assets/js/42.a8267a4e.js"><link rel="prefetch" href="/dev/assets/js/43.73d8f4d8.js"><link rel="prefetch" href="/dev/assets/js/44.790d8d70.js"><link rel="prefetch" href="/dev/assets/js/45.aa140053.js"><link rel="prefetch" href="/dev/assets/js/47.39d975c4.js"><link rel="prefetch" href="/dev/assets/js/48.bfb4afae.js"><link rel="prefetch" href="/dev/assets/js/49.be3c6616.js"><link rel="prefetch" href="/dev/assets/js/5.45a12acb.js"><link rel="prefetch" href="/dev/assets/js/50.df420363.js"><link rel="prefetch" href="/dev/assets/js/51.91585bcb.js"><link rel="prefetch" href="/dev/assets/js/52.0ad86cbd.js"><link rel="prefetch" href="/dev/assets/js/53.6344416c.js"><link rel="prefetch" href="/dev/assets/js/54.e0ceb1a4.js"><link rel="prefetch" href="/dev/assets/js/55.a83c3bcc.js"><link rel="prefetch" href="/dev/assets/js/56.b44366aa.js"><link rel="prefetch" href="/dev/assets/js/57.71ecb21f.js"><link rel="prefetch" href="/dev/assets/js/58.4d098c0a.js"><link rel="prefetch" href="/dev/assets/js/59.f844504f.js"><link rel="prefetch" href="/dev/assets/js/6.88e76e8e.js"><link rel="prefetch" href="/dev/assets/js/60.7e3979c2.js"><link rel="prefetch" href="/dev/assets/js/61.f40d9370.js"><link rel="prefetch" href="/dev/assets/js/62.b4395a3f.js"><link rel="prefetch" href="/dev/assets/js/63.118c24b3.js"><link rel="prefetch" href="/dev/assets/js/64.4b220d3f.js"><link rel="prefetch" href="/dev/assets/js/65.07ec10ed.js"><link rel="prefetch" href="/dev/assets/js/66.147c03e8.js"><link rel="prefetch" href="/dev/assets/js/67.0d566ba2.js"><link rel="prefetch" href="/dev/assets/js/7.747393f7.js"><link rel="prefetch" href="/dev/assets/js/vendors~docsearch.9de5652f.js">
<link rel="stylesheet" href="/dev/assets/css/0.styles.0f5b7756.css">
</head>
<body>
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/dev/" class="home-link router-link-active"><!----> <span class="site-name">Theengs OpenMQTTGateway DEVELOPMENT SHA:e91086 TEST ONLY</span></a> <div class="links"><!----> <nav class="nav-links can-hide"><div class="nav-item"><a href="https://www.theengs.io" target="_self" class="nav-link external">
Home
<!----></a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="Use cases" class="dropdown-title"><span class="title">Use cases</span> <span class="arrow down"></span></button> <button type="button" aria-label="Use cases" class="mobile-dropdown-title"><span class="title">Use cases</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="https://www.theengs.io/usecases/smarthome.html" target="_self" class="nav-link external">
Smart Home
<!----></a></li><li class="dropdown-item"><!----> <a href="https://www.theengs.io/usecases/iot.html" target="_self" class="nav-link external">
IoT
<!----></a></li><li class="dropdown-item"><!----> <a href="https://www.theengs.io/usecases/research.html" target="_self" class="nav-link external">
Research
<!----></a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="Solutions" class="dropdown-title"><span class="title">Solutions</span> <span class="arrow down"></span></button> <button type="button" aria-label="Solutions" class="mobile-dropdown-title"><span class="title">Solutions</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><h4>
Hardware
</h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="https://shop.theengs.io/products/theengs-plug-smart-plug-ble-gateway-and-energy-consumption" target="_self" class="nav-link external">
Theengs Plug
<!----></a></li><li class="dropdown-subitem"><a href="https://shop.theengs.io/products/theengs-bridge-esp32-ble-mqtt-gateway-with-ethernet-and-external-antenna" target="_self" class="nav-link external">
Theengs Bridge
<!----></a></li></ul></li><li class="dropdown-item"><h4>
Software
</h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="https://app.theengs.io" target="_self" class="nav-link external">
Mobile App
<!----></a></li><li class="dropdown-subitem"><a href="https://docs.openmqttgateway.com" target="_self" class="nav-link external">
OpenMQTTGateway
<!----></a></li><li class="dropdown-subitem"><a href="https://gateway.theengs.io" target="_self" class="nav-link external">
Gateway
<!----></a></li></ul></li><li class="dropdown-item"><h4>
Core
</h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="https://decoder.theengs.io" target="_self" class="nav-link external">
Decoder
<!----></a></li><li class="dropdown-subitem"><a href="https://parser.theengs.io" target="_self" class="nav-link external">
Web Parser
<!----></a></li></ul></li></ul></div></div><div class="nav-item"><a href="https://decoder.theengs.io/devices/devices.html" target="_self" class="nav-link external">
Compatible devices
<!----></a></div><div class="nav-item"><a href="https://community.openmqttgateway.com" target="_self" class="nav-link external">
Community
<!----></a></div><div class="nav-item"><a href="https://shop.theengs.io/" target="_self" class="nav-link external">
Shop
<!----></a></div><div class="nav-item"><a href="https://github.com/sponsors/theengs" target="_self" class="nav-link external">
Sponsor 🤍
<!----></a></div> <a href="https://github.com/1technophile/OpenMQTTGateway" target="_blank" rel="noopener noreferrer" class="repo-link">
GitHub
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="https://www.theengs.io" target="_self" class="nav-link external">
Home
<!----></a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="Use cases" class="dropdown-title"><span class="title">Use cases</span> <span class="arrow down"></span></button> <button type="button" aria-label="Use cases" class="mobile-dropdown-title"><span class="title">Use cases</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="https://www.theengs.io/usecases/smarthome.html" target="_self" class="nav-link external">
Smart Home
<!----></a></li><li class="dropdown-item"><!----> <a href="https://www.theengs.io/usecases/iot.html" target="_self" class="nav-link external">
IoT
<!----></a></li><li class="dropdown-item"><!----> <a href="https://www.theengs.io/usecases/research.html" target="_self" class="nav-link external">
Research
<!----></a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="Solutions" class="dropdown-title"><span class="title">Solutions</span> <span class="arrow down"></span></button> <button type="button" aria-label="Solutions" class="mobile-dropdown-title"><span class="title">Solutions</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><h4>
Hardware
</h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="https://shop.theengs.io/products/theengs-plug-smart-plug-ble-gateway-and-energy-consumption" target="_self" class="nav-link external">
Theengs Plug
<!----></a></li><li class="dropdown-subitem"><a href="https://shop.theengs.io/products/theengs-bridge-esp32-ble-mqtt-gateway-with-ethernet-and-external-antenna" target="_self" class="nav-link external">
Theengs Bridge
<!----></a></li></ul></li><li class="dropdown-item"><h4>
Software
</h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="https://app.theengs.io" target="_self" class="nav-link external">
Mobile App
<!----></a></li><li class="dropdown-subitem"><a href="https://docs.openmqttgateway.com" target="_self" class="nav-link external">
OpenMQTTGateway
<!----></a></li><li class="dropdown-subitem"><a href="https://gateway.theengs.io" target="_self" class="nav-link external">
Gateway
<!----></a></li></ul></li><li class="dropdown-item"><h4>
Core
</h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="https://decoder.theengs.io" target="_self" class="nav-link external">
Decoder
<!----></a></li><li class="dropdown-subitem"><a href="https://parser.theengs.io" target="_self" class="nav-link external">
Web Parser
<!----></a></li></ul></li></ul></div></div><div class="nav-item"><a href="https://decoder.theengs.io/devices/devices.html" target="_self" class="nav-link external">
Compatible devices
<!----></a></div><div class="nav-item"><a href="https://community.openmqttgateway.com" target="_self" class="nav-link external">
Community
<!----></a></div><div class="nav-item"><a href="https://shop.theengs.io/" target="_self" class="nav-link external">
Shop
<!----></a></div><div class="nav-item"><a href="https://github.com/sponsors/theengs" target="_self" class="nav-link external">
Sponsor 🤍
<!----></a></div> <a href="https://github.com/1technophile/OpenMQTTGateway" target="_blank" rel="noopener noreferrer" class="repo-link">
GitHub
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav> <ul class="sidebar-links"><li><a href="/dev/" aria-current="page" class="sidebar-link">0 - What is it for 🏠</a></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>1 - Prerequisites🧭</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>2 - Set it up 🔨</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>3 - Upload ➡️</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>4 - Use ✈️</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/dev/use/rf.html" class="sidebar-link">RF gateways (RTL_433/RCSwitch/RF/RF2)</a></li><li><a href="/dev/use/ble.html" class="sidebar-link">Bluetooth ESP32 gateway</a></li><li><a href="/dev/use/ir.html" aria-current="page" class="active sidebar-link">Infrared gateway</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/dev/use/ir.html#receiving-data-from-ir-signal" class="sidebar-link">Receiving data from IR signal</a></li><li class="sidebar-sub-header"><a href="/dev/use/ir.html#send-data-by-mqtt-to-convert-it-on-ir-signal" class="sidebar-link">Send data by MQTT to convert it on IR signal</a></li><li class="sidebar-sub-header"><a href="/dev/use/ir.html#send-data-by-mqtt-from-global-cache-database-to-convert-it-on-ir-signal" class="sidebar-link">Send data by MQTT from Global Caché database to convert it on IR signal</a></li><li class="sidebar-sub-header"><a href="/dev/use/ir.html#send-data-by-mqtt-with-advanced-ir-parameters" class="sidebar-link">Send data by MQTT with advanced IR parameters</a></li><li class="sidebar-sub-header"><a href="/dev/use/ir.html#send-raw-ir-data-by-mqtt" class="sidebar-link">Send raw IR data by MQTT</a></li><li class="sidebar-sub-header"><a href="/dev/use/ir.html#repeat-the-ir-signal-openmqttgateway-receive" class="sidebar-link">Repeat the IR signal OpenMQTTGateway receive</a></li><li class="sidebar-sub-header"><a href="/dev/use/ir.html#raw-ir-signal-forwarding" class="sidebar-link">Raw IR signal forwarding</a></li></ul></li><li><a href="/dev/use/lora.html" class="sidebar-link">LoRa gateway</a></li><li><a href="/dev/use/gsm.html" class="sidebar-link">GSM 2G gateway</a></li><li><a href="/dev/use/serial.html" class="sidebar-link">RS232/Serial gateway</a></li><li><a href="/dev/use/rfm69.html" class="sidebar-link">RFM69 gateway</a></li><li><a href="/dev/use/sensors.html" class="sidebar-link">Sensors</a></li><li><a href="/dev/use/actuators.html" class="sidebar-link">Actuators</a></li><li><a href="/dev/use/boards.html" class="sidebar-link">Boards</a></li><li><a href="/dev/use/displays.html" class="sidebar-link">Displays</a></li><li><a href="/dev/use/gateway.html" class="sidebar-link">System commands (ESP only)</a></li><li><a href="/dev/use/webui.html" class="sidebar-link">WebUI</a></li></ul></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>5 - Integrate 🎉</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>6 - Participate 💻</span> <span class="arrow right"></span></p> <!----></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="ir-gateway"><a href="#ir-gateway" class="header-anchor">#</a> IR gateway</h1> <p>There is two methods for finding the IR codes you want to replicate:</p> <ol><li>Point the remote control to an IR receiver see <a href="#receiving-data-from-ir-signal">Receiving data from IR signal</a> &amp; <a href="#send-data-by-mqtt-to-convert-it-on-ir-signal">Send data by MQTT to convert it on IR signal</a></li> <li>Find the code corresponding to your devices with IR global cache database https://irdb.globalcache.com/ see <a href="#send-data-by-mqtt-from-global-cach%C3%A9-database-to-convert-it-on-ir-signal">Send data by MQTT from Global cache database to convert it on IR signal</a></li></ol> <p>Here is the <a href="https://docs.google.com/spreadsheets/d/1rTDZIG8rm0dSf4vP7HdTdM4-aRY1nDWH4jK28_WRwHQ/edit?usp=sharing" target="_blank" rel="noopener noreferrer">List of protocols<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> supported by OMG, even if your device brand is not in the list you can still use raw IR data or GlobalCache database.</p> <h2 id="receiving-data-from-ir-signal"><a href="#receiving-data-from-ir-signal" class="header-anchor">#</a> Receiving data from IR signal</h2> <p>Subscribe to all the messages with mosquitto or open your MQTT client software:
<code>mosquitto_sub -t +/# -v</code>
And press your IR remote control in front of the receiver led you should see the following messages for example:</p> <div class="language-json line-numbers-mode"><pre class="language-json"><code>home/OpenMQTTGateway/IRtoMQTT <span class="token punctuation">{</span><span class="token property">&quot;value&quot;</span><span class="token operator">:</span><span class="token number">875849879</span><span class="token punctuation">,</span><span class="token property">&quot;protocol&quot;</span><span class="token operator">:</span><span class="token number">7</span><span class="token punctuation">,</span><span class="token property">&quot;protocol_name&quot;</span><span class="token operator">:</span>SAMSUNG<span class="token punctuation">,</span><span class="token property">&quot;bits&quot;</span><span class="token operator">:</span><span class="token number">32</span><span class="token punctuation">,</span><span class="token property">&quot;raw&quot;</span><span class="token operator">:</span><span class="token string">&quot;4534,4432,612,518,614,516,616,1618,618,1616,618,512,618,1618,608,524,612,518,616,514,618,512,616,1618,616,1618,618,514,616,1618,616,514,616,514,618,512,616,1618,618,1618,618,514,610,1622,616,514,618,514,614,516,616,1618,618,512,618,512,618,1616,550,580,618,1616,612,1624,618,1616,618&quot;</span><span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>With an hexadecimal value:</p> <div class="language-json line-numbers-mode"><pre class="language-json"><code><span class="token punctuation">{</span><span class="token property">&quot;value&quot;</span><span class="token operator">:</span><span class="token number">9938405643</span><span class="token punctuation">,</span><span class="token property">&quot;protocol&quot;</span><span class="token operator">:</span><span class="token number">55</span><span class="token punctuation">,</span><span class="token property">&quot;bits&quot;</span><span class="token operator">:</span><span class="token number">35</span><span class="token punctuation">,</span><span class="token property">&quot;hex&quot;</span><span class="token operator">:</span><span class="token string">&quot;0x25060090B&quot;</span><span class="token punctuation">,</span><span class="token property">&quot;protocol_name&quot;</span><span class="token operator">:</span><span class="token string">&quot;TECO&quot;</span><span class="token punctuation">}</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>To receive big dump of raw data you need first to modify the <a href="https://github.com/1technophile/OpenMQTTGateway/blob/091b317660fd201a30e2cd0e15424a13c5a6bd71/config_IR.h#L41" target="_blank" rel="noopener noreferrer">config_IR.h<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> and uncomment DumpMode true</p> <p>Unknown protocols are filtered by default, if you want to see the unknown protocols set into <a href="https://github.com/1technophile/OpenMQTTGateway/blob/master/config_IR.h" target="_blank" rel="noopener noreferrer">config_IR.h<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> <code>#define pubIRunknownPrtcl true</code> instead of false</p> <p><img src="/dev/assets/img/OpenMQTTGateway_serial3.296590cd.jpg" alt="IR serial"></p> <p>You can take this code and try to reproduce it with the gateway either by using <a href="#send-data-by-mqtt-to-convert-it-on-ir-signal">decimal value</a> or the <a href="#send-raw-ir-data-by-mqtt">raw value</a>.</p> <h2 id="send-data-by-mqtt-to-convert-it-on-ir-signal"><a href="#send-data-by-mqtt-to-convert-it-on-ir-signal" class="header-anchor">#</a> Send data by MQTT to convert it on IR signal</h2> <p>With the IR gateway you need to put on the topic the protocol_name you want to use to send the signal, the different protocols implemented are <a href="https://github.com/crankyoldgit/IRremoteESP8266/blob/f9d7e5c622670132731e3f9c64d9132128eb320c/src/IRremoteESP8266.h#L299" target="_blank" rel="noopener noreferrer">here<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p>Exhaustive list <a href="https://docs.google.com/spreadsheets/d/1_5fQjAixzRtepkykmL-3uN3G5bLfQ0zMajM9OBZ1bx0/edit#gid=1910001295" target="_blank" rel="noopener noreferrer">here<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p>For example if I want to send a command to a Sony TV you can use the following command:</p> <p><code>mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoIR -m '{&quot;value&quot;:551489775,&quot;protocol_name&quot;:&quot;SONY&quot;}'</code></p> <p>The code after the -m represent the payload you want to send.</p> <p>You could alternatively use an hex value (bits is the number of hexadecimal values):
<code>mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoIR -m '{&quot;hex&quot;:&quot;0x250600090B&quot;,&quot;bits&quot;:5,&quot;protocol_name&quot;:&quot;TECO&quot;}'</code></p> <p>or</p> <p><code>mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoIR -m '{&quot;hex&quot;:&quot;0xA6BCF20040600020000000000519&quot;,&quot;bits&quot;:14,&quot;protocol_name&quot;:&quot;HAIER_AC_YRW02&quot;}'</code></p> <p>If you dont want to use special parameters for IR just use value key, the protocol per default is NEC</p> <p><code>mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoIR -m '{&quot;value&quot;:551489775}'</code></p> <p>NOTE: on Arduino Uno most of the protocols are not enable per default due to memory constraints (it is not the case for MEGA), to enable them go to <a href="https://github.com/1technophile/OpenMQTTGateway/blob/master/main/User_config.h" target="_blank" rel="noopener noreferrer">User_config.h<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> and uncomment the #define corresponding the protocols you want:</p> <div class="language-cpp line-numbers-mode"><pre class="language-cpp"><code><span class="token comment">//#define IR_COOLIX</span>
<span class="token comment">//#define IR_Whynter</span>
<span class="token comment">//#define IR_LG</span>
<span class="token comment">//#define IR_Sony</span>
<span class="token comment">//#define IR_DISH</span>
<span class="token comment">//#define IR_RC5</span>
<span class="token comment">//#define IR_Sharp</span>
<span class="token macro property"><span class="token directive-hash">#</span><span class="token directive keyword">define</span> <span class="token macro-name">IR_SAMSUNG</span></span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br></div></div><h2 id="send-data-by-mqtt-from-global-cache-database-to-convert-it-on-ir-signal"><a href="#send-data-by-mqtt-from-global-cache-database-to-convert-it-on-ir-signal" class="header-anchor">#</a> Send data by MQTT from Global Caché database to convert it on IR signal</h2> <p>The website https://irdb.globalcache.com/ contains an important database of IR codes of various devices brand. By registering and asking the code you will receive a code as the example below:</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>code1: sendir,1:1,1,38000,1,69,340,169,20,20,20,20,20,64,20,20,20,20,20,20,20,20,20,20,20,64,20,64,20,20,20,64,20,64,20,64,20,64,20,64,20,64,20,64,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,64,20,64,20,64,20,64,20,64,20,64,20,1544,340,85,20,3663
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>Extract this part of the code:</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>38000,1,69,340,169,20,20,20,20,20,64,20,20,20,20,20,20,20,20,20,20,20,64,20,64,20,20,20,64,20,64,20,64,20,64,20,64,20,64,20,64,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,64,20,64,20,64,20,64,20,64,20,64,20,1544,340,85,20,3663
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>and publish it to MQTT with the subject containing IR_GC:</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoIR -m '{&quot;raw&quot;:&quot;38000,1,1,171,171,21,64,21,21,21,21,21,21,21,21,21,21,21,21,21,64,21,64,21,21,21,21,21,21,21,21,21,21,21,21,21,64,21,21,21,21,21,21,21,64,21,21,21,21,21,21,21,21,21,64,21,64,21,64,21,21,21,64,21,64,21,64,21,64,21,1114&quot;,&quot;protocol_name&quot;:&quot;GC&quot;}'
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>You should be able to command your devices without having listened with the IR receiver or if your protocol is unknown by the IRremote library</p> <h2 id="send-data-by-mqtt-with-advanced-ir-parameters"><a href="#send-data-by-mqtt-with-advanced-ir-parameters" class="header-anchor">#</a> Send data by MQTT with advanced IR parameters</h2> <p>IR sending support two advanced parameters; bits length and repeat number.</p> <p>The example below will send the following advanced parameters bits: 14 and repeat:4 times for a Sony protocol:</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoIR -m '{&quot;value&quot;:551489775,&quot;protocol_name&quot;:&quot;NEC&quot;,&quot;repeat&quot;:4,&quot;bits&quot;:14}'
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><h2 id="send-raw-ir-data-by-mqtt"><a href="#send-raw-ir-data-by-mqtt" class="header-anchor">#</a> Send raw IR data by MQTT</h2> <p>Publish your code like below</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoIR -m '{&quot;raw&quot;:&quot;8850,4450,600,550,550,550,600,1600,600,550,600,500,600,500,600,550,600,500,600,1650,600,1600,600,550,600,1600,600,1650,600,1600,600,1650,600,1600,600,550,600,500,600,550,550,1650,600,500,600,550,600,500,600,550,550,1650,600,1650,550,1650,600,550,550,1650,600,1650,550,1650,600,1650,600&quot;,&quot;protocol_name&quot;:&quot;Raw&quot;}'
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>With big raw array you may cross the limit of default payload size. In this case the gateway will not receive the message or will not send it to the broker.
In this case the best way is to use hex values instead, but if you can't you may change the parameters below:
In User_config.h replace:</p> <div class="language-cpp line-numbers-mode"><pre class="language-cpp"><code><span class="token macro property"><span class="token directive-hash">#</span> <span class="token directive keyword">define</span> <span class="token macro-name">JSON_MSG_BUFFER</span> <span class="token expression"><span class="token number">512</span></span></span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>by</p> <div class="language-cpp line-numbers-mode"><pre class="language-cpp"><code><span class="token macro property"><span class="token directive-hash">#</span> <span class="token directive keyword">define</span> <span class="token macro-name">JSON_MSG_BUFFER</span> <span class="token expression"><span class="token number">1280</span></span></span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><h2 id="repeat-the-ir-signal-openmqttgateway-receive"><a href="#repeat-the-ir-signal-openmqttgateway-receive" class="header-anchor">#</a> Repeat the IR signal OpenMQTTGateway receive</h2> <p>So as to repeat the IR signal received by the gateway once set the following parameter to true in <a href="https://github.com/1technophile/OpenMQTTGateway/blob/091b317660fd201a30e2cd0e15424a13c5a6bd71/config_IR.h#L37" target="_blank" rel="noopener noreferrer">config_IR.h<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> <code>#define repeatIRwMQTT true</code></p> <h2 id="raw-ir-signal-forwarding"><a href="#raw-ir-signal-forwarding" class="header-anchor">#</a> Raw IR signal forwarding</h2> <p>So as to repeat the raw IR signal received by the gateway, uncomment and set the following parameter to true in <a href="https://github.com/1technophile/OpenMQTTGateway/blob/091b317660fd201a30e2cd0e15424a13c5a6bd71/config_IR.h#L39" target="_blank" rel="noopener noreferrer">config_IR.h<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> <code>#define RawDirectForward true</code></p></div> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/1technophile/OpenMQTTGateway/edit/development/docs/use/ir.md" target="_blank" rel="noopener noreferrer">Edit this page</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div> <div class="last-updated"><span class="prefix">Last Updated:</span> <span class="time">12/7/2025, 10:45:07 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
<a href="/dev/use/ble.html" class="prev">
Bluetooth ESP32 gateway
</a></span> <span class="next"><a href="/dev/use/lora.html">
LoRa gateway
</a>
</span></p></div> </main></div><div class="global-ui"></div></div>
<script src="/dev/assets/js/app.405a371d.js" defer></script><script src="/dev/assets/js/2.f90febc1.js" defer></script><script src="/dev/assets/js/1.848070c7.js" defer></script><script src="/dev/assets/js/46.a3d8b6f4.js" defer></script>
</body>
</html>