Enable NATS support for HomeAssistant

Would be really great if someone could enable NATS support for HomeAssisstant as an MQTT alternative (https://nats.io) :slight_smile:

That looks like a very nice piece of technology. But what would having it contribute in terms of functionality or integrations we do not currently have? Are there IOT solutions out there we could use it for?

How is it an MQTT alternative?

NATS is an message broker comparable to MQTT. It could even receive MQTT messages and deliver them over the NATS network, so if a client device is only capable of speaking MQTT it could still be used in a NATS setup. NATS is more and more used in the industry (Kubernetes, IoT, Edge Nodes)

2 Likes

My plan is to use NATS as a communication system between multiple servers (edge nodes in NATS terms) and Home Assistant. Some connections are not very reliable and the servers are reconnecting from time to time (not a configuration problem more a problem of the location and the LTE connectivity on the remote location). Currently I use MQTT with bridges but the results are not that great for missed messages/messages send during an interruption. I hope to increase reliability with NATS.

1 Like

Yes I read more about nats and found some stuff on mqtt. Can you drop a nats server in, configure it, and it’s a drop-in replacement for eclipse?

I’m not against your request, but this scenario is exactly why MQTT has QOS settings:

  • At most once (QoS 0)
  • At least once (QoS 1)
  • Exactly once (QoS 2)
1 Like

I’ve read about this and tried already to set it up that way but I still had some missed messages from time to time. Maybe I will dig into my configuration once again.
But nevertheless NATS would be a great addition in my eyes for HomeAssisatant :wink:

If someone already has this working in a docker, building an addon should be a piece of cake. Build it or get some help and build it. Then add a share your projects post here…

There’s no replacing (At least VERY rarely), but rather alternatives in HA.

1 Like

There seem to be plenty of hits for “nats docker”

https://hub.docker.com/_/nats

This seems interesting from a quick glance at this. Sounds useful.

Also, don’t forget to vote for your own post @ OP