Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk6 min

Keep MQTT Devices Working During a WAN Outage: The Local Broker Setup

A local MQTT broker keeps LAN clients communicating through a WAN outage, provided the LAN, broker host, and power remain available. Here’s how to configure and test it.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To keep MQTT devices communicating when your internet connection fails, run the MQTT broker on a host reachable over your local network and point your devices and local automation system to it. This works during a WAN outage only while the LAN, broker host and power remain available. A cloud-only broker—or a device that requires its vendor’s cloud—will not become locally reachable just because you change an MQTT quality-of-service setting.

What keeps working when the WAN drops?

MQTT clients publish messages to a broker, which routes them to subscribed clients. If the broker and its clients are on the same functioning LAN, their communication does not need to cross the internet. That gives local devices and automations a path to keep communicating during a WAN outage.

As an Amazon Associate I earn from qualifying purchases.

The distinction is between the WAN and the rest of your network. If the router or LAN, broker host, or power also fails, a local broker cannot provide service. And local MQTT communication cannot restore a device function that depends on a vendor’s cloud service. Home Assistant’s internet-outage guidance distinguishes locally communicating devices from cloud-dependent ones.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Set up a broker that stays reachable on your LAN

1. Find each device’s actual dependencies

Check the broker address configured on each MQTT device and whether it can connect to a broker on your LAN. Also check whether the device requires an internet-connected vendor service for control or status. A device may use MQTT locally for some functions and still rely on a cloud service for others.

2. Choose an always-available local host

If you already run Home Assistant, its documented Mosquitto broker app is one route to a local broker. You can also use another compatible MQTT broker on a host that remains connected to the LAN. The important requirement is reachability and uptime, not a particular hardware model.

Home Assistant’s MQTT integration documentation covers broker host or IP address, port, credentials, and connection options. Its Mosquitto broker app documentation explains the app-based setup.

3. Point MQTT clients to the local broker

Configure every device and automation client to use the broker’s LAN hostname or IP address and the correct port and credentials. Make sure the hostname resolves on the LAN, or use a stable address. A client still configured with a cloud broker’s hostname will lose its route when the WAN is down.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

4. Keep offline automations local

For an automation to work without internet, its inputs, control path, and required services must also be local. A locally connected device may continue to work, while an automation that calls a cloud API, uses remote access, or depends on a cloud assistant integration may not. Home Assistant describes these local-versus-cloud limits in its no-cloud FAQ.

5. Verify local publishing and subscription

Home Assistant documents testing a local broker with Mosquitto command-line clients. From the broker host, publish a test message to a topic:

mosquitto_pub -h 127.0.0.1 -t test/topic -m "hello"

In another terminal, subscribe to that topic:

mosquitto_sub -h 127.0.0.1 -t test/topic

For a device-side check, use the broker’s LAN hostname or IP instead of 127.0.0.1, which refers to the machine running the command. Confirm that the device can publish and that the intended subscriber receives the message. Then, if it is safe for your setup, simulate a WAN interruption while keeping the LAN and broker powered, and repeat the check. A successful local test does not establish that cloud-dependent features will work offline.

Choose MQTT delivery settings for the problem you have

QoS, retained messages, and persistent sessions affect message delivery behavior; none creates a network route to a broker that a client cannot reach.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

QoS: acknowledgements, not WAN failover

Eclipse Mosquitto’s MQTT manual defines QoS 0 as at-most-once delivery, QoS 1 as at-least-once, and QoS 2 as exactly-once for the protocol exchange. The publisher’s QoS and subscriber’s requested maximum QoS both affect the delivered level. Higher levels involve additional acknowledgement exchanges, latency, and bandwidth. Use a QoS level appropriate to the message and client support, but do not expect QoS 2 to reach a cloud broker through a failed WAN link.

Retained messages: the latest value, not an event archive

A retained publish lets the broker deliver the latest retained value to a new matching subscriber. That can be useful for current state, such as a sensor’s most recently reported value. It does not preserve every state change as a history.

Retained messages can survive broker or system restarts, so an old value may look current after recovery. Home Assistant warns about stale retained data and “ghost” entities in its MQTT documentation. Where supported, MQTT 5 message expiry can limit how long a message remains available; it does not turn retained state into a full event log.

Persistent sessions: queueing for a disconnected subscriber

With a non-clean session, a broker can preserve a client’s subscriptions and queue subsequent QoS 1 or 2 messages while that subscriber is disconnected, then deliver eligible messages when it reconnects. This helps a temporarily offline subscriber catch up, subject to broker configuration and storage limits. It does not help a publishing device that cannot connect to the broker: there is no broker-side queue for messages the broker never received.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The MQTT standard’s overview of persistent sessions and QoS provides further context. If you need a durable event history, use a system designed to store and retain that history rather than treating MQTT retention or session queues as an archive.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Make device availability visible

A last reported state can remain on screen after a device has lost its connection. MQTT Birth and Last Will and Testament messages can help distinguish a device that has reconnected from one whose connection was lost. A Birth message can announce that a service has started; a Last Will can notify subscribers that a client disconnected. Home Assistant documents availability and these messages in its MQTT integration guidance.

Use availability topics in dashboards and automations so that a stale sensor value is not mistaken for proof that the device is still online. Check how the device and broker handle clean and unclean disconnects before relying on a particular availability signal.

Secure and maintain the local broker

  • Use broker credentials where configured, and keep them available to each client that needs to connect.
  • For encrypted connections, configure certificate validation correctly; Home Assistant’s MQTT options include certificate-validation settings.
  • Keep the broker host and software running and maintained. A local broker removes the WAN from the MQTT path, but it remains a dependency of every client using it.
  • Test recovery after a broker restart as well as after a WAN interruption, especially if you depend on retained state or persistent sessions.

Home Assistant’s MQTT documentation describes credential and certificate options. Specific queue capacity, hardware requirements, and recovery behavior depend on the broker configuration and client; they are not universal MQTT guarantees.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What this setup does not protect against

  • Router or LAN failure: clients may lose their local path to the broker.
  • Broker host failure: clients cannot use a broker that is stopped or unreachable.
  • Power loss: the router, broker host, or devices may stop working.
  • Cloud dependency: a cloud-only device, remote-access feature, or cloud integration can remain unavailable even while local MQTT works.
  • Lost publisher-to-broker connection: QoS and subscriber sessions do not guarantee that a disconnected publisher’s messages are stored for later.

Frequently Asked Questions

Does Home Assistant work without an internet connection?

Local Home Assistant functions and locally communicating devices can continue if the LAN, host, and required services remain available. Features that depend on cloud services or remote access may not work.

Will MQTT QoS 2 keep messages flowing during a WAN outage?

No. QoS 2 defines an exactly-once delivery exchange between clients and a reachable broker; it does not create a route to an unreachable cloud broker.

Do retained MQTT messages save every update while a device is offline?

No. A retained message provides the latest retained value to a new matching subscriber. It is not a complete record of every change.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.