I dont understand what MQTT is and what role it plays in my HA ecosystem. Is it a separate device or is it hardware? Im not sure its role. I currently have a veralite and a HA box running on a Linux vm.
Also, not sure about UPNP and what role it plays. Can someone help by explaining these 2 technologies and examples of how they’re leveraging them in their system?
MQTT is a way for the physical devices on your system to talk.
They generally all talk to one entity, called the broker. The broker distributes the messages to those other devices who are interested, the clients. The broker is a program, it can be run on a separate device, or it can share a device with other prgrams. My broker runs on the same machine as my HASS.
The beauty of MQTT is that it’s fast, and takes less data than, say, TCP/IP messages. e.g. when you press a light switch, you need a response within 100ms for it to ‘feel right’.
My installation:
I have a sensor box outdoors, this measures temperature and daylight level. It sends readings every 2 minutes to my Broker. The messages are carried by MQTT over a wifi link.
I also have an infra-red beam detector to sense presence (PIR is too unreliable, we have bats…). It too sends events by MQTT over wifi. This is ~150m from the house.
Broker first sends the messages to HomeAssistant. HASS makes decisions for me about switching things
Hass decisions are sent back out via the Broker to other physical devices using MQTT, over wifi. These other devices are my relays, lights, valves etc.
Now, if all these devices were merrily transmitting to all the other devices, and every device had to listen to every message, things would become very busy very quickly (with lots of redundant information flying around).
The beauty of MQTT is that it only listens to messages it’s intended to listen to; and it only passes on relevant messages to interested devices.
As for UPNP, I don’t understand it myself, so I look forward to other replies!
Ok so MQTT and UPnP serve the same purpose but have take different approaches? @impvan provided some scenarios where he leverages MQTT. Can you provide some examples of how UPnP is used in an automation scenario?
Also, even though I explicitly added UPnP to my configuration.yaml file (by following the instructions on the UPnP HA Page), I receive the following error on my HA home page. I confirmed that UPnP is enabled on my router.
Invalid Config: The following components and platforms could not be setup. upnp