Hi, i tried to read the cpu temperature of my Raspberry Pi 3 with raspbian and Openhab 2. I used exec binding, systeminfo binding, i read a lot of issues about this into the community and guide, i tried everything but i can’t read the cpu temperature with openhab because with the cmd i have no problems. For example systeminfo binding print always 0.0°C and i didn’t find any solutions. Exec binding doesn’t print anything. Is there a solution?
Then i created two items, one linked to the thing (only the second is called into the sitemap file):
String Raspi (All) {channel="exec:command:apc:output"}
Number Raspi_CPU "Temperature CPU [%.1f °C]" <temperature>
finally i created a rules to get the temperature in decimal:
rule "CPU Temp"
when
Item Raspi received update
then
var String cpupdate = Raspi.state.toString.trim
var Number cpuTemp = new DecimalType(cpupdate)
sendCommand(Raspi_CPU, cpuTemp/1000)
end
Did you check on PaperUI Things? After selecting " Show More" the list of channels for your Pi should show under “Sensor” the “CPU Temperature” with the correct channel syntax. You could also link your item from there!