- Platform information:
- Hardware: Raspberry Pi 4 ARMv8/4GB RAM/32GB SD card
- OS: Raspbian Lite 2019-07-10
- Java Runtime Environment: openjdk-8-jre-headless:armhf 8u212-b01-1+rpi1
- openHAB version: openhab2 2.4.0-1
- Issue of the topic: please be detailed explaining your issue
On a new installation, I try to read the CPU temp of the raspberry pi into an openhab item, using only configuration files. After creating the configuration files and watching their effects in the log viewer, I use PaperUI control to inspect the temperature value. It shows me that the latest value is minus not-a-number (-NaN), but it should be around 40 degrees (or 40000 millidegrees).
in the exec binding, I initially used the command
sed -e 's/\(.*\)\(...\)$/\1.\2/' /sys/class/thermal/thermal_zone0/temp
to convert from millidegrees to degrees, but then changed to the cat command that you see in the .things file below because I escaped the backslashes to double backslashes in the .things file and did not know if this is correct.
- Please post configurations (if applicable):
-
Items configuration related to the issue
cat /etc/openhab2/items/raspberry_pi.itemsNumber RaspberryOpenhabTemperatureValue “[%.1f C]” (All) {channel=“exec:command:RaspberryOpenhabTemperature:output”}
-
cat /etc/openhab2/things/raspberry_pi.things
Thing exec:command:RaspberryOpenhabTemperature [command="cat /sys/class/thermal/thermal_zone0/temp", interval=15, timeout=5, autorun=false]
-
Sitemap configuration related to the issue
-
Rules code related to the issue
-
Services configuration related to the issue
grep -v ^# /etc/openhab2/services/addons.cfg | uniqbinding = exec
transformation = regex -
If logs where generated please post these here using code fences:
tail -f /var/log/openhab2/openhab.log /var/log/openhab2/events.log
2019-07-14 23:11:53.948 [INFO ] [thome.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007
2019-07-14 23:12:06.901 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at http://192.168.178.36:8080
2019-07-14 23:12:06.904 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at https://192.168.178.36:8443
2019-07-14 23:54:02.920 [thome.event.ExtensionEvent] - Extension 'package-standard' has been installed.
2019-07-14 23:54:08.780 [INFO ] [ebuilder.internal.HomeBuilderServlet] - Started Home Builder at /homebuilder
2019-07-14 23:54:08.879 [INFO ] [panel.internal.HABPanelDashboardTile] - Started HABPanel at /habpanel
2019-07-14 23:54:09.255 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui
2019-07-14 23:54:09.286 [thome.event.ExtensionEvent] - Extension 'ui-homebuilder' has been installed.
2019-07-14 23:54:09.289 [thome.event.ExtensionEvent] - Extension 'ui-basic' has been installed.
2019-07-14 23:54:09.293 [thome.event.ExtensionEvent] - Extension 'ui-habpanel' has been installed.
2019-07-14 23:54:09.294 [thome.event.ExtensionEvent] - Extension 'ui-paper' has been installed.
2019-07-16 11:15:36.827 [INFO ] [basic.internal.servlet.WebAppServlet] - Stopped Basic UI
2019-07-16 11:15:43.485 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Stopped Paper UI
2019-07-16 11:15:43.509 [INFO ] [panel.internal.HABPanelDashboardTile] - Stopped HABPanel
2019-07-16 11:15:43.517 [INFO ] [ebuilder.internal.HomeBuilderServlet] - Stopped Home Builder
2019-07-16 11:15:43.562 [INFO ] [.dashboard.internal.DashboardService] - Stopped Dashboard
2019-07-16 11:15:52.735 [INFO ] [panel.internal.HABPanelDashboardTile] - Started HABPanel at /habpanel
2019-07-16 11:15:52.866 [INFO ] [ebuilder.internal.HomeBuilderServlet] - Started Home Builder at /homebuilder
2019-07-16 11:15:59.076 [INFO ] [thome.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007
2019-07-16 11:16:00.138 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at http://192.168.178.36:8080
2019-07-16 11:16:00.141 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at https://192.168.178.36:8443
2019-07-16 11:16:00.419 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui
2019-07-16 11:17:54.017 [thome.event.ExtensionEvent] - Extension 'binding-exec' has been installed.
2019-07-16 11:33:59.172 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'raspberry_pi.things'
2019-07-16 11:33:59.318 [hingStatusInfoChangedEvent] - 'exec:command:RaspberryOpenhabTemperature' changed from UNINITIALIZED to INITIALIZING
2019-07-16 11:33:59.331 [hingStatusInfoChangedEvent] - 'exec:command:RaspberryOpenhabTemperature' changed from INITIALIZING to ONLINE
2019-07-16 11:33:59.359 [WARN ] [hab.binding.exec.handler.ExecHandler] - Couldn't transform response because transformationService of type 'REGEX' is unavailable
2019-07-16 11:34:00.363 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'raspberry_pi.things'
2019-07-16 11:34:14.418 [WARN ] [hab.binding.exec.handler.ExecHandler] - Couldn't transform response because transformationService of type 'REGEX' is unavailable
2019-07-16 11:34:29.443 [WARN ] [hab.binding.exec.handler.ExecHandler] - Couldn't transform response because transformationService of type 'REGEX' is unavailable
2019-07-16 11:34:44.469 [WARN ] [hab.binding.exec.handler.ExecHandler] - Couldn't transform response because transformationService of type 'REGEX' is unavailable
... Repeats until ...
2019-07-16 11:54:31.355 [WARN ] [hab.binding.exec.handler.ExecHandler] - Couldn't transform response because transformationService of type 'REGEX' is unavailable
2019-07-16 11:54:31.409 [thome.event.ExtensionEvent] - Extension 'transformation-regex' has been installed.
2019-07-16 12:06:09.855 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'raspberry_pi.items'
2019-07-16 12:06:09.932 [.ItemChannelLinkAddedEvent] - Link 'RaspberryOpenhabTemperatureValue-exec:command:RaspberryOpenhabTemperature:output' has been added.
2019-07-16 12:06:10.952 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'raspberry_pi.items'
2019-07-16 12:20:58.311 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'raspberry_pi.things'
2019-07-16 12:20:58.357 [me.event.ThingUpdatedEvent] - Thing 'exec:command:RaspberryOpenhabTemperature' has been updated.