I am having a terrible time reading an input switch on my raspberry pi in the GUI. I wrote a python script and was able to see the status change there.
Items file
Group All
Group gGroundFloor (All)
Group GF_Living “Living Room” (gGroundFloor)
//Temp Sensors 1
//Temp Sensor 128-000007647f9
Number DS18B20_temperature_28000007647f9e “Water temperature [%.1f °F]” (GF_Living) { exec="<[/home/pi/temp.py 28-000007647f9e:60000:REGEX((.*?))]" }
OPEN=Water Detected
CLOSED=Dry
```
The sitemap would contain:
Text item="Water_Detection"
Your rule would be:
```java
rule "Water detected"
when
Item Water_Detection changed to CLOSED
then
// send alert
end
```
You will probably have better luck asking the manufacturer or a forum more specific to that sensor. I’ve never even heard of that sensor and wouldn’t begin to know how to read the data off of it and I’ doubt there are many if any others on this forum who can help.
The problem with temperature sensors and the like is they implement a protocol for communicating their value to the Pi. It isn’t as simple as On/Off like a button or reed switch would be.
This is temp sensor DS18B20. In raspbian os, they named 28000007647f9e (or 2800000*)
I am interested in how read themperature in Raspbery and display in openHab?
What code in Python file /home/pi/temp.py?
This is an openHAB forum. Not a DIY electronics forum. Not a Raspberry Pi forum. The number of users on this forum who could begin to help with this is very small. Once you have some Python script reading the values we can help.
You need to find a generic Raspberry Pi forum, check for a tutorial on AdaFruit or some similar website, and reach out to a wider and more appropriate audience who will be able to help.