Explain the point of MQTT to me

i’ve ordered some SONOFF switches, and i know i have to flash them with new firmware so they use MQTT to connect to HA.

but, why?

why does the MQTT need to be there in the middle? why can i not connect to the switches to HA directly? what is the benefit of having MQTT?

i guess i’m a little lost on what exactly is MQTT’s purpose.

MQTT is a lightweight standardized communications protocol. MQTT is how the switch communicates state to HA and how HA sends commands to the SONOFF. The default SONOFF firmware doesn’t integrate with HA. What you’re flashing is a replacement that does.

1 Like

MQTT is supported by most, if not all home controllers (Openhab, Domitz, Homegenie etc). There are also clients for android, iphone and other operating systems that can be used to control switches.

The authors of the new firmware could have written something that enabled a direct connection, but it would unlikely to be as widely used as MQTT.