Hi,
i am reading temperature and humidity with a DHT11 sensor at the openhab raspberry.
I am runing a command using the exec binding.
This is my python script:
#!/usr/bin/env python
import Adafruit_DHT
sensor = Adafruit_DHT.DHT11
pin = 4
humidity, temperature = Adafruit_DHT.read_retry(sensor, pin)
print(humidity)
This is my thing:
Thing exec:command:buero_humidity “Buero - Luftfeuchtigkeit” @ “Buero” [command=“/home/openhabian/Adafruit_Python_DHT/examples/AdafruitDHT_hum.py”, transform=“REGEX((.*?))”, interval=15, timeout=10, autorun=true]
This is my item:
Group Klima_Buero_Diagramm “Raumklima Buero” (FF_Office)
String Buero_Humidity “Luftfeuchtigkeit [%.1f %%]” (Klima_Buero_Diagramm) { channel=“exec:command:buero_humidity:output” }
In the paper ui control the value is displayed correct. However in the sitemap frame FF_Office it is written “Err”.
This is the log info:
[WARN ] [ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value ‘47.0’ of item Buero_Humidity with format ‘%.1f %%’: f != java.lang.String
Can i read the value as a Number or display a String correct in the sitemap?