openhab / openhab1-addons

Add-ons for openHAB 1.x
Eclipse Public License 2.0
3.43k stars 1.69k forks source link

[Tinkerforge] Support Humidity 2 bricklet #5392

Open korpa opened 6 years ago

korpa commented 6 years ago

Please support the Tinkerforge Humidity 2 bricklet: https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Humidity_V2.html

LukeLER commented 6 years ago

There are lots of new Bricklets which are not supported in openHAB at the moment. Unfortunately... It is on our Todo list to create new bindings for our Bricklets.

stefan-kaestle commented 6 years ago

I realize that this is not really a clean solution to your problem, but I am simply using openhab's REST API to update values of the bricklets that I have and are not supported by the openHab binding.

I wrote a small Python program based on the weather station example (https://www.tinkerforge.com/en/doc/Kits/WeatherStation/PythonToLCD.html#starter-kit-weather-station-python-to-lcd) that retrieves values from all bricklets via callbacks from the official Python API.

The function to send these values to openHab looks like this:

def update_openhab(self, item, value):
    url = 'http://localhost:8080/rest/items/%s' % item
    log.debug("Setting OpenHab item %s: %s" % (item, value))
    response = requests.post(url, data=value)
    log.debug("Result: %d" % response.status_code)

This of course is a temporary solution, but allows me to use all my brickets