I just installed OpenHAB2 on my Raspberry Pi 3 and connected some DS18B20 temperature sensors. I am using a script to read the temperature values.
$ /home/pi/openhab/bin/temperature.sh 28-021607e6f5ee
23.43
Now I am trying to get the temperature value into the UI.
My “conf/items/home.items” contanis the following lines:
Group Bedroom
Number Temperature_Bedroom "Temperature [%.2f °C]" (Bedroom) { exec="<[/home/pi/openhab/bin/temperature.sh 28-0116106b80ee:10000:REGEX((.*?))]" }
As I understand the second line, the item uses the Exec-binding and executes this command
/home/pi/openhab/bin/temperature.sh 28-0116106b80ee
…every 10 seconds and uses a regex to extract the return value. In this case the return value could be:
23.43
I can see that the item is working by using the log:tail
command:
openhab> log:tail | grep Bedroom
18:28:17.496 [INFO ] [ome.event.GroupItemStateChangedEvent] - Bedroom changed from 23.42 to 23.43 through Temperature_Bedroom
18:28:17.499 [INFO ] [marthome.event.ItemStateChangedEvent] - Temperature_Bedroom changed from 23.42 to 23.43
So far so good, but i can’t find a way to get this temperature value into the UI…
Would be great if someone could help me
(Sorry, if I created this thread in the wrong place!)