Need help understanding MQTT/RPI3B from Home Assistant

Hi everyone,

Been a long time lurker but I never had anything to automate (I do i just don’t have the resource) and never got far with home assistant.

Right now I have a pc setup as a home media server and Home Assistant core is installed with venv, I manage to flash a wemos D1 mini with tasmota that is currently only connected to a DHT11 that is constantly publishing the temp and humidity from mqtt and showing a 24h graph it in homeassistant, I would really like to use the other GPIO pin available but that is another topic for another time.

What I would want to learn to do now is something similar to this where I have 1 instance of home assistant and communicate with a network of mqtt device. Say if I have a raspberry pi setup with mqtt broker (if needed, or maybe just a client) and maybe node-red (do i even need node-red in the pi if I already have it up in home assistant in the pc), and to listen/control or automate a few relay that is connected to some lights.

p/s: Also I’m using raspberry pi 3B and not 4 but i can’t seems to find the pi3b tag.

Especially when using Wemos D1 I suggest using ESPHome and it‘s HA integration. No need to use MQTT here.

Yet, MQTT is a universal message bus system and is neatly integrated into HA. You need a dedicated, central MQTT broker and HA and other devices will become clients.

For context, I’ve been watching way too much yt vids and accepting the way things are being done as the default solution because I never get to play and test out different solution.

Anyway, how would I setup ESPhome as suggested by you and how different is this compare to the mqtt way?

I think I still have one d1 mini that i can try hooking it upbut i have nothing to test it on apart from lighting a few leds (bought it all during a clearance from a local electronic store)

Installation instructions for ESPHome are on the website. Use the wizard to create a new project, add the sensors you have, let build and flash the firmware to the D1.

If you have discovery enabled in HA and use host network, the ESPHome integration will pop-up and requires no further configuration. Otherwise you have to install the integration manually and provide the IP of the D1.

Main difference is that MQTT is indirect and asynchronous, but more fault tolerant and more generic.

1 Like

I manage to installed the cmd line option with python, still can’t get it to be added into the side panel in home assistant.

I must say setting it up is way easier for ESPHome, i remember having to solder a few thing for some sonoff and d1 mini just to flash the board.

Correct me if I’m wrong but by asynchronous do you mean it can trigger a whole group of switch at the same time? And could you explain more on the fault tolerant part?

I think you mixing up the ESPHome Add-On with the ESPHome integration. The later is the only available option for HA installations that do not use a supervisor (HA OS, HA Supervised).

Benefit of the add-on (which I do not use) is that you can configure and flash devices from Home Assistant.

No. MQTT is a message broker, a device sends an event or HA sends a command to the a topic and whoever has subscribed to the appropriate topic is invited to react - now or later.

With the native integration it‘s 1:1 between HA and the device.

Btw: You can use Groups in HA to address multiple entities (switch, light) at once.

1 Like