MQTT upload: Allow configuring the WebSocket path (currently hardcoded to /)
When a broker uses transport: websockets, the uploader always connects on path /:
# custom_components/meshcore/mqtt_uploader.py
if broker.transport == "websockets":
client.ws_set_options(path="/", headers=None)
This works for LetsMesh and MeshMapper. Brokers that serve MQTT-over-WebSocket on a different path can’t be used. One example is MeshView.dk, the Danish MeshCore network analyzer. Its endpoint is wss://mqtt.meshview.dk:443/mqtt, with device auth (JWT) and audience mqtt.meshview.dk. /mqtt is also a common default path for Mosquitto/EMQX WebSocket listeners.
Steps to reproduce
- Add a broker: server mqtt.meshview.dk, port 443, transport websockets, TLS on, auth token on, audience mqtt.meshview.dk, a valid IATA code.
- The broker never connects. The node does not appear on meshview.dk.
Workaround confirmed working
Changing the line locally to use /mqtt for this host makes the connection succeed right away. Status and packets then show up on MeshView:
client.ws_set_options(path="/mqtt" if "meshview.dk" in broker.server else "/", headers=None)
Suggested fix Add an optional per-broker field such as ws_path (default /, so existing configs are unaffected) in the broker config flow, and pass it to ws_set_options(path=...).
Environment
- meshcore-ha: 3.0.4
- Home Assistant config:
- HAOS 2026.10.4
- Supervisor 2026.10.5
- UI version 20260930.5
- Other brokers on the same entry (MeshMapper) work fine over websockets on /.
Disclaimer: I had this problem for several days and threw Claude at it, it instantly found the temporary workaround solution above and it works (confirmed in my HA as showing mqtt1 is connected, and meshview.dk sees my observer as online).
Fix is up in #400: a WebSocket Path field per broker, default /, so set it to /mqtt for meshview.dk. Same ws_set_options call your local patch makes, so it should behave identically. It will be in the next release.
Fix is up in #400: a WebSocket Path field per broker, default /, so set it to /mqtt for meshview.dk. Same ws_set_options call your local patch makes, so it should behave identically. It will be in the next release.
Awesome, and very quick work. Good job!