5

I am using a voltage sensor which communicates over I²C, a Python script is handling all the communication and logic in a Raspberry Pi. Since I want to switch to openHAB I am wondering how to read that sensor, basically code a binding, without the use of Java.

My idea is to run a small Python script, which uploads the current value to a local MQTT server, which makes me worry about network overhead and performance.

Is there any other way to implementiert such a binding in Python? I really want to stick with that since the sensor only has library support written in Python.

1

There is a solution provided here at stackoverflow:

https://stackoverflow.com/questions/42932618/send-commands-to-openhab-depending-on-light-sensor-values-python-raspberry-pi

Which sends the data directly to the OpenHab using python only. There the user has sent DHT11 sensor data on the condition but all you need is to check the method to send the data to the OpenHab.

Below is the link to the Question asked on the OpenHab forum about sending the RPi data to the OpenHab. Please go through the whole conversation so you can get the idea or different problems that you can face during implementation and their dedicated solutions.

Send temperature from RPi to Qnap OpenHAB

| improve this answer | |
0

I ended up just implementing everything, including local services as Homie devices, which makes integration in openhab extremely simple and allows to quickly run those services on other devices withouth the need to reconfigure anything.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.