Openhab with raspberry pi and Arduino using MQTT

Hello,
I’m totally new to Openhab. My aim is to setup Openhab on a raspberry pi acting as a server and different arduino boards communicating wirelessly with the raspberry pi using MQTT. For exapmle i want to be able to switch LED on and off and also get teperature reading. i have successfully installed Openhab and MQTT but i dont know what do do net. Please Help. thanks

Next, you can take a look on EasyESP firmware. http://www.esp8266.nu/
It has a mqtt client built-in so makes it easy to talk with OpenHAB

Also, this guide helped me a lot (Part 2 as well)

Be aware that this unofficial guide is for openHAB 1.8. @engrfash stated that he is on 2.0. The guide might still be useful to understand a few details but besides that, you should also look into the official openHAB 2 documentation. It is partly unfinished but still a good starting point: http://docs.openhab.org/overview.html

Regarding your hardware: How are you going to make your Arduinos communicate? If you didn’t buy any till now, consider buying a few ESP8266 instead (as @sasha_jpr already hinted). As for your general approach. That is of course up to you and your experience and willingness to build stuff yourself but consider buying components for the standard tasks to get to a working system faster. These do not have to be expensive, have a look at this for example: ITEAD Sonoff switches and sockets - cheap ESP8266 Wifi+MQTT hardware

thanks alot. that was life saving

Thanks alot. i need cheap and reliable devices that i can control with openhab
1.Light
2. ceiling fan speed control
3. Light dimmer and RGB led
4. door/window sensor
5. Motion sensor
6.window blind
7.sprinkler
8. door lock
can u suggest or recommend some cheap devices because i’m actually building a prototype for a project and i dont have enough finance to buy expensive ones.
thanks alot.

1 Like

If I was making a low powered esp8266 sensor that runs on batteries would easyesp add any overhead vs just uploading my code via the ide?

Easyesp is a bit heavy. You can use something like Homie instead.
https://homie-esp8266.readme.io/docs

1 Like

Thanks @sasha_jpr I’ll take a look into this. Appreciate the direction.

Hello everyone!
I see a lot of people using Raspberry pi with ESP8266 but is it possible to use some kind of wired connection to, e.g. Arduino Nano (ethernet maybe), preferably not USB due to its range limits, and also to connect multiple Arduinos, not only 1 (or max 4 to usb ports)?

Hi everyone, im new here and began past 3 days.
i already installed e config openHab
installed MQTT
instaled the TASMOTA custom firmware on sonoff basic.

Im have some difficult to do the comunication of tasmota and openHab by MQTT.
Someone may help-me?

Thanks in advanced.

For sonoff this topic is a good starting Point:

You should find everything you need there (most needed information all in the first post i think).

If there is something missing after that, feel free to add a specific question over there. :slight_smile: