Set ESP32 output w/o using MQTT

I can read ESP32 input port values directly from Node-RED "Poll State" component (connected via Raspberry Pi running Node-RED).

Now I need to set a binary port of the ESP32 to high or low on certain conditions. Everywhere I read, MQTT is mentioned as the way to do that.
Not familiar with MQTT I am wondering, if it can be true, that setting an output port is that much more complicated that reading an input port of the ESP32. Are there anyone of you, who know of a more “direct way” to access and set ESP32 output ports from Node-RED?

It probably depends on what firmware runs on the ESP: Arduino, Lua, Circuit python, Tasmota, even (a version of) Node-red.

But I don't know any other way than MQTT. That's because I discovered MQTT and it's elegant and simple. No need for anything else.

So my advice is get familiar with MQTT. I doubt if you'll regret the time invested.


Is that a Home Assistant node? How does that get the input port value from the ESP32? Or to put it another way, how is the node red machine connected to the ESP device?

If you are using HA is there not an HA node for driving the outputs? Few here use HA, preferring to do it all in node-red.

I can only agree with @jbudd, make yourself a big favour and start with MQTT. To make a smooth intro then use ESPHome for your ESP32 and you will get going in short time. ESPHome is low coding for such devices, same idea as Node-RED is for automation and others


If you do decide to look at MQTT then this tutorial will tell you everything you need to know. MQTT Essentials - All Core Concepts Explained

Thanks, @jbudd I'll invest some time and get to learn MQTT :+1:

How is the ESP device connected to the node-red machine? What comms protocol is it currently using?

Thanks for your guidance, @krambriw. I will do as proposed.
The Home Assistant and Node-RED combi I am currently running is very convenient in the sense that it allows for polling input port status "out of the box".
It appears that there is no way around using MQTT when working with the ESP32’s output ports… :grinning:

Hi @Colin . Thanks for your guidance. I will check out the tutorial you linked to :pray:
I have connected the ESP32 to my Home Assistant (running on Raspberry Pi) by using ESPHome. It is a very convenient way to work with ESP32. I can highly recommend this way to work with the EPS32 controller :+1:

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.