Using nodemcu with Openhab

Hi All,

I am new to openhab and started experimenting with nodemcu few days ago. I was able to use the nodemcu with Blynk to control relays over internet, however need help with controlling the GPIO of nodemcu from within Openhab. I have installed easyesp in my nodemcu and it is getting connected to internet, however I could not understand what settings are required in Openhab to control the pins of nodemcu from openhab. Can somebody list a step by step procedure for controlling a pin of nodemcu from openhab. I have openhab installed on a raspberry pi 3. I just want to use the GPIO as a output pin to control a relay from within openhab.

1 Like

Not a step by step guide, but MQTT should be something to look into

Thanks for the prompt reply Ralf, however I have already installed mosquitto MQTT in openhab. However, I am not sure where to go after that.

Just install ESPeasy

Hi Andrew, as I have mentioned, I have already installed ESPEasy on the nodemcu and the nodemcu is even getting connected to the internet. But, What are the exact settings required on the nodemcu and openhab is what I need to know.

Looking forward to somebody either giving me a step by step instructions or pointing to a resource which explains me the entire process.

1 Like

You will need to configure MQTT in ESPEasy. Normally you don’t need to configure GPIO until you want to inverse the logic.
I’ve posted my working example here
Please take a look.

Thanks for the reply AndrewZ. What I don’t understand is, though, where to put that command which is mentioned in your working example.(itch SSR “SSR on nodeMCU (ESP Easy mqtt)” { mqtt=">[broker:esp1/gpio/2:command:ON:0], >[broker:esp1/gpio/2:command:OFF:1]" }

Read the following in order:

http://docs.openhab.org/tutorials/beginner/index.html

http://docs.openhab.org/introduction.html

http://docs.openhab.org/addons/bindings/mqtt1/readme.html

2 Likes

that is not a command but definition of the item in your .items file