---
title: "MQTT Broker for Smart Home & Home Assistant | ConnectMQ"
description: "Connect Home Assistant, Zigbee2MQTT and Node-RED to a managed MQTT broker — remote access over TLS and secure WebSockets without opening ports at home."
url: "https://connectmq.com/smart-home/"
language: "en"
---

Smart Home

# MQTT for Smart Home

Hubs, sensors and automation platforms such as Home Assistant and Node-RED already speak MQTT. A managed broker gives you remote access without opening ports at home.

[Try it free](https://app.connectmq.com/signup) [Quickstart](https://connectmq.com/developers/)

No card required

What you can build

## Build your smart home on ConnectMQ

You build the automations, ConnectMQ moves the data. Hubs and sensors publish once; Home Assistant, Node-RED flows, your phone dashboard and notifications each subscribe to what they need — at home or from anywhere.

Your home

**Zigbee2MQTT bridge**zigbee2mqtt/{device}

**ESP32 / Tasmota sensors**home/{room}/sensor/temperature

**Thermostat**home/{room}/thermostat/set

**Door & garage contacts**home/garage/door/state

**ConnectMQ**

-   TLS on 8883
-   secure WebSockets
-   per-device ACL
-   retained messages

What you build on top

**Home Assistant**

**Node-RED automations**

**Phone & wall dashboards**

**Notifications**

What you get

## Smart Home on ConnectMQ

-   Connect Home Assistant, Zigbee2MQTT and Node-RED to one broker
-   Secure WebSockets for browser-based dashboards
-   Separate credentials for every hub and app
-   No router port-forwarding or home server to maintain

example topic design

```
home/living-room/thermostat/state
home/living-room/thermostat/set
home/garage/door/state               (retained)
```

No home server

## Remote access without opening ports

A broker on a box at home needs port forwarding or a VPN before you can reach it from outside, and it is one more thing to patch and back up. With ConnectMQ, every device and app connects out to the broker over TLS, wherever it is.

### Broker on a box at home

-   Port forwarding or a VPN for remote access
-   You patch, monitor and restart it
-   A power cut or a failed SD card means downtime
-   Phone apps need extra setup outside the home network

### ConnectMQ

-   Devices and apps connect out over TLS — no open ports
-   Managed and monitored for you
-   Secure WebSockets for browser dashboards
-   Separate credentials for every hub and app

Real-life example

## Keep the holiday cabin from freezing — from home

One of the most common smart-home MQTT setups: a sensor and a smart plug in a cabin that only has a 4G router, Home Assistant at home, and ConnectMQ in the middle. Neither place opens a port — both connect out to the broker over TLS.

Holiday cabin → ConnectMQ → Your home. Publishes the room temperature every 5 minutes, over the cabin’s 4G router and TLS. Subscribed through ConnectMQ. The automation “cabin below 5 °C” fires and switches the heater plug. Turns the heater on and reports its new state, which Home Assistant shows straight away. Home Assistant sends a notification: “Cabin at 3.8 °C — heater switched on.” At 8 °C it switches the plug off again.ConnectMQMQTT broker · TLS 8883Automation: cabin below 5 °CHomeAssistantYour homeHome Assistant · no port forwardingESP325.6 °C4.7 °C3.8 °C4.5 °C5.2 °CTasmota4GHoliday cabin4G router · no public IPcabin/living/temperature 3.8cabin/living/temperature 3.8cmnd/cabin-heater/POWER ONcmnd/cabin-heater/POWER ONstat/cabin-heater/POWER ONHome Assistant · nowCabin at 3.8 °C — heater switched onHoliday cabin → ConnectMQ → Your home. Publishes the room temperature every 5 minutes, over the cabin’s 4G router and TLS. Subscribed through ConnectMQ. The automation “cabin below 5 °C” fires and switches the heater plug. Turns the heater on and reports its new state, which Home Assistant shows straight away. Home Assistant sends a notification: “Cabin at 3.8 °C — heater switched on.” At 8 °C it switches the plug off again.ConnectMQMQTT broker · TLS 8883Automation: cabin below 5 °CHomeAssistantYour homeHome Assistant · no port forwardingESP325.6 °C4.7 °C3.8 °C4.5 °C5.2 °CTasmota4GHoliday cabin4G router · no public IPcabin/living/temperature 3.8cabin/living/temperature 3.8cmnd/cabin-heater/POWER ONcmnd/cabin-heater/POWER ONstat/cabin-heater/POWER ONHome Assistant · nowCabin at 3.8 °C — heater switched on

1.  02:10 **ESP32 sensor in the cabin**
    
    Publishes the room temperature every 5 minutes, over the cabin’s 4G router and TLS.
    
    `cabin/living/temperature → 3.8`
    
2.  02:10 **Home Assistant at home**
    
    Subscribed through ConnectMQ. The automation “cabin below 5 °C” fires and switches the heater plug.
    
    `cmnd/cabin-heater/POWER → ON`
    
3.  02:10 **Tasmota smart plug in the cabin**
    
    Turns the heater on and reports its new state, which Home Assistant shows straight away.
    
    `stat/cabin-heater/POWER → ON`
    
4.  02:11 **Your phone**
    
    Home Assistant sends a notification: “Cabin at 3.8 °C — heater switched on.” At 8 °C it switches the plug off again.
    

**If the cabin’s 4G drops,** ConnectMQ publishes the plug’s Last Will `tele/cabin-heater/LWT → Offline` and Home Assistant marks it unavailable — so a silent cabin is never mistaken for a warm one.

[ESP32 code sample](https://connectmq.com/code-samples/esp32/) [Home Assistant setup](https://connectmq.com/code-samples/home-assistant/)

Platform

## Features that help with Smart Home

[

### Connectivity

MQTT 3.1.1 and 5 over TCP, TLS, WS and WSS

Learn more](https://connectmq.com/connectivity/)[

### Rules & alerts

Threshold rules, alert log and notifications

Learn more](https://connectmq.com/rules-alerts/)[

### Dashboard & monitoring

Live topic cards, signals and ISA-95 workspace

Learn more](https://connectmq.com/monitoring/)

Solutions

## Other ways teams use ConnectMQ

[

### Industrial IoT & Smart Manufacturing

Machines, PLC gateways, OEE and quality data

](https://connectmq.com/industrial-iot/)[

### Fleet Telematics

Vehicle tracking, telematics and cold chain

](https://connectmq.com/fleet-logistics/)[

### Smart Energy

Meters, EV chargers, solar and batteries

](https://connectmq.com/energy-utilities/)[

### Connected Products & Smart Hardware

Smart devices you ship to your own customers

](https://connectmq.com/connected-products/)[

### Connected Robots & Physical AI

Robot fleets talking to fleet managers and AI pipelines

](https://connectmq.com/robotics/)[

### Data Center Monitoring

Power, cooling and rack environment

](https://connectmq.com/data-centers/)[

### Smart City

Streetlights, parking, air and waste sensors

](https://connectmq.com/smart-city/)[

### Smart Agriculture

Soil probes, weather stations and irrigation

](https://connectmq.com/smart-agriculture/)[

### Prototyping & Education

From first ESP32 to classroom labs

](https://connectmq.com/prototyping-education/)

Pilot

## Connect your home in 10 minutes

Start on the Free plan with no card, then move to Basic: up to 100 concurrent connections — plenty for a hub, Home Assistant, Node-RED and your phones. No port forwarding, and you can cancel anytime.

[Start for free](https://app.connectmq.com/signup) [See pricing](https://connectmq.com/pricing/)

## Articles

[All articles](https://connectmq.com/blog/)

IoT Tutorials

### [ESP32 MQTT Tutorial: Publish Sensor Data and Control an LED with Arduino IDE](https://connectmq.com/blog/esp32-mqtt-tutorial/)

Connect an ESP32 to an MQTT broker with Arduino IDE and PubSubClient, publish JSON temperature readings, control the onboard LED from the command line and upgrade to TLS with portal credentials.

August 23, 20269 min read

IoT Tutorials

### [MQTT over WebSocket: Connect a Browser to an MQTT Broker with MQTT.js](https://connectmq.com/blog/mqtt-over-websocket/)

Browsers cannot open raw TCP sockets, so web apps speak MQTT over WebSocket. Build a working browser client and a Node.js client against broker.connectmq.com and learn how to fix the most common connection errors.

September 29, 20268 min read

IoT Tutorials

### [Free Public MQTT Broker for Testing: Connect to broker.connectmq.com in Minutes](https://connectmq.com/blog/free-public-mqtt-broker/)

broker.connectmq.com is a free public MQTT broker for testing and learning. Here are the ports, the anonymous access rules, the limits and copy-paste examples for the CLI, Python, Node.js and the browser.

September 20, 20267 min read
