Troubleshooting Shelly H&T Gen2 Disconnections in Home Assistant

Troubleshooting Shelly H&T Gen2 Disconnections in Home Assistant

If you're using Shelly H&T Gen2 sensors with Home Assistant, you may have encountered issues with frequent disconnections of the Outbound WebSocket. This problem can be frustrating, especially if your setup was working reliably for months before the issue appeared. Here, we'll discuss potential causes, troubleshooting steps, and alternative integration methods to improve reliability.

Symptoms of the Issue

  • Shelly H&T entities in Home Assistant appear as unavailable.

  • The Shelly app reports that the Outbound WebSocket is disconnected.

  • Disconnections occur randomly—sometimes linked to power outages or network issues, other times without an obvious cause.

  • The Shelly cloud app continues to show accurate temperature and humidity data.

  • Reconnecting requires a complex process involving factory resets and reconfiguration.

Quick Fix: How to Reconnect an Outbound WebSocket

Instead of deleting and factory resetting your devices, try these steps for a quicker reconnection:

  1. Reboot the Shelly Plus H&T – This forces it to attempt reconnecting to the WebSocket.

  2. Modify and Save Settings – Making any small configuration change (such as re-entering MQTT settings) and saving it forces a reboot, which can re-establish the connection.

  3. Ensure Stable Network Conditions – Poor WiFi performance can contribute to frequent disconnections.

More Reliable Integration Methods

Since the Outbound WebSocket method has been reported as fragile, consider these alternative integrations for improved reliability:

1. Use MQTT Instead of WebSockets

MQTT (Message Queuing Telemetry Transport) is a more stable method for integrating Shelly devices with Home Assistant. Follow these steps to configure MQTT for Shelly H&T:

How to Set Up MQTT for Shelly H&T Gen2

  1. Enable the MQTT Add-on in Home Assistant (if not already installed).

  2. In Home Assistant, navigate to Settings → Devices & Services → Integrations and add an MQTT broker (such as Mosquitto Broker).

  3. On the Shelly H&T Web Interface:

    • Go to Settings → Internet & Security → MQTT.

    • Enter your Home Assistant MQTT broker IP address, username, and password.

    • Set the topic prefix to something like shelly/ht/<device_id>.

  4. Save settings and restart the Shelly H&T.

  5. Home Assistant should now auto-discover the Shelly H&T as an MQTT device.

Final Recommendations

If your Shelly H&T Gen2 continues to disconnect, try the following:

  • Switch to MQTT integration for more stable communication.

  • Ensure your WiFi network is strong and consistent.

  • Avoid factory resets unless absolutely necessary—try modifying settings first.

  • Consider upgrading to Shelly H&T Gen3 for better performance.

By following these steps, you can reduce downtime and ensure accurate temperature and humidity monitoring in your Home Assistant setup.

Back to blog

Leave a comment

Please note, comments need to be approved before they are published.