{"id":76277,"date":"2025-03-30T18:14:28","date_gmt":"2025-03-30T22:14:28","guid":{"rendered":"https:\/\/www.engineersgarage.com\/?p=76277"},"modified":"2025-04-20T07:06:44","modified_gmt":"2025-04-20T11:06:44","slug":"whatsapp-based-home-automation-protocol-bridging-with-mqtt","status":"publish","type":"post","link":"https:\/\/www.engineersgarage.com\/whatsapp-based-home-automation-protocol-bridging-with-mqtt\/","title":{"rendered":"WhatsApp-based home automation: Protocol bridging with MQTT"},"content":{"rendered":"<p>In this article, we will be controlling devices that do not support WhatsApp but support other communication protocols like MQTT, TCP, IMAP, etc. If a house is installed with home automation devices that do not support Whatsapp, we will communicate with these devices (controllers) using protocols supported by these devices.<\/p>\n<p>Thus, we will be able to control home appliances connected to those devices.<\/p>\n<p><strong>Components required<\/strong><\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/Screen-Shot-2022-05-04-at-3.16.28-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-76278 aligncenter\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/Screen-Shot-2022-05-04-at-3.16.28-PM-1024x259.png\" alt=\"\" width=\"740\" height=\"187\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/Screen-Shot-2022-05-04-at-3.16.28-PM-1024x259.png 1024w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/Screen-Shot-2022-05-04-at-3.16.28-PM-300x76.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/Screen-Shot-2022-05-04-at-3.16.28-PM-768x194.png 768w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/Screen-Shot-2022-05-04-at-3.16.28-PM-368x93.png 368w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/Screen-Shot-2022-05-04-at-3.16.28-PM.png 1090w\" sizes=\"auto, (max-width: 740px) 100vw, 740px\" \/><\/a><\/p>\n<p><strong>Tools Required\/ libraries required<\/strong><\/p>\n<ul>\n<li>Python-based WhatsApp API &#8211; <a href=\"https:\/\/github.com\/tgalal\/yowsup\">yowsup<\/a><\/li>\n<li>MQTT library &#8211; <a href=\"https:\/\/pypi.python.org\/pypi\/paho-mqtt\/1.1\">paho<\/a><\/li>\n<li>Python ID<\/li>\n<li>Arduino IDE<\/li>\n<\/ul>\n<p><strong>Technical insights<br \/>\n<\/strong>Protocol bridging can also control devices that do not support WhatsApp API. This means we will simply send the data from one protocol to another. This article will demonstrate MQTT and WhatsApp Bridge to control the devices.<\/p>\n<p><strong>Block diagram<\/strong><\/p>\n<div id=\"attachment_76279\" style=\"width: 951px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/xmppwhatsappxdcfjfjfj.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-76279\" class=\"wp-image-76279 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/xmppwhatsappxdcfjfjfj.png\" alt=\"\" width=\"941\" height=\"581\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/xmppwhatsappxdcfjfjfj.png 941w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/xmppwhatsappxdcfjfjfj-300x185.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/xmppwhatsappxdcfjfjfj-768x474.png 768w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/xmppwhatsappxdcfjfjfj-368x227.png 368w\" sizes=\"auto, (max-width: 941px) 100vw, 941px\" \/><\/a><p id=\"caption-attachment-76279\" class=\"wp-caption-text\">Figure 1 WhatsApp and MQTT protocol bridging<\/p><\/div>\n<p>&nbsp;<\/p>\n<p>All the communication will be through a Python script, which is installed in Linux based system. The Python script will have WhatsApp API and MQTT library to communicate with both protocols.<\/p>\n<p>The script can send and receive messages on WhatsApp and MQTT.<\/p>\n<p>A microcontroller (ATmega 328p) is connected to the home appliances through relay circuits. For communication purposes, the ESP is connected to the microcontroller.<\/p>\n<p>The ESP is installed with code that receives messages on a specific topic and sends commands to the microcontroller through serial UART.<\/p>\n<p>So, now when any user sends messages on WhatsApp, it goes to the microcontroller through our Python script.<\/p>\n<p><strong>Circuit diagram<br \/>\n<\/strong><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/Circuit_digram.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-76280\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/Circuit_digram-1024x482.png\" alt=\"\" width=\"740\" height=\"348\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/Circuit_digram-1024x482.png 1024w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/Circuit_digram-300x141.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/Circuit_digram-768x361.png 768w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/Circuit_digram-1536x722.png 1536w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/Circuit_digram-2048x963.png 2048w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/Circuit_digram-368x173.png 368w\" sizes=\"auto, (max-width: 740px) 100vw, 740px\" \/><\/a>This board is connected to a light switch with a relay circuit. We can also take the Arduino Uno board instead of our customized board 328 Board.<\/p>\n<p><strong>How the system works<br \/>\n<\/strong>When a user sends a message to our Linux system on WhatsApp, the script reads the message. The IoT device, which supports the MQTT protocol, listens to the messages on a specific topic. These messages command the device to turn an appliance ON and OFF.<\/p>\n<p>So, now the messages read by the Python script are scanned for commands if found. Specific commands are sent to the device on the MQTT protocol. When the device reads those commands, it acts upon them by turning pins HIGH (ON), LOW (OFF)<\/p>\n<p><strong>Understanding the source code<br \/>\n<\/strong>We have two types of source code, one for Arduino + ESP and another for Python script installed in Linux.<\/p>\n<p><strong><span style=\"text-decoration: underline;\">Code for Arduino<\/span><br \/>\n<span style=\"color: #993300;\">Arduino is installed with a code that receives data on serial. When specific strring is received like \u201cON\u201d it will turn the relay pin ON (HIGH) and on receiving \u201cOFF\u201d it turns the relay OFF.<\/span><\/strong><br \/>\n<span style=\"color: #993300;\"><strong>if (rec == &#8220;ON&#8221;) {<\/strong><\/span><br \/>\n<span style=\"color: #993300;\"><strong>\u00a0 \u00a0 \u00a0digitalWrite(relay, HIGH);<\/strong><\/span><br \/>\n<span style=\"color: #993300;\"><strong>\u00a0 \u00a0 \u00a0Serial.print(&#8220;Relay is on&#8221;);<\/strong><\/span><br \/>\n<span style=\"color: #993300;\"><strong>\u00a0 \u00a0 \u00a0rec = &#8220;&#8221;;<\/strong><\/span><br \/>\n<span style=\"color: #993300;\"><strong>}<br \/>\nif (rec == &#8220;OFF&#8221;) {<\/strong><\/span><br \/>\n<strong><span style=\"color: #993300;\">\u00a0 \u00a0 \u00a0digitalWrite(relay, LOW);<\/span><\/strong><br \/>\n<strong><span style=\"color: #993300;\">\u00a0 \u00a0 \u00a0Serial.print(&#8220;Relay is off&#8221;);<\/span><\/strong><br \/>\n<strong><span style=\"color: #993300;\">\u00a0 \u00a0 \u00a0 rec = &#8220;&#8221;;<\/span><\/strong><br \/>\n<strong><span style=\"color: #993300;\">}<\/span><\/strong><\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Code for the ESP<br \/>\n<\/strong><\/span>ESP is connected with Arduino on a serial port and also subscribed on an MQTT topic to receive data from it. Basically, it sends the data received on the MQTT topic to the serial port and data from the serial to the MQTT topic.<\/p>\n<p>To know more about ESP and MQTT, refer to our previous articles.<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Code for the Python script<\/strong><\/span><\/p>\n<p>The Python script is installed with \u201cYowsup\u201d WhatsApp API to read and send messages from WhatsApp. There are two files in this script <strong>run.py<\/strong> and <strong>layer.py<\/strong>.<\/p>\n<p><strong>Understanding File Run.py<br \/>\n<\/strong>We will call our libraries at the top of the file<br \/>\n<span style=\"color: #993300;\"><strong>from yowsup.stacks import\u00a0 YowStackBuilder<\/strong><\/span><br \/>\n<span style=\"color: #993300;\"><strong>from yowsup.layers.auth import AuthError<\/strong><\/span><br \/>\n<span style=\"color: #993300;\"><strong>from yowsup.layers import YowLayerEvent<\/strong><\/span><br \/>\n<span style=\"color: #993300;\"><strong>from yowsup.layers.network import YowNetworkLayer<\/strong><\/span><br \/>\n<span style=\"color: #993300;\"><strong>from yowsup.env import YowsupEnv<\/strong><\/span><\/p>\n<p>We will also attach the layer file on the top because the main class <strong>\u201cEcholayer\u201d <\/strong>exists inside that file.<br \/>\n<strong><span style=\"color: #993300;\">from layer import EchoLayer<\/span><\/strong><\/p>\n<p>We can name the layer file anything, but we have to put the same name here.<\/p>\n<p>Inside the <strong>py, <\/strong>we will declare our main variable for password and events we want to occur.<br \/>\n<span style=\"color: #993300;\"><strong>credentials = (&#8220;91xxxxxxxxxx&#8221;, &#8220;HkhWVW5\/Wnr493HXK8NKl\/htpno=&#8221;)<\/strong><\/span><\/p>\n<p>Now we pass them to the layer and build the stack. Also, the loop which will keep the connection live is called.<br \/>\n<span style=\"color: #993300;\"><strong>stack.setCredentials(credentials)<br \/>\nstack.broadcastEvent(YowLayerEvent(YowNetworkLayer.EVENT_STATE_CONNECT))\u00a0 \u00a0 \u00a0 \u00a0#sending the connect signal<br \/>\nstack.loop() #this is the program mainloop<\/strong><\/span><\/p>\n<p><strong>Understanding File layer.py<br \/>\n<\/strong>This file contains the Protocol library for MQTT and is capable of receiving messages from WhatsApp.<\/p>\n<p><strong>Understating how messages are received from WhatsApp<br \/>\n<\/strong>This file contains the class which will receive any messages incoming to this number, and that will be a callback entity so any other loop can be run inside the file.<br \/>\n<strong><span style=\"color: #993300;\">@ProtocolEntityCallback(&#8220;message&#8221;)<br \/>\n<\/span><span style=\"color: #993300;\">def onMessage(self, messageProtocolEntity):<br \/>\n<\/span><\/strong>\u00a0 \u00a0 \u00a0 \u00a0 <span style=\"color: #993300;\"><strong>\u00a0if True:<\/strong><\/span><\/p>\n<p>Message data and number form from which the message came can be obtained below.<br \/>\n<strong><span style=\"color: #993300;\">incomming_message_data = messageProtocolEntity.getBody()<\/span><\/strong><\/p>\n<p>This will get the message body which is the real message. It will store in a string variable \u201cincomming_message_data\u201d<br \/>\n<span style=\"color: #993300;\"><strong>incomming_message_sender = messageProtocolEntity.getFrom()<\/strong><\/span><\/p>\n<p>This line will store the incoming message contact number in the string variable \u201cincomming_message_sender\u201d<\/p>\n<p><strong>Understanding the MQTT layers for sending and receiving<br \/>\n<\/strong>First of all, we will import libraries that are necessary for MQTT.<br \/>\n<span style=\"color: #993300;\"><strong>import paho.mqtt.client as MQTT<br \/>\nimport paho.mqtt.publish as publish<\/strong><\/span><\/p>\n<p>now we will declare a variable named client with mqtt client.<br \/>\n<strong><span style=\"color: #993300;\">client = mqtt.Client()<\/span><\/strong><\/p>\n<p>Now we will make two function callbacks 1. For receiving messages, 2. Doing something on connection successful.<br \/>\n<span style=\"color: #993300;\"><strong>client.on_connect = on_connect<\/strong><\/span><br \/>\n<span style=\"color: #993300;\"><strong>client.on_message = on_message<\/strong><\/span><\/p>\n<p>Finally, we will connect to MQTT broker on a port, and start the client inside a nonblocking loop<br \/>\n<span style=\"color: #993300;\"><strong>client.connect(&#8220;broker.hivemq.com&#8221;, 1883, 60)<\/strong><\/span><br \/>\n<span style=\"color: #993300;\"><strong>client.loop_start()<\/strong><\/span><\/p>\n<p>After the connection is successful, we can send messages using this<br \/>\n<strong><span style=\"color: #993300;\">publish.single(topic, message_data, hostname=&#8221;broker.hivemq.com&#8221;)<\/span><\/strong><\/p>\n<p>When any message is received on WhatsApp, it is stored in a string, and then that string is scanned for some keywords that define that message as a command to turn the light ON\/OFF.<br \/>\n<strong><span style=\"color: #993300;\">elif(&#8220;lights on&#8221; in\u00a0 incomming_msg):\u00a0#Do something on match<\/span><\/strong><\/p>\n<p>If the condition is matched, we send the control command to the MQTT broker.<br \/>\n<span style=\"color: #993300;\"><strong>publish.single(&#8220;ts\/light&#8221;, &#8220;ON&#8221;, hostname=&#8221;broker.hivemq.com&#8221;)<\/strong><\/span><\/p>\n<p>When any unrecognized message has been received, the message on WhatsApp replies that this is invalid.<\/p>\n<p>And this is how we can use protocol bridging to control devices with WhatsApp.<\/p>\n<div style=\"width: 740px;\" class=\"wp-video\"><!--[if lt IE 9]><script>document.createElement('video');<\/script><![endif]-->\n<video class=\"wp-video-shortcode\" id=\"video-76277-1\" width=\"740\" height=\"400\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/Demo.mp4?_=1\" \/><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/Demo.mp4\">https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/Demo.mp4<\/a><\/video><\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we will be controlling devices that do not support WhatsApp but support other communication protocols like MQTT, TCP, IMAP, etc. If a house is installed with home automation devices that do not support Whatsapp, we will communicate with these devices (controllers) using protocols supported by these devices. Thus, we will be able&hellip;<\/p>\n","protected":false},"author":64,"featured_media":76279,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[13],"tags":[1175,2343,2090,3376,1846,3375],"class_list":{"2":"type-post","14":"entry","15":"has-post-thumbnail"},"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.2 (Yoast SEO v25.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>WhatsApp-based home automation: Protocol bridging with MQTT<\/title>\n<meta name=\"description\" content=\"Controlling devices that do not support WhatsApp but support other communication protocols like MQTT, TCP, IMAP, etc.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.engineersgarage.com\/whatsapp-based-home-automation-protocol-bridging-with-mqtt\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"WhatsApp-based home automation: Protocol bridging with MQTT\" \/>\n<meta property=\"og:description\" content=\"Controlling devices that do not support WhatsApp but support other communication protocols like MQTT, TCP, IMAP, etc.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.engineersgarage.com\/whatsapp-based-home-automation-protocol-bridging-with-mqtt\/\" \/>\n<meta property=\"og:site_name\" content=\"Engineers Garage\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/engineersgarage\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/xmppwhatsappxdcfjfjfj.png\" \/>\n\t<meta property=\"og:image:width\" content=\"941\" \/>\n\t<meta property=\"og:image:height\" content=\"581\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Ashutosh Bhatt\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@EngineersGarage\" \/>\n<meta name=\"twitter:site\" content=\"@EngineersGarage\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ashutosh Bhatt\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.engineersgarage.com\/whatsapp-based-home-automation-protocol-bridging-with-mqtt\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.engineersgarage.com\/whatsapp-based-home-automation-protocol-bridging-with-mqtt\/\"},\"author\":{\"name\":\"Ashutosh Bhatt\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/person\/ff80aa34dc1249eb691d684fec9d1c06\"},\"headline\":\"WhatsApp-based home automation: Protocol bridging with MQTT\",\"datePublished\":\"2025-03-30T22:14:28+00:00\",\"dateModified\":\"2025-04-20T11:06:44+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.engineersgarage.com\/whatsapp-based-home-automation-protocol-bridging-with-mqtt\/\"},\"wordCount\":1050,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.engineersgarage.com\/whatsapp-based-home-automation-protocol-bridging-with-mqtt\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/xmppwhatsappxdcfjfjfj.png\",\"keywords\":[\"Arduino\",\"IDE\",\"MQTT\",\"protocol bridging\",\"python\",\"Whatsapp\"],\"articleSection\":[\"Electronic Projects\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.engineersgarage.com\/whatsapp-based-home-automation-protocol-bridging-with-mqtt\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.engineersgarage.com\/whatsapp-based-home-automation-protocol-bridging-with-mqtt\/\",\"url\":\"https:\/\/www.engineersgarage.com\/whatsapp-based-home-automation-protocol-bridging-with-mqtt\/\",\"name\":\"WhatsApp-based home automation: Protocol bridging with MQTT\",\"isPartOf\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.engineersgarage.com\/whatsapp-based-home-automation-protocol-bridging-with-mqtt\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.engineersgarage.com\/whatsapp-based-home-automation-protocol-bridging-with-mqtt\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/xmppwhatsappxdcfjfjfj.png\",\"datePublished\":\"2025-03-30T22:14:28+00:00\",\"dateModified\":\"2025-04-20T11:06:44+00:00\",\"description\":\"Controlling devices that do not support WhatsApp but support other communication protocols like MQTT, TCP, IMAP, etc.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.engineersgarage.com\/whatsapp-based-home-automation-protocol-bridging-with-mqtt\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.engineersgarage.com\/whatsapp-based-home-automation-protocol-bridging-with-mqtt\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.engineersgarage.com\/whatsapp-based-home-automation-protocol-bridging-with-mqtt\/#primaryimage\",\"url\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/xmppwhatsappxdcfjfjfj.png\",\"contentUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/xmppwhatsappxdcfjfjfj.png\",\"width\":941,\"height\":581},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.engineersgarage.com\/whatsapp-based-home-automation-protocol-bridging-with-mqtt\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.engineersgarage.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"WhatsApp-based home automation: Protocol bridging with MQTT\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.engineersgarage.com\/#website\",\"url\":\"https:\/\/www.engineersgarage.com\/\",\"name\":\"Engineers Garage\",\"description\":\"Electronic Projects, Electrical Engineering Resources, Makers Articles and Product News\",\"publisher\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.engineersgarage.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.engineersgarage.com\/#organization\",\"name\":\"Engineer's Garage - WTWH Media\",\"url\":\"https:\/\/www.engineersgarage.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png\",\"contentUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png\",\"width\":372,\"height\":52,\"caption\":\"Engineer's Garage - WTWH Media\"},\"image\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/engineersgarage\",\"https:\/\/x.com\/EngineersGarage\",\"https:\/\/www.youtube.com\/channel\/UC0VITh11JSYk-UW7toLebUw\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/person\/ff80aa34dc1249eb691d684fec9d1c06\",\"name\":\"Ashutosh Bhatt\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/68b3974894b20e23ded96f2892a241268df7ecec2258979fa47e5e0955676822?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/68b3974894b20e23ded96f2892a241268df7ecec2258979fa47e5e0955676822?s=96&r=g\",\"caption\":\"Ashutosh Bhatt\"},\"url\":\"https:\/\/www.engineersgarage.com\/author\/abhatt\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"WhatsApp-based home automation: Protocol bridging with MQTT","description":"Controlling devices that do not support WhatsApp but support other communication protocols like MQTT, TCP, IMAP, etc.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.engineersgarage.com\/whatsapp-based-home-automation-protocol-bridging-with-mqtt\/","og_locale":"en_US","og_type":"article","og_title":"WhatsApp-based home automation: Protocol bridging with MQTT","og_description":"Controlling devices that do not support WhatsApp but support other communication protocols like MQTT, TCP, IMAP, etc.","og_url":"https:\/\/www.engineersgarage.com\/whatsapp-based-home-automation-protocol-bridging-with-mqtt\/","og_site_name":"Engineers Garage","article_publisher":"https:\/\/www.facebook.com\/engineersgarage","og_image":[{"width":941,"height":581,"url":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/xmppwhatsappxdcfjfjfj.png","type":"image\/png"}],"author":"Ashutosh Bhatt","twitter_card":"summary_large_image","twitter_creator":"@EngineersGarage","twitter_site":"@EngineersGarage","twitter_misc":{"Written by":"Ashutosh Bhatt","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.engineersgarage.com\/whatsapp-based-home-automation-protocol-bridging-with-mqtt\/#article","isPartOf":{"@id":"https:\/\/www.engineersgarage.com\/whatsapp-based-home-automation-protocol-bridging-with-mqtt\/"},"author":{"name":"Ashutosh Bhatt","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/person\/ff80aa34dc1249eb691d684fec9d1c06"},"headline":"WhatsApp-based home automation: Protocol bridging with MQTT","datePublished":"2025-03-30T22:14:28+00:00","dateModified":"2025-04-20T11:06:44+00:00","mainEntityOfPage":{"@id":"https:\/\/www.engineersgarage.com\/whatsapp-based-home-automation-protocol-bridging-with-mqtt\/"},"wordCount":1050,"commentCount":0,"publisher":{"@id":"https:\/\/www.engineersgarage.com\/#organization"},"image":{"@id":"https:\/\/www.engineersgarage.com\/whatsapp-based-home-automation-protocol-bridging-with-mqtt\/#primaryimage"},"thumbnailUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/xmppwhatsappxdcfjfjfj.png","keywords":["Arduino","IDE","MQTT","protocol bridging","python","Whatsapp"],"articleSection":["Electronic Projects"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.engineersgarage.com\/whatsapp-based-home-automation-protocol-bridging-with-mqtt\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.engineersgarage.com\/whatsapp-based-home-automation-protocol-bridging-with-mqtt\/","url":"https:\/\/www.engineersgarage.com\/whatsapp-based-home-automation-protocol-bridging-with-mqtt\/","name":"WhatsApp-based home automation: Protocol bridging with MQTT","isPartOf":{"@id":"https:\/\/www.engineersgarage.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.engineersgarage.com\/whatsapp-based-home-automation-protocol-bridging-with-mqtt\/#primaryimage"},"image":{"@id":"https:\/\/www.engineersgarage.com\/whatsapp-based-home-automation-protocol-bridging-with-mqtt\/#primaryimage"},"thumbnailUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/xmppwhatsappxdcfjfjfj.png","datePublished":"2025-03-30T22:14:28+00:00","dateModified":"2025-04-20T11:06:44+00:00","description":"Controlling devices that do not support WhatsApp but support other communication protocols like MQTT, TCP, IMAP, etc.","breadcrumb":{"@id":"https:\/\/www.engineersgarage.com\/whatsapp-based-home-automation-protocol-bridging-with-mqtt\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.engineersgarage.com\/whatsapp-based-home-automation-protocol-bridging-with-mqtt\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.engineersgarage.com\/whatsapp-based-home-automation-protocol-bridging-with-mqtt\/#primaryimage","url":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/xmppwhatsappxdcfjfjfj.png","contentUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/xmppwhatsappxdcfjfjfj.png","width":941,"height":581},{"@type":"BreadcrumbList","@id":"https:\/\/www.engineersgarage.com\/whatsapp-based-home-automation-protocol-bridging-with-mqtt\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.engineersgarage.com\/"},{"@type":"ListItem","position":2,"name":"WhatsApp-based home automation: Protocol bridging with MQTT"}]},{"@type":"WebSite","@id":"https:\/\/www.engineersgarage.com\/#website","url":"https:\/\/www.engineersgarage.com\/","name":"Engineers Garage","description":"Electronic Projects, Electrical Engineering Resources, Makers Articles and Product News","publisher":{"@id":"https:\/\/www.engineersgarage.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.engineersgarage.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.engineersgarage.com\/#organization","name":"Engineer's Garage - WTWH Media","url":"https:\/\/www.engineersgarage.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png","contentUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png","width":372,"height":52,"caption":"Engineer's Garage - WTWH Media"},"image":{"@id":"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/engineersgarage","https:\/\/x.com\/EngineersGarage","https:\/\/www.youtube.com\/channel\/UC0VITh11JSYk-UW7toLebUw"]},{"@type":"Person","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/person\/ff80aa34dc1249eb691d684fec9d1c06","name":"Ashutosh Bhatt","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/68b3974894b20e23ded96f2892a241268df7ecec2258979fa47e5e0955676822?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/68b3974894b20e23ded96f2892a241268df7ecec2258979fa47e5e0955676822?s=96&r=g","caption":"Ashutosh Bhatt"},"url":"https:\/\/www.engineersgarage.com\/author\/abhatt\/"}]}},"featured_image_src":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/xmppwhatsappxdcfjfjfj-600x400.png","featured_image_src_square":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2022\/05\/xmppwhatsappxdcfjfjfj-600x581.png","author_info":{"display_name":"Ashutosh Bhatt","author_link":"https:\/\/www.engineersgarage.com\/author\/abhatt\/"},"_links":{"self":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/posts\/76277","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/users\/64"}],"replies":[{"embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/comments?post=76277"}],"version-history":[{"count":0,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/posts\/76277\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/media\/76279"}],"wp:attachment":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/media?parent=76277"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/categories?post=76277"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/tags?post=76277"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}