Files
OpenMQTTGateway/dev/use/gateway.html
DigiH 8889d3720e deploy: 296248f64b
deploy: 2440c143c0

deploy: 2440c143c0

deploy: 296248f64b

deploy: 296248f64b

deploy: a0919bbba4

deploy: 6a4b38a0cb

deploy: 4c633da151

deploy: 5a07020144

deploy: 25af43bdeb

deploy: 771b792484

deploy: 771b792484

deploy: 7db2e93c28

deploy: 5421f0e995

deploy: 5421f0e995

deploy: 5421f0e995

deploy: 5421f0e995

deploy: 5421f0e995

deploy: fb42293631

deploy: fb42293631

deploy: fb42293631

deploy: fb42293631

deploy: fb42293631

deploy: 87b26c867f

deploy: 2fcfc0f6d2

deploy: 2fcfc0f6d2

deploy: 2fcfc0f6d2

deploy: 2fcfc0f6d2

deploy: 54b0eaeebf

deploy: 28b97183be

deploy: cf21aed90c

deploy: 5a36034a2f

deploy: 811bc1f608

deploy: 811bc1f608

deploy: 673a895d44

deploy: 673a895d44

deploy: ca9ef664ab

deploy: ca9ef664ab

deploy: 10d7f7465ddd65a1ddcb1bc32504889d85602c4b

deploy: 495e1ce6b42f0293e4cf35c41a6bdb0bd229fa07

deploy: ca9ef664ab

deploy: ca9ef664ab

deploy: ca9ef664ab

deploy: 5e01f40829

deploy: 5e01f40829

deploy: 5e01f40829

deploy: 5e01f40829

deploy: 5e01f40829

deploy: 7a8e8483fd

deploy: 3984656712

deploy: 3984656712

deploy: 3984656712

deploy: 3984656712

deploy: 3984656712

deploy: 3984656712

deploy: 3984656712

deploy: 3984656712

deploy: 3984656712

deploy: 3984656712

deploy: dfa94588d6

deploy: dfa94588d6

deploy: dfa94588d6

deploy: dfa94588d6

deploy: e27e055bf8

deploy: cbec4292de
2024-02-19 12:44:47 -06:00

145 lines
34 KiB
HTML

<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>System commands (ESP only) | OpenMQTTGateway DEVELOPMENT SHA:2440c1 TEST ONLY</title>
<meta name="generator" content="VuePress 1.9.8">
<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="icon" href="/dev/img/Openmqttgateway_logo_mini.png">
<link rel="manifest" href="/dev/manifest.json">
<link rel="apple-touch-icon" sizes="180x180" href="/dev/apple-touch-icon.png">
<link rel="mask-icon" href="/dev/icons/safari-pinned-tab.svg" color="#3eaf7c">
<script type="module" src="https://unpkg.com/esp-web-tools@3.4.2/dist/web/install-button.js?module"></script>
<meta name="description" content="One gateway, many technologies: MQTT gateway for ESP8266, ESP32, Sonoff RF Bridge or Arduino with bidirectional 433mhz/315mhz/868mhz, Infrared communications, BLE, beacons detection, mi flora / mi jia / LYWSD02/ Mi Scale compatibility, SMS &amp; LORA.">
<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.a0b2d6bb.css" as="style"><link rel="preload" href="/dev/assets/js/app.37616211.js" as="script"><link rel="preload" href="/dev/assets/js/2.fdf4d158.js" as="script"><link rel="preload" href="/dev/assets/js/31.5f0a3678.js" as="script"><link rel="prefetch" href="/dev/assets/js/10.dd089e98.js"><link rel="prefetch" href="/dev/assets/js/11.d490c4a0.js"><link rel="prefetch" href="/dev/assets/js/12.3d9627b5.js"><link rel="prefetch" href="/dev/assets/js/13.8fdadc95.js"><link rel="prefetch" href="/dev/assets/js/14.53be8b0a.js"><link rel="prefetch" href="/dev/assets/js/15.9e7f640d.js"><link rel="prefetch" href="/dev/assets/js/16.167136e7.js"><link rel="prefetch" href="/dev/assets/js/17.1b24f802.js"><link rel="prefetch" href="/dev/assets/js/18.6002f660.js"><link rel="prefetch" href="/dev/assets/js/19.367029ed.js"><link rel="prefetch" href="/dev/assets/js/20.ea752e98.js"><link rel="prefetch" href="/dev/assets/js/21.18d93d02.js"><link rel="prefetch" href="/dev/assets/js/22.fe03e80f.js"><link rel="prefetch" href="/dev/assets/js/23.b3fe4fb1.js"><link rel="prefetch" href="/dev/assets/js/24.7aba9723.js"><link rel="prefetch" href="/dev/assets/js/25.3066b3ef.js"><link rel="prefetch" href="/dev/assets/js/26.69e1040e.js"><link rel="prefetch" href="/dev/assets/js/27.470891bf.js"><link rel="prefetch" href="/dev/assets/js/28.7bb3bf3e.js"><link rel="prefetch" href="/dev/assets/js/29.2c556663.js"><link rel="prefetch" href="/dev/assets/js/3.34967994.js"><link rel="prefetch" href="/dev/assets/js/30.ce1f59b8.js"><link rel="prefetch" href="/dev/assets/js/32.245763a7.js"><link rel="prefetch" href="/dev/assets/js/33.1eca4c74.js"><link rel="prefetch" href="/dev/assets/js/34.e9ee0ad9.js"><link rel="prefetch" href="/dev/assets/js/35.27d21c4b.js"><link rel="prefetch" href="/dev/assets/js/36.f55fd62f.js"><link rel="prefetch" href="/dev/assets/js/37.07a9d001.js"><link rel="prefetch" href="/dev/assets/js/38.4e8718a0.js"><link rel="prefetch" href="/dev/assets/js/39.e533c21d.js"><link rel="prefetch" href="/dev/assets/js/4.0b272843.js"><link rel="prefetch" href="/dev/assets/js/40.7e581684.js"><link rel="prefetch" href="/dev/assets/js/41.81202049.js"><link rel="prefetch" href="/dev/assets/js/42.ef29de3b.js"><link rel="prefetch" href="/dev/assets/js/43.9da33982.js"><link rel="prefetch" href="/dev/assets/js/44.24c08f06.js"><link rel="prefetch" href="/dev/assets/js/45.26e87af9.js"><link rel="prefetch" href="/dev/assets/js/46.39554abd.js"><link rel="prefetch" href="/dev/assets/js/47.7be7d795.js"><link rel="prefetch" href="/dev/assets/js/48.4984bc04.js"><link rel="prefetch" href="/dev/assets/js/49.c8f0c8da.js"><link rel="prefetch" href="/dev/assets/js/5.805ba45a.js"><link rel="prefetch" href="/dev/assets/js/50.88b3398c.js"><link rel="prefetch" href="/dev/assets/js/51.7fb4b9e4.js"><link rel="prefetch" href="/dev/assets/js/52.547bcf23.js"><link rel="prefetch" href="/dev/assets/js/6.a203e05b.js"><link rel="prefetch" href="/dev/assets/js/7.bfb27966.js"><link rel="prefetch" href="/dev/assets/js/8.237c9201.js"><link rel="prefetch" href="/dev/assets/js/9.9ace8522.js">
<link rel="stylesheet" href="/dev/assets/css/0.styles.a0b2d6bb.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">OpenMQTTGateway DEVELOPMENT SHA:2440c1 TEST ONLY</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="https://shop.theengs.io/" target="_blank" rel="noopener noreferrer" class="nav-link external">
Shop🆕
<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></div><div class="nav-item"><a href="https://1technophile.blogspot.com" target="_blank" rel="noopener noreferrer" class="nav-link external">
Blog
<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></div><div class="nav-item"><a href="/dev/" class="nav-link">
Docs
</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://compatible.openmqttgateway.com/index.php/devices" target="_self" class="nav-link external">
Devices
<!----></a></div><div class="nav-item"><a href="/dev/upload/web-install.html" class="nav-link">
Upload
</a></div><div class="nav-item"><a href="https://app.theengs.io/" target="_blank" rel="noopener noreferrer" class="nav-link external">
Theengs
<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></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://shop.theengs.io/" target="_blank" rel="noopener noreferrer" class="nav-link external">
Shop🆕
<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></div><div class="nav-item"><a href="https://1technophile.blogspot.com" target="_blank" rel="noopener noreferrer" class="nav-link external">
Blog
<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></div><div class="nav-item"><a href="/dev/" class="nav-link">
Docs
</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://compatible.openmqttgateway.com/index.php/devices" target="_self" class="nav-link external">
Devices
<!----></a></div><div class="nav-item"><a href="/dev/upload/web-install.html" class="nav-link">
Upload
</a></div><div class="nav-item"><a href="https://app.theengs.io/" target="_blank" rel="noopener noreferrer" class="nav-link external">
Theengs
<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></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">BLE ESP32 gateway</a></li><li><a href="/dev/use/ir.html" class="sidebar-link">Infrared gateway</a></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/rs232.html" class="sidebar-link">RS232 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" aria-current="page" class="active sidebar-link">System commands (ESP only)</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/dev/use/gateway.html#restart-the-esp" class="sidebar-link">Restart the ESP</a></li><li class="sidebar-sub-header"><a href="/dev/use/gateway.html#erase-the-esp-settings" class="sidebar-link">Erase the ESP settings</a></li><li class="sidebar-sub-header"><a href="/dev/use/gateway.html#retrieve-current-status-of-the-esp" class="sidebar-link">Retrieve current status of the ESP</a></li><li class="sidebar-sub-header"><a href="/dev/use/gateway.html#auto-discovery" class="sidebar-link">Auto discovery</a></li><li class="sidebar-sub-header"><a href="/dev/use/gateway.html#autodiscovery-compatible-with-openhab-default-false" class="sidebar-link">AutoDiscovery compatible with OpenHAB (default: false)</a></li><li class="sidebar-sub-header"><a href="/dev/use/gateway.html#change-the-wifi-credentials" class="sidebar-link">Change the WiFi credentials</a></li><li class="sidebar-sub-header"><a href="/dev/use/gateway.html#change-the-gateway-password" class="sidebar-link">Change the gateway password</a></li><li class="sidebar-sub-header"><a href="/dev/use/gateway.html#change-the-mqtt-broker-credentials" class="sidebar-link">Change the MQTT broker credentials</a></li><li class="sidebar-sub-header"><a href="/dev/use/gateway.html#change-the-mqtt-main-topic-and-or-gateway-name" class="sidebar-link">Change the MQTT main topic and or gateway name</a></li><li class="sidebar-sub-header"><a href="/dev/use/gateway.html#switching-brokers-and-using-self-signed-and-client-certificates" class="sidebar-link">Switching brokers and using self signed and client certificates</a></li><li class="sidebar-sub-header"><a href="/dev/use/gateway.html#change-the-led-indicator-brightness" class="sidebar-link">Change the LED indicator brightness</a></li></ul></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="system-commands-esp-only"><a href="#system-commands-esp-only" class="header-anchor">#</a> System commands (ESP only)</h1> <h2 id="restart-the-esp"><a href="#restart-the-esp" class="header-anchor">#</a> Restart the ESP</h2> <p><code>mosquitto_pub -t &quot;home/OpenMQTTGateway/commands/MQTTtoSYS/config&quot; -m '{&quot;cmd&quot;:&quot;restart&quot;}'</code></p> <div class="custom-block tip"><p class="custom-block-title">TIP</p> <p>With Home Assistant, this command is directly available through MQTT auto discovery as a switch into the HASS OpenMQTTGateway device entities list.</p></div> <h2 id="erase-the-esp-settings"><a href="#erase-the-esp-settings" class="header-anchor">#</a> Erase the ESP settings</h2> <p><code>mosquitto_pub -t &quot;home/OpenMQTTGateway/commands/MQTTtoSYS/config&quot; -m '{&quot;cmd&quot;:&quot;erase&quot;}'</code></p> <div class="custom-block tip"><p class="custom-block-title">TIP</p> <p>With Home Assistant, this command is directly available through MQTT auto discovery as a switch into the HASS OpenMQTTGateway device entities list.</p></div> <h2 id="retrieve-current-status-of-the-esp"><a href="#retrieve-current-status-of-the-esp" class="header-anchor">#</a> Retrieve current status of the ESP</h2> <p><code>mosquitto_pub -t &quot;home/OpenMQTTGateway/commands/MQTTtoSYS/config&quot; -m '{&quot;cmd&quot;:&quot;status&quot;}'</code></p> <h2 id="auto-discovery"><a href="#auto-discovery" class="header-anchor">#</a> Auto discovery</h2> <p>You can deactivate the MQTT auto discovery function, this function enables to automatically create devices/entities with Home Assistant convention.</p> <h3 id="deactivate"><a href="#deactivate" class="header-anchor">#</a> Deactivate</h3> <p><code>mosquitto_pub -t &quot;home/OpenMQTTGateway/commands/MQTTtoSYS/config&quot; -m '{&quot;disc&quot;:false}'</code></p> <h3 id="activate"><a href="#activate" class="header-anchor">#</a> Activate</h3> <p><code>mosquitto_pub -t &quot;home/OpenMQTTGateway/commands/MQTTtoSYS/config&quot; -m '{&quot;disc&quot;:true}'</code></p> <p>If you want the settings to be kept upon gateway restart, you can save the state by adding <code>&quot;save&quot;:true</code> (ESP32 only).
<code>mosquitto_pub -t &quot;home/OpenMQTTGateway/commands/MQTTtoSYS/config&quot; -m '{&quot;disc&quot;:false, &quot;save&quot;:true}'</code></p> <div class="custom-block tip"><p class="custom-block-title">TIP</p> <p>Auto discovery is enable by default on release binaries, on platformio (except for UNO). With Arduino IDE please read the <a href="../upload/advanced-configuration#auto-discovery">advanced configuration section</a> of the documentation.</p></div> <h2 id="autodiscovery-compatible-with-openhab-default-false"><a href="#autodiscovery-compatible-with-openhab-default-false" class="header-anchor">#</a> AutoDiscovery compatible with OpenHAB (default: false)</h2> <p>OpenHAB does not support the key <code>is_defined</code> in the json template, to remove it at runtime and make the auto discovery compatible you can use the following command with a retain flag.</p> <p><code>mosquitto_pub -t &quot;home/OpenMQTTGateway/commands/MQTTtoSYS/config&quot; -m '{&quot;ohdisc&quot;:true}'</code></p> <p>If you want the settings to be kept upon gateway restart, you can save the state by adding <code>&quot;save&quot;:true</code> (ESP32 only).
<code>mosquitto_pub -t &quot;home/OpenMQTTGateway/commands/MQTTtoSYS/config&quot; -m '{&quot;ohdisc&quot;:true, &quot;save&quot;:true}'</code></p> <div class="custom-block tip"><p class="custom-block-title">TIP</p> <p>This command can also be used with other controllers that does not support the is_defined key.</p></div> <h2 id="change-the-wifi-credentials"><a href="#change-the-wifi-credentials" class="header-anchor">#</a> Change the WiFi credentials</h2> <p><code>mosquitto_pub -t &quot;home/OpenMQTTGateway/commands/MQTTtoSYS/config&quot; -m '{&quot;wifi_ssid&quot;:&quot;ssid&quot;, &quot;wifi_pass&quot;:&quot;password&quot;}'</code></p> <div class="custom-block tip"><p class="custom-block-title">TIP</p> <p>If the new connection fails the gateway will fallback to the previous connection.</p></div> <h2 id="change-the-gateway-password"><a href="#change-the-gateway-password" class="header-anchor">#</a> Change the gateway password</h2> <p>The password must be 8 characters minimum.</p> <p><code>mosquitto_pub -t &quot;home/OpenMQTTGateway/commands/MQTTtoSYS/config&quot; -m '{&quot;gw_pass&quot;:&quot;12345678&quot;}'</code></p> <h2 id="change-the-mqtt-broker-credentials"><a href="#change-the-mqtt-broker-credentials" class="header-anchor">#</a> Change the MQTT broker credentials</h2> <div class="language- line-numbers-mode"><pre class="language-text"><code>mosquitto_pub -t &quot;home/OpenMQTTGateway/commands/MQTTtoSYS/config&quot; -m
'{
&quot;mqtt_user&quot;: &quot;user_name&quot;,
&quot;mqtt_pass&quot;: &quot;password&quot;,
&quot;mqtt_server&quot;: &quot;host&quot;,
&quot;mqtt_port&quot;: &quot;port&quot;,
&quot;mqtt_secure&quot;: &quot;false&quot;
}'
</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><p>::: info
By default this function is not available on the pre built binary of RFBridge, in order to have less code size and enable to have OTA update working properly. So as to enable it remove from the rf bridge env:</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>build_flags = '-UMQTTsetMQTT'
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>Arduino boards does not have this function per default also, to add it:</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>build_flags = '-DMQTTsetMQTT'
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>:::</p> <div class="custom-block tip"><p class="custom-block-title">TIP</p> <p>Server, port, and secure_flag are only required if changing connection to another broker.<br>
If the new connection fails the gateway will fallback to the previous connection.</p></div> <h2 id="change-the-mqtt-main-topic-and-or-gateway-name"><a href="#change-the-mqtt-main-topic-and-or-gateway-name" class="header-anchor">#</a> Change the MQTT main topic and or gateway name</h2> <div class="language- line-numbers-mode"><pre class="language-text"><code>mosquitto_pub -t &quot;home/OpenMQTTGateway/commands/MQTTtoSYS/config&quot; -m
'{
&quot;mqtt_topic&quot;: &quot;topic/&quot;,
&quot;gateway_name&quot;: &quot;name&quot;
}'
</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></div></div><p>::: info
This will change the subscribed and published mqtt_topic/gateway_name that the gateway uses. No parameters are mandatory, the current topic or gateway name will be used if not supplied.
:::</p> <h2 id="switching-brokers-and-using-self-signed-and-client-certificates"><a href="#switching-brokers-and-using-self-signed-and-client-certificates" class="header-anchor">#</a> Switching brokers and using self signed and client certificates</h2> <p>In the <code>user_config.h</code> file it is possible to specify multiple MQTT brokers and client certificates. These are commonly self signed and are supported by defining <code>MQTT_SECURE_SELF_SIGNED</code> as true or 1.<br>
Additionally, support for multiple brokers and client certificates has been added. To use this, it is required that the server certificate, client certificate, and client key are provided as their own constant string value as demonstrated in the file.<br>
To add more than one broker and switch between them it is necessary to provide all of the relevant certificates/keys and add their respective variable names in the <code>certs_array</code> structure, as shown in <code>user_config.h</code>, and changing the array size to the number of different connections -1.</p> <p>To switch between these servers with an MQTT command message, the format is as follows:</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>mosquitto_pub -t &quot;home/OpenMQTTGateway/commands/MQTTtoSYS/config&quot; -m
'{
&quot;mqtt_user&quot;: &quot;user&quot;,
&quot;mqtt_pass&quot;: &quot;password&quot;,
&quot;mqtt_server&quot;: &quot;host&quot;,
&quot;mqtt_port&quot;: &quot;port&quot;,
&quot;mqtt_secure&quot;: &quot;true&quot;,
&quot;mqtt_cert_index&quot;:0
}'
</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><span class="line-number">9</span><br></div></div><div class="custom-block tip"><p class="custom-block-title">TIP</p> <p>The <code>mqtt_cert_index</code> value corresponds to the 0 to X index of the <code>certs_array</code> in <code>user_config.h</code>.</p></div> <h1 id="firmware-update-from-mqtt-esp-only"><a href="#firmware-update-from-mqtt-esp-only" class="header-anchor">#</a> Firmware update from MQTT (ESP only)</h1> <p>When the gateway used is from a standard ESP32 environment <a href="https://github.com/1technophile/OpenMQTTGateway/blob/development/environments.ini" target="_blank" rel="noopener noreferrer">listed and defined 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>, it can be updated through a simple MQTT command:</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>mosquitto_pub -t &quot;home/OpenMQTTGateway_ESP32_BLE/commands/MQTTtoSYS/firmware_update&quot; -m '{
&quot;version&quot;: &quot;latest&quot;
}'
</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></div></div><p>This would download the latest version firmware binary from Github and install it.
It can be used with version 1.5.0 and above.</p> <p>Note that this update option is also autodiscovered through Home Assistant convention, you can update directly from the device page with 2 clicks.</p> <p><img src="/dev/assets/img/OpenMQTTGateway-OTA-Update-Home-Assistant.beaca92f.png" alt="Home Assistant OTA Update"></p> <p>You can also indicate the target version to update:</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>mosquitto_pub -t &quot;home/OpenMQTTGateway_ESP32_BLE/commands/MQTTtoSYS/firmware_update&quot; -m '{
&quot;version&quot;: &quot;v1.2.0&quot;
}'
</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></div></div><p>OpenMQTTGateway checks at start and every hour if an update is available.</p> <p>Alternatively if you want to choose the update URL you can use the command below (ESP32 and ESP8266):</p> <p>Without certificate, in this case we will use the root certificate defined in User_config.h</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>mosquitto_pub -t &quot;home/OpenMQTTGateway_ESP32_BLE/commands/MQTTtoSYS/firmware_update&quot; -m '{
&quot;version&quot;: &quot;test&quot;,
&quot;password&quot;: &quot;OTAPASSWORD&quot;,
&quot;url&quot;: &quot;https://github.com/1technophile/OpenMQTTGateway/releases/download/v0.9.12/esp32dev-ble-firmware.bin&quot;
}'
</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></div></div><p>With certificate:</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>mosquitto_pub -t &quot;home/OpenMQTTGateway_ESP32_BLE/commands/MQTTtoSYS/firmware_update&quot; -m '{
&quot;version&quot;: &quot;test&quot;,
&quot;password&quot;: &quot;OTAPASSWORD&quot;,
&quot;url&quot;: &quot;https://github.com/1technophile/OpenMQTTGateway/releases/download/v0.9.12/esp32dev-ble-firmware.bin&quot;,
&quot;server_cert&quot;: &quot;-----BEGIN CERTIFICATE-----
MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD
QTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT
MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j
b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG
9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB
CSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97
nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt
43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P
T19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4
gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO
BgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR
TLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw
DQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr
hMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg
06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF
PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls
YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk
CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=
-----END CERTIFICATE-----&quot;}'
</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><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br></div></div><p>A bash script is available <a href="ota_command_cert.zip">here</a> to simplify the use of the <code>server_cert</code> parameter.</p> <p>To enable this functionality, <code>MQTT_HTTPS_FW_UPDATE</code> will need to be defined or the line that defines in in user_config.h will need to be uncommented.</p> <div class="custom-block tip"><p class="custom-block-title">TIP</p> <p>If using an unsecure MQTT broker it is <strong>highly recommended</strong> to disable the password checking by setting the macro <code>MQTT_HTTPS_FW_UPDATE_USE_PASSWORD</code> to 0 (default is 1 (enabled)), otherwise a clear text password may be sent over the network.</p> <p>The <code>server_cert</code> parameter is optional. If the update server has changed or certificate updated or not set in <code>user_config.h</code> then you can provide the certificate here.</p></div> <div class="custom-block warning"><p class="custom-block-title">WARNING</p> <p>The pre-built binaries for <strong>rfbridge</strong> and <strong>avatto-bakeey-ir</strong> have the above WiFi and MQTT broker credentials and the Firmware update via MQTT options disabled. This is due to the restricted available flash, so as to still be able to use OTA firmware updates for these boards.</p></div> <h2 id="change-the-led-indicator-brightness"><a href="#change-the-led-indicator-brightness" class="header-anchor">#</a> Change the LED indicator brightness</h2> <p>Minimum: 0, Maximum: 255, Default defined by DEFAULT_ADJ_BRIGHTNESS</p> <p><code>mosquitto_pub -t &quot;home/OpenMQTTGateway/commands/MQTTtoSYS/config&quot; -m '{&quot;brightness&quot;:200}'</code></p> <h1 id="state-led-usage"><a href="#state-led-usage" class="header-anchor">#</a> State LED usage</h1> <p>The gateway can support up to 3 LED to display its operating state:</p> <ul><li><p>LED_INFO
switched ON when network and MQTT connection are OK
5s ON, 5s OFF when MQTT is disconnected
2s ON, 2s OFF when NETWORK is disconnected</p></li> <li><p>LED_RECEIVE
Blink for <code>TimeLedON</code> 1s when the gateway receive a signal from one of its module so as to send to MQTT</p></li> <li><p>LED_SEND
Blink for <code>TimeLedON</code> 1s when the gateway send a signal with one of its module from an MQTT command</p></li></ul></div> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/1technophile/OpenMQTTGateway/edit/development/docs/use/gateway.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/12/2023, 8:03:11 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
<a href="/dev/use/displays.html" class="prev">
Displays
</a></span> <span class="next"><a href="/dev/use/webui.html">
WebUI
</a>
</span></p></div> </main></div><div class="global-ui"></div></div>
<script src="/dev/assets/js/app.37616211.js" defer></script><script src="/dev/assets/js/2.fdf4d158.js" defer></script><script src="/dev/assets/js/31.5f0a3678.js" defer></script>
</body>
</html>