{"id":26894,"date":"2026-09-16T14:24:03","date_gmt":"2026-09-16T14:24:03","guid":{"rendered":"https:\/\/netguide.io\/smart-home\/home-assistant-how-to-monitor-mqtt-traffic-with-mosquitto\/"},"modified":"2026-09-16T14:24:04","modified_gmt":"2026-09-16T14:24:04","slug":"home-assistant-how-to-monitor-mqtt-traffic-with-mosquitto","status":"publish","type":"post","link":"https:\/\/netguide.io\/smart-home\/en\/home-assistant-how-to-monitor-mqtt-traffic-with-mosquitto\/","title":{"rendered":"Home Assistant: How to Monitor MQTT Traffic with Mosquitto"},"content":{"rendered":"<div id=\"netgu-3260361793\" class=\"netgu-before-content netgu-entity-placement\"><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-6258556257245998\" crossorigin=\"anonymous\"><\/script><ins class=\"adsbygoogle\" style=\"display:block;\" data-ad-client=\"ca-pub-6258556257245998\" \ndata-ad-slot=\"3494115342\" \ndata-ad-format=\"auto\"><\/ins>\n<script> \n(adsbygoogle = window.adsbygoogle || []).push({}); \n<\/script>\n<\/div><p>When sensors or switches send data via MQTT, you often need to know exactly which payloads reach the broker whenever issues arise. While on traditional server setups you can simply run the command <code>mosquitto_sub -v -t '#'<\/code> in the terminal, <a href=\"https:\/\/netguide.io\/smart-home\/category\/home-assistant\/\" data-internallinksmanager029f6b8e52c=\"2\" title=\"Home Assistant\">Home Assistant<\/a> offers multiple ways to achieve this. This guide shows you how to track and inspect the traffic passing through your Mosquitto broker.<\/p>\n\n<h2>What You Need<\/h2>\n<ul>\n  <li>Access to your <a href=\"https:\/\/netguide.io\/smart-home\/category\/home-assistant\/\" data-internallinksmanager029f6b8e52c=\"2\" title=\"Home Assistant\">Home Assistant<\/a> system<\/li>\n  <li>A configured Mosquitto broker<\/li>\n  <li>Depending on the method: SSH access or tools like MQTTLens or MQTT Explorer<\/li>\n<\/ul>\n\n<h2>1. Intercepting MQTT Traffic via Terminal Using mosquitto_sub<\/h2>\n<p>If you have the SSH add-on installed, you can log in to your <a href=\"https:\/\/netguide.io\/smart-home\/category\/home-assistant\/\" data-internallinksmanager029f6b8e52c=\"2\" title=\"Home Assistant\">Home Assistant<\/a> system via SSH and directly use the familiar Mosquitto client.<\/p>\n<div class=\"acp acp--light acp-t-product-horizontal\"><article class=\"acp-card acp-hz is-unavailable\">\r\n\t\t\t\t\t<div class=\"acp-hz__grid\">\r\n\t\t<div class=\"acp-hz__media\">\r\n\t\t\t\t\t\t<div class=\"acp-hz__img\">\r\n\t\t\t\t<img src=\"https:\/\/ac.api.valitype.io\/media\/proxy\/c8Bj1JVIxE88kn2y7drm7Zc-N76U6-WZ\/aHR0cHM6Ly9tLm1lZGlhLWFtYXpvbi5jb20vaW1hZ2VzL0kvNDFSU1NZVHFkVkwuX1NMNTAwXy5qcGc\" alt=\"Nabu Casa Home Assistant Green\" width=\"500\" height=\"500\" loading=\"lazy\" decoding=\"async\">\t\t\t<\/div>\r\n\t\t<\/div>\r\n\r\n\t\t<div class=\"acp-hz__info\">\r\n\t\t\t\t\t\t\t<p class=\"acp-kicker\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"acp-brand\">Nabu Casa<\/span>\r\n\t\t\t\t\t\t\t\t\t<\/p>\r\n\t\t\t\t\t\t<h3 class=\"acp-title acp-title--sm\">Nabu Casa Home Assistant Green<\/h3>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\r\n\r\n\t\t<div class=\"acp-hz__buy\">\r\n\t\t\t\t\t\t\t<div class=\"acp-status\">\r\n\t<p class=\"acp-status__label\"><svg class=\"acp-i acp-i--info\" viewBox=\"0 0 20 20\" width=\"20\" height=\"20\" aria-hidden=\"true\" focusable=\"false\"><circle cx=\"10\" cy=\"10\" r=\"8\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\"\/><path d=\"M10 9v5\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\"\/><circle cx=\"10\" cy=\"6.3\" r=\"1.1\" fill=\"currentColor\"\/><\/svg><span>Currently unavailable<\/span><\/p>\r\n\t<\/div>\r\n\t\t\t\t\t<\/div>\r\n\t<\/div>\r\n\t\t\t<div class=\"acp-foot\">\r\n\t\t\t\t\t<\/div>\r\n\t<\/article>\r\n<\/div>\n<p>Run the following command in the console:<\/p>\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>mosquitto_sub -v -t '#'<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #B392F0\">mosquitto_sub<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #79B8FF\">-v<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #79B8FF\">-t<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">&#39;#&#39;<\/span><\/span><\/code><\/pre><\/div>\n\n<h2>2. Visual Monitoring with MQTT Explorer or MQTTLens<\/h2>\n<p>To keep an organized overview of topics and messages, you can use dedicated graphical tools. For instance, the MQTTLens browser extension or MQTT Explorer allow you to follow message traffic live in a structured interface.<\/p>\n\n<h2>3. Displaying MQTT Messages in Home Assistant Logs<\/h2>\n<p>Alternatively, MQTT traffic can be logged directly within the <a href=\"https:\/\/netguide.io\/smart-home\/category\/home-assistant\/\" data-internallinksmanager029f6b8e52c=\"2\" title=\"Home Assistant\">Home Assistant<\/a> system log without having to keep a console window open.<\/p>\n<p>To do this, add the MQTT component with your desired log level to your logger configuration (for example, in <code>configuration.yaml<\/code> or a separate <code>logger.yaml<\/code>):<\/p>\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>logger:\n  logs:\n    homeassistant.components.mqtt: debug<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #85E89D\">logger<\/span><span style=\"color: #E1E4E8\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">  <\/span><span style=\"color: #85E89D\">logs<\/span><span style=\"color: #E1E4E8\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">    <\/span><span style=\"color: #85E89D\">homeassistant.components.mqtt<\/span><span style=\"color: #E1E4E8\">: <\/span><span style=\"color: #9ECBFF\">debug<\/span><\/span><\/code><\/pre><\/div>\n<p>After reloading the configuration, you will find incoming messages in the frontend under Developer Tools in the logs section.<\/p>\n\n<h2>Is It Working?<\/h2>\n<p>As soon as a device publishes data, the corresponding topics and payloads will appear in your terminal window or GUI tool. You can test the data flow by subscribing to a topic and publishing a manual test message to that same topic.<\/p>\n\n<h2>Troubleshooting<\/h2>\n<ul>\n  <li><strong>No incoming messages:<\/strong> Verify whether the transmitting device is genuinely connected to the broker&#8217;s IP address and that the Mosquitto broker is running actively.<\/li>\n<\/ul>\n\n<p>Monitoring allows you to spot transmission errors quickly and process unrecognized MQTT payloads whenever necessary.<\/p>\n<p><em>Sources: <a href=\"https:\/\/community.home-assistant.io\/t\/how-to-monitor-all-mosquitto-mqtt-traffic-in-hass-io\/35680\" rel=\"nofollow noopener\" target=\"_blank\">Forum: Home Assistant Community<\/a>, <a href=\"https:\/\/smarterkram.de\/7680\/mqtt-erklaert-in-home-assistant\/\" rel=\"nofollow noopener\" target=\"_blank\">smarterkram.de<\/a>, <a href=\"https:\/\/alkly.de\/mqtt-mit-home-assistant-fuer-anfaenger\/\" rel=\"nofollow noopener\" target=\"_blank\">alkly.de<\/a><\/em><\/p><div id=\"netgu-233912851\" class=\"netgu-after-content netgu-entity-placement\"><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-6258556257245998\" crossorigin=\"anonymous\"><\/script><ins class=\"adsbygoogle\" style=\"display:block;\" data-ad-client=\"ca-pub-6258556257245998\" \ndata-ad-slot=\"4559785002\" \ndata-ad-format=\"auto\"><\/ins>\n<script> \n(adsbygoogle = window.adsbygoogle || []).push({}); \n<\/script>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Learn how to monitor all MQTT messages in Home Assistant using mosquitto_sub, system logging, or visual tools like MQTT Explorer.<\/p>\n","protected":false},"author":1,"featured_media":26891,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[26],"tags":[3973,3770,3972,3776,3963],"class_list":["post-26894","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-smart-home-en-en","tag-debugging-en","tag-home-assistant-en","tag-mosquitto-en","tag-mqtt-en","tag-terminal-en"],"uagb_featured_image_src":{"full":["https:\/\/netguide.io\/smart-home\/wp-content\/uploads\/sites\/3\/2026\/09\/home-assistant-mqtt-verkehr-mit-mosquitto-uberwachen-editorial-editorial-78605-t-home-assistant-fuer-anfaenger.001.jpeg.jpg",1024,768,false],"thumbnail":["https:\/\/netguide.io\/smart-home\/wp-content\/uploads\/sites\/3\/2026\/09\/home-assistant-mqtt-verkehr-mit-mosquitto-uberwachen-editorial-editorial-78605-t-home-assistant-fuer-anfaenger.001.jpeg-150x150.jpg",150,150,true],"medium":["https:\/\/netguide.io\/smart-home\/wp-content\/uploads\/sites\/3\/2026\/09\/home-assistant-mqtt-verkehr-mit-mosquitto-uberwachen-editorial-editorial-78605-t-home-assistant-fuer-anfaenger.001.jpeg-300x225.jpg",300,225,true],"medium_large":["https:\/\/netguide.io\/smart-home\/wp-content\/uploads\/sites\/3\/2026\/09\/home-assistant-mqtt-verkehr-mit-mosquitto-uberwachen-editorial-editorial-78605-t-home-assistant-fuer-anfaenger.001.jpeg-768x576.jpg",768,576,true],"large":["https:\/\/netguide.io\/smart-home\/wp-content\/uploads\/sites\/3\/2026\/09\/home-assistant-mqtt-verkehr-mit-mosquitto-uberwachen-editorial-editorial-78605-t-home-assistant-fuer-anfaenger.001.jpeg.jpg",1024,768,false],"1536x1536":["https:\/\/netguide.io\/smart-home\/wp-content\/uploads\/sites\/3\/2026\/09\/home-assistant-mqtt-verkehr-mit-mosquitto-uberwachen-editorial-editorial-78605-t-home-assistant-fuer-anfaenger.001.jpeg.jpg",1024,768,false],"2048x2048":["https:\/\/netguide.io\/smart-home\/wp-content\/uploads\/sites\/3\/2026\/09\/home-assistant-mqtt-verkehr-mit-mosquitto-uberwachen-editorial-editorial-78605-t-home-assistant-fuer-anfaenger.001.jpeg.jpg",1024,768,false]},"uagb_author_info":{"display_name":"Tobias","author_link":"https:\/\/netguide.io\/smart-home\/author\/tobias-pries\/"},"uagb_comment_info":0,"uagb_excerpt":"Learn how to monitor all MQTT messages in Home Assistant using mosquitto_sub, system logging, or visual tools like MQTT Explorer.","brizy_media":[],"_links":{"self":[{"href":"https:\/\/netguide.io\/smart-home\/wp-json\/wp\/v2\/posts\/26894","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/netguide.io\/smart-home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/netguide.io\/smart-home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/netguide.io\/smart-home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/netguide.io\/smart-home\/wp-json\/wp\/v2\/comments?post=26894"}],"version-history":[{"count":1,"href":"https:\/\/netguide.io\/smart-home\/wp-json\/wp\/v2\/posts\/26894\/revisions"}],"predecessor-version":[{"id":26895,"href":"https:\/\/netguide.io\/smart-home\/wp-json\/wp\/v2\/posts\/26894\/revisions\/26895"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/netguide.io\/smart-home\/wp-json\/wp\/v2\/media\/26891"}],"wp:attachment":[{"href":"https:\/\/netguide.io\/smart-home\/wp-json\/wp\/v2\/media?parent=26894"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netguide.io\/smart-home\/wp-json\/wp\/v2\/categories?post=26894"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netguide.io\/smart-home\/wp-json\/wp\/v2\/tags?post=26894"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}