Some advices for the system

I’m begginner and I would like a system using a Raspberry and Arduino.

Is it possible?

  • Client send data to Web Server by a browser;
  • Web Server (Raspberry Pi running openHAB) which connect with Arduino;
  • Arduino control the sensors;

How is the connection between arduino and rasp? MQTT?
Can someone give me tips or tutorials?

Well, for MQTT the arduino needs to have WLAN/LAN access to the MQTT broker.
This would be possible for ESP8266 and ESP32 and e.g. the pubsubclient library.
But an Arduino doesn’t have a Ethernet or WiFi chip.

So what kind of arduino are you using?

Im using arduino mega 2560 r3 and ESP8267 12E.

Fine, so you just need to connect the ESP to your WiFi and setup e.g. pubsubclient (https://github.com/knolleary/pubsubclient).
Now you can send and receive MQTT messages with your ESP.

Make sure to read the OpenHab MQTT Binding documentation as well:
https://docs.openhab.org/addons/bindings/mqtt1/readme.html

For a quick start, i would create a simple item that displays a text on your sitemap. This item subscribes to a MQTT topic which is sent to your MQTT Broker from the ESP.

Thank you so much.
I’m gonna try.