I2C sensors bindings

openhab2
binding
Tags: #<Tag:0x00007f1e5f377ce0> #<Tag:0x00007f1e5f377ba0>
(Tomasz) #1

I’m in the process of creating my first binding - PCF8574 - https://github.com/openhab/openhab2-addons/pull/5407 and hopefully soon it will be finished.
I’m wondering what binding I should build next.
I’d like to attach two sensors to my Raspberry PI: BH1750 (light intensity sensor) and SHT30/SHT31 sensor (temperature and humidity).
I’m aware there are python scripts that read values from these sensors and they can be used with exec binding, but I’d like to have a native binding that is easy to add and configure.

I’m wondering what might be the best way to build such bindings. Should there be a separate binding for each sensor or maybe there could be one binding called ‘I2C Sensors’ that could handle multiple sensor types.
I’m not sure if this kind of binding (that can handle multiple types of sensors) is even possible to build.

Because I’m new to openHAB and bindings development, I’m searching for a good example showing I2C sensor reading that I could use as a base for building my binding/bindings.

BTW is anyone interested in such bindings?
I’m aware we can use MQTT, esp8266 and ESPEasy, but I want to avoid wireless sensors.

0 Likes

(Tomasz) #2

David_Graeff any thoughts?
I’ll wait till binding development will work again and I want to give those two (BH1750, SHT31) a try.
Do You think those will be a useful bindings?
Any binding I can use as a template?

0 Likes