Reading Raspberry Pi CPU temp with Exec binding

rtvb, sorry for my late reply, had some other issues to solve. I still have problemas with my CPU Temperature. But different behavior - now I get “- °C” on sitemap. It follows my files to your evaluation, if possible. Thank you once again!


Number CPU_Temp "Temperature CPU [%.1f °C]" <temperature> { exec="<[cat /sys/class/thermal/thermal_zone0/temp:10000:REGEX((.*?))]" }


Text item=CPU_Temp icon="temperature"

Didn’t paste the milli.js, becaues I am using the REGEX transformation. There is no need for REGEX transofrmsation file?

As I mentioned before, openhab and openhabian are both on video group.

Sorry for some dumb question, I am rookie to programming and Openhab as well.

Hi Community

Unfortunately I have the same problem.
No matter what I adjust I get the CPU temperature from my Raspberry not spent in Openhab.
I have tried different methods but without success.

Number System_Temperature_CPU "CPU temperatuur [%.1f °C]" <temperature> (System)     {exec="<[cat /sys/class/thermal/thermal_zone0/temp:30000:JS(milli.js)]" }
Number System_Temperature_CPU02 "CPU temperatuur [%.1f °C]" <temperature> (System)   {exec="<[cat /sys/class/thermal/thermal_zone0/temp]" }
Number CPU_Temp "Temperature CPU [%.1f °C]" <temperature> (System_Temperature_Chart) {exec="<[cat /sys/class/thermal/thermal_zone0/temp:10000:REGEX((.*?))]" }

Frame label="Raspberry"
                        Text item=System_Temperature_CPU	
                        Text item=System_Temperature_CPU02
                        Text item=CPU_Temp			
milli.js in transform folder

(function(i){ return i / 1000; })(input)

Exec Binding 2.0.0 is installed.
How can I test if the exec binding works at all?
This is the output on my sitemap: CPU temperatuur - °C

In the console with “cat /sys/class/thermal/thermal_zone0/temp” the temperature is displayed to me.
I have add the user openhab and openhabian to the video group.

Has anyone a solution for me to solve the problem?