mirror of
https://github.com/1technophile/OpenMQTTGateway.git
synced 2026-03-09 16:57:23 +01:00
119 lines
23 KiB
HTML
119 lines
23 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en-US">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
<title>Sensors | Theengs OpenMQTTGateway DEVELOPMENT SHA:e01b22 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 & 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.cf2d3158.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/65.6799670a.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.5cb21a3a.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.bb4184c5.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.c7122817.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.87d3492d.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.66867073.js"><link rel="prefetch" href="/dev/assets/js/34.8c8c3249.js"><link rel="prefetch" href="/dev/assets/js/35.a470e516.js"><link rel="prefetch" href="/dev/assets/js/36.b9e6c957.js"><link rel="prefetch" href="/dev/assets/js/37.d64aa53d.js"><link rel="prefetch" href="/dev/assets/js/38.5497ae9e.js"><link rel="prefetch" href="/dev/assets/js/39.6bd91126.js"><link rel="prefetch" href="/dev/assets/js/4.ee469e2f.js"><link rel="prefetch" href="/dev/assets/js/40.8a64d460.js"><link rel="prefetch" href="/dev/assets/js/41.c56bed06.js"><link rel="prefetch" href="/dev/assets/js/42.5e953173.js"><link rel="prefetch" href="/dev/assets/js/43.6dbd1f4f.js"><link rel="prefetch" href="/dev/assets/js/44.790d8d70.js"><link rel="prefetch" href="/dev/assets/js/45.2096d087.js"><link rel="prefetch" href="/dev/assets/js/46.a3d8b6f4.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.c03deaf6.js"><link rel="prefetch" href="/dev/assets/js/5.45a12acb.js"><link rel="prefetch" href="/dev/assets/js/50.6a34ee7c.js"><link rel="prefetch" href="/dev/assets/js/51.f851c3ef.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.01a6176d.js"><link rel="prefetch" href="/dev/assets/js/55.a83c3bcc.js"><link rel="prefetch" href="/dev/assets/js/56.60b3af09.js"><link rel="prefetch" href="/dev/assets/js/57.27eb5af9.js"><link rel="prefetch" href="/dev/assets/js/58.c39dc32a.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.3cb039fb.js"><link rel="prefetch" href="/dev/assets/js/62.d32662df.js"><link rel="prefetch" href="/dev/assets/js/63.2baa5b5a.js"><link rel="prefetch" href="/dev/assets/js/64.4b220d3f.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:e01b22 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" 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/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" aria-current="page" class="active sidebar-link">Sensors</a><ul class="sidebar-sub-headers"></ul></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="sensors"><a href="#sensors" class="header-anchor">#</a> Sensors</h1> <p>Subscribe to all the messages with mosquitto or open your MQTT client software:</p> <p><code>sudo mosquitto_sub -t +/# -v</code></p> <h3 id="adc"><a href="#adc" class="header-anchor">#</a> ADC</h3> <p>The value is between 0 and 1024 and is transmitted via MQTT when it changes.
|
|
<code>home/OpenMQTTGateway/ADCtoMQTT {"value":543}</code></p> <h3 id="dht"><a href="#dht" class="header-anchor">#</a> DHT</h3> <p>You will receive every TimeBetweenReadingDHT (set into config_DHT.h) the DHT measurement (30s per default).</p> <p><code>home/OpenMQTTGateway/DHTtoMQTT {"tempc":21,"tempf":69.8,"hum":51}</code></p> <p>If you want to don't resend value when it is the same you can set dht_always = false in config_DHT.h</p> <h3 id="htu21"><a href="#htu21" class="header-anchor">#</a> HTU21</h3> <p>You will receive the HTU21 sensor readings every TimeBetweenReadinghtu21 (set into config_HTU21.h) (30s by default).</p> <p><code>home/OpenMQTTGateway/CLIMAtoMQTT/htu {"tempc":25.34064,"tempf":77.61314,"hum":56.53052}</code></p> <p>If you don't want to resend values that haven't changed you can set htu21_always = false in config_HTU21.h</p> <h3 id="ahtx0-aht10-and-aht20"><a href="#ahtx0-aht10-and-aht20" class="header-anchor">#</a> AHTx0 (AHT10 and AHT20)</h3> <p>You will receive the AHT sensor readings every TimeBetweenReadingAHTx0 (set into config_AHTx0.h) (30s by default).</p> <p><code>home/OpenMQTTGateway/CLIMAtoMQTT/aht { "tempc": 27.48108, "tempf": 81.46594, "hum": 48.90614 }</code></p> <p>If you don't want to resend values that haven't changed you can set AHTx0_always = false in config_AHTx0.h</p> <h3 id="ds18x20"><a href="#ds18x20" class="header-anchor">#</a> DS18x20</h3> <p>You will receive the DS18x20 sensor readings every DS1820_INTERVAL_SEC (set into config_DS1820.h) (60s by default).
|
|
Each sensor will be published under the following topic using each sensors' address.</p> <p><code>home/OpenMQTTGateway/CLIMAtoMQTT/ds1820/0x0000000000000000 {"tempc":27.8, "tempf":82.04, "type":"DS18B20","res":"12bit\n","addr":"0x28616411907650bc"}</code></p> <p>The units for temperature readings are sent in Celsius by default can be changed to Fahrenheit by setting DS1820_FAHRENHEIT = true in in config_DS1820.h</p> <p>If you don't want to resend values that haven't changed you can set DS1820_ALWAYS = false in config_DS1820.h</p> <h3 id="hcsr501"><a href="#hcsr501" class="header-anchor">#</a> HCSR501</h3> <p>A boolean value of the PIR sensors state is sent when a state change occurs. The length of time that the PIR stays in a triggered state depends on the PIR hardware and is not changed by OpenMQTTGateway.</p> <p><code>home/OpenMQTTGateway/HCSR501toMQTT {"presence":"false"}</code></p> <p>You can have another PIN mirror the value of the PIR sensor output by adding the following to config_HCSR501.h
|
|
This can be useful if you would like to connect an LED to turn on when motion is detected.</p> <p><code>#define HCSR501_LED_NOTIFY_GPIO 4</code></p> <p>This notification pin can be inverted if driving directly or through a transistor/mosfet.
|
|
<code>#define INVERT_LED_NOTIFY true</code></p> <h3 id="rn8209"><a href="#rn8209" class="header-anchor">#</a> RN8209</h3> <p>You will receive every <code>TimeBetweenPublishingRN8209</code> (set into config_RN8209.h) the RN8209 measurements (every 60s per default), or if the difference between the previous current reading and the new reading is more than 0.1A, or if the difference between the previous voltage reading and the new reading is more than 2V.
|
|
One reading is done every 0.5s.</p> <p><code>home/OpenMQTTGateway/RN8209toMQTT {"volt":120.34,"current":7.92,"power":954.61}</code></p> <h3 id="touch"><a href="#touch" class="header-anchor">#</a> Touch</h3> <p>This sensor is only for ESP32, using the touch sensing peripheral. Up to 10 touch buttons can be defined, linked to 10 ESP32 pins that support touch sensing (GPIOs 0, 2, 4, 12, 13, 14, 15, 27, 32, 33) by defining TOUCH_GPIO, or TOUCH_GPIO_0 through TOUCH_GPIO_9. For example:</p> <p><code>#define TOUCH_GPIO 4</code></p> <p>The default is one sensor on GPIO 4.</p> <p>When a touch is detected, a message is sent indicating the number of the button ("id"), the fact that a touch button was pressed ("on" is 1) and the value measured by the esp32 ("value").</p> <p><code>home/OpenMQTTGateway/touchToMQTT {"id":0,"on":1,"value":10}</code></p> <p>When the button stops being touched (e.g., the finger is lifted off the button), a message is sent indicating that the button was released ("on" is 0), as well as the duration of the button press in milliseconds ("onDuration").</p> <p><code>home/OpenMQTTGateway/touchToMQTT {"id":0,"on":0,"value":70,"onDuration":320}</code></p></div> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/1technophile/OpenMQTTGateway/edit/development/docs/use/sensors.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">1/6/2026, 11:47:49 AM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
|
|
←
|
|
<a href="/dev/use/rfm69.html" class="prev">
|
|
RFM69 gateway
|
|
</a></span> <span class="next"><a href="/dev/use/actuators.html">
|
|
Actuators
|
|
</a>
|
|
→
|
|
</span></p></div> </main></div><div class="global-ui"></div></div>
|
|
<script src="/dev/assets/js/app.cf2d3158.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/65.6799670a.js" defer></script>
|
|
</body>
|
|
</html>
|