I used python and mqtt to send sensor data to a pi running oh. Th oh pi also has mosquito mqtt broker installed and the mqtt binding. If you have openhabian the mosquitto can be installed from the oh config tool easilly.
The harder part was writing the python on the pi with the sensor and dealing with network connections failures automatically without crashing the sensor pi. I didn’t know anything when I started but was successful after some reading. It took me 1-2 weeks starting from 0 knowledge. So, with the will it can be done even if you’re a beginner.
I am not sure if what I did was the best way but it has been very reliable. The sensor pi just runs and runs and never needs any attention.
I posted an overview of the project here