Files
OpenMQTTGateway/dev/upload/advanced-configuration.html
2025-12-07 21:34:49 +00:00

136 lines
26 KiB
HTML

<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Advanced configuration of the gateway | Theengs OpenMQTTGateway DEVELOPMENT SHA:36682c 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="One gateway, many technologies: MQTT gateway for ESP8266 or ESP32 with bidirectional 433mhz/315mhz/868mhz, Infrared communications, BLE, LoRa, beacons detection, mi flora / mi jia / LYWSD02/ Mi Scale compatibility, SMS &amp; LORA.">
<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.33921e4a.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/37.8a3f6ff9.js" as="script"><link rel="prefetch" href="/dev/assets/js/10.54a69cb0.js"><link rel="prefetch" href="/dev/assets/js/11.6556d787.js"><link rel="prefetch" href="/dev/assets/js/12.e41769b6.js"><link rel="prefetch" href="/dev/assets/js/13.f2f65af0.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.7c2b5a08.js"><link rel="prefetch" href="/dev/assets/js/17.e1333746.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.7abe1c27.js"><link rel="prefetch" href="/dev/assets/js/25.3cdd6711.js"><link rel="prefetch" href="/dev/assets/js/26.60581abf.js"><link rel="prefetch" href="/dev/assets/js/27.f4bc0108.js"><link rel="prefetch" href="/dev/assets/js/28.23e9a1c4.js"><link rel="prefetch" href="/dev/assets/js/29.aac2a444.js"><link rel="prefetch" href="/dev/assets/js/3.2fb8cc22.js"><link rel="prefetch" href="/dev/assets/js/30.a35bbc54.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.66867073.js"><link rel="prefetch" href="/dev/assets/js/34.1144d4cf.js"><link rel="prefetch" href="/dev/assets/js/35.de5ccc4f.js"><link rel="prefetch" href="/dev/assets/js/36.adfdf2f5.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/46.a3d8b6f4.js"><link rel="prefetch" href="/dev/assets/js/47.7a8191ba.js"><link rel="prefetch" href="/dev/assets/js/48.f2c8695b.js"><link rel="prefetch" href="/dev/assets/js/49.d705f84d.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.4d19c6ad.js"><link rel="prefetch" href="/dev/assets/js/52.d3d8653e.js"><link rel="prefetch" href="/dev/assets/js/53.6344416c.js"><link rel="prefetch" href="/dev/assets/js/54.7361c051.js"><link rel="prefetch" href="/dev/assets/js/55.a83c3bcc.js"><link rel="prefetch" href="/dev/assets/js/56.64c3f900.js"><link rel="prefetch" href="/dev/assets/js/57.bbcbc292.js"><link rel="prefetch" href="/dev/assets/js/58.4d098c0a.js"><link rel="prefetch" href="/dev/assets/js/59.fc715049.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.096d97a1.js"><link rel="prefetch" href="/dev/assets/js/62.d32662df.js"><link rel="prefetch" href="/dev/assets/js/63.118c24b3.js"><link rel="prefetch" href="/dev/assets/js/64.25208722.js"><link rel="prefetch" href="/dev/assets/js/65.bd30a68b.js"><link rel="prefetch" href="/dev/assets/js/66.6b3e6794.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:36682c 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 open"><span>3 - Upload ➡️</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/dev/upload/web-install.html" class="sidebar-link">(Option 1) Upload from the web</a></li><li><a href="/dev/upload/binaries.html" class="sidebar-link">(Option 2) Upload ready-to-go binaries</a></li><li><a href="/dev/upload/builds.html" class="sidebar-link">(Option 3) Upload your configurations</a></li><li><a href="/dev/upload/gitpod.html" class="sidebar-link">(Option 4) Build from the web</a></li><li><a href="/dev/upload/portal.html" class="sidebar-link">Wifi and MQTT configuration</a></li><li><a href="/dev/upload/advanced-configuration.html" aria-current="page" class="active sidebar-link">Advanced configuration of the gateway</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/dev/upload/advanced-configuration.html#secure-connection-to-the-broker" class="sidebar-link">Secure connection to the broker</a></li><li class="sidebar-sub-header"><a href="/dev/upload/advanced-configuration.html#add-the-received-value-at-the-end-of-the-topic" class="sidebar-link">Add the received &quot;value&quot; at the end of the topic</a></li><li class="sidebar-sub-header"><a href="/dev/upload/advanced-configuration.html#auto-discovery" class="sidebar-link">Auto discovery</a></li></ul></li><li><a href="/dev/upload/troubleshoot.html" class="sidebar-link">Troubleshooting</a></li></ul></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>4 - Use ✈️</span> <span class="arrow right"></span></p> <!----></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="advanced-configuration-of-the-gateway"><a href="#advanced-configuration-of-the-gateway" class="header-anchor">#</a> Advanced configuration of the gateway</h1> <h2 id="secure-connection-to-the-broker"><a href="#secure-connection-to-the-broker" class="header-anchor">#</a> Secure connection to the broker</h2> <p>By default the connection between the gateway and the MQTT broker is not encrypted and the identity of the broker is not verified.
For connections in a private local area network this might not be a big issue, but if you connect to a broker on the internet or the gateway is connected to a public network there is a high security risk.</p> <p>To secure the connection, Transport Layer Security (TLS) can be used which is supported by most MQTT brokers.
Setting up and configuring TLS in the MQTT broker is a complex process and perhaps include creating a self-signed certificate.
The configuration of the broker is not covered here, you should look into the documentation of your broker.</p> <h3 id="prerequisites"><a href="#prerequisites" class="header-anchor">#</a> Prerequisites</h3> <p>The MQTT broker is configured for TLS and you have access to the CA certificate which was used to sign the MQTT broker certificate.
You are using ESP8266 or ESP32.</p> <h3 id="configure-secure-connection-in-the-gateway"><a href="#configure-secure-connection-in-the-gateway" class="header-anchor">#</a> Configure secure connection in the gateway</h3> <p>To enable the secure connection and use TLS set the <code>#define MQTT_DEFAULT_SECURE</code> to true at build time, or the <code>mqtt secure</code> parameter with WiFi Manager or <code>mqtt_secure</code> with MQTT.
Set <code>MQTT_SERVER</code> to the Common Name (CN) of the certificate of the broker.</p> <p>The server identity can be verified against a certificate or not, if you don't want to use a certicate to verify the server you can uncheck the option <code>validate cert</code> with WiFi Manager or set <code>mqtt_validate</code> to <code>false</code> with MQTT</p> <p>The CA certificate should be in PEM ascii format.
If your CA certificate is not in the correct format or you don't know the format, use <code>openssl</code> to convert the certificate to the correct format.
At build time, in <code>main/certs/default_server_cert.h</code> replace the <code>...</code> with the content of your certificate which is between the <code>-----BEGIN CERTIFICATE-----</code> and <code>-----END CERTIFICATE-----</code> lines:</p> <div class="language-cpp line-numbers-mode"><pre class="language-cpp"><code><span class="token keyword">const</span> <span class="token keyword">char</span><span class="token operator">*</span> certificate CERT_ATTRIBUTE <span class="token operator">=</span> <span class="token raw-string string">R&quot;EOF(&quot;
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
&quot;)EOF&quot;</span><span class="token punctuation">;</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></div></div><p>With WiFi Manager copy your certificate from <code>-----BEGIN CERTIFICATE-----</code> to <code>-----END CERTIFICATE-----</code> (included) and paste it into the input field:</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
</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 process can also be used for the other certificates, OTA, client key, client certificate if necessary.</p> <h2 id="add-the-received-value-at-the-end-of-the-topic"><a href="#add-the-received-value-at-the-end-of-the-topic" class="header-anchor">#</a> Add the received &quot;value&quot; at the end of the topic</h2> <p>For the gateways that publish a &quot;value&quot; parameter on the json (RF, IR...), it is possible to concatenate this parameter at the end of the topic.
So as to activate this function you need to set <code>valueAsATopic</code> to true in User_config.h</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">ifndef</span> <span class="token expression">valueAsATopic</span></span>
<span class="token macro property"><span class="token directive-hash">#</span> <span class="token directive keyword">define</span> <span class="token macro-name">valueAsATopic</span> <span class="token expression"><span class="token boolean">false</span> </span><span class="token comment">// define true to integrate msg value into the subject when receiving</span></span>
<span class="token macro property"><span class="token directive-hash">#</span><span class="token directive keyword">endif</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></div></div><p>Per default you see the following data:</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>home/OpenMQTTGateway/SRFBtoMQTT {&quot;raw&quot;:&quot;2B660186042E00E7E5&quot;,&quot;value&quot;:&quot;59365&quot;,&quot;delay&quot;:&quot;1111&quot;,&quot;val_Thigh&quot;:&quot;390&quot;,&quot;val_Tlow&quot;:&quot;1070&quot;}
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>With the line uncommented you will see:</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>home/OpenMQTTGateway/SRFBtoMQTT/59365 {&quot;raw&quot;:&quot;2B660186042E00E7E5&quot;,&quot;value&quot;:&quot;59365&quot;,&quot;delay&quot;:&quot;1111&quot;,&quot;val_Thigh&quot;:&quot;390&quot;,&quot;val_Tlow&quot;:&quot;1070&quot;}
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>It can be useful to avoid warning or errors on certain controllers.</p> <h2 id="auto-discovery"><a href="#auto-discovery" class="header-anchor">#</a> Auto discovery</h2> <p>Home Assistant discovery is enabled by default on all binaries and platformio configurations.</p> <p>To have a working discovery setup you need to enable it on your MQTT integration definition in HASS.</p> <div class="custom-block tip"><p class="custom-block-title">TIP</p> <p>With platformio you can deactivate discovery by adding:</p> <div class="language-ini line-numbers-mode"><pre class="language-ini"><code><span class="token key attr-name">'-UZmqttDiscovery</span><span class="token punctuation">=</span><span class="token value attr-value">&quot;HADiscovery&quot;'</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>To your environment definition.</p></div> <p>So as to create the MQTT username and password, you have to create a new user(recommended) into Home Assistant-&gt;Configuration-&gt;Users (available in admin mode) or use an existing username/pwd combination (not recommended). This user doesn't need to be an administrator.</p> <p><img src="/dev/assets/img/OpenMQTTGateway-Configuration-Home-Assistant.531a7826.png" alt="MQTT User"></p> <div class="custom-block warning"><p class="custom-block-title">WARNING</p> <p>The max size of the username is 30 and 60 for the password.</p></div> <p>OMG will use the auto discovery functionality of home assistant to create sensors and gateways into your HASS instance automatically.</p> <p>The gateway device will be available into Configuration-&gt;Devices section of Home Assistant.</p> <p><img src="/dev/assets/img/OpenMQTTGateway_Home_Assistant_MQTT_discovery.8980f020.png" alt="MQTT Device settings"></p></div> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/1technophile/OpenMQTTGateway/edit/development/docs/upload/advanced-configuration.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, 4:27:01 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
<a href="/dev/upload/portal.html" class="prev">
Wifi and MQTT configuration
</a></span> <span class="next"><a href="/dev/upload/troubleshoot.html">
Troubleshooting
</a>
</span></p></div> </main></div><div class="global-ui"></div></div>
<script src="/dev/assets/js/app.33921e4a.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/37.8a3f6ff9.js" defer></script>
</body>
</html>