Nest items display in debug mode but not "automated" OH2 startup

I’ve recently switched from OH1 on a raspberry pi to OH2 running on an Ubuntu server on virtual-box. I’ve been successful in setting up date/time, weather, Z-Wave switch, and MQTT publishing on OH2, but I’m having an issue displaying Nest thermostat items. All Nest fields display properly when OH2 is started with ./ or ./ but when OH2 starts at the normal “system startup”, the Nest items do not appear. Although the Nest items do not appear, the other items work fine. Nest items are my only issue. I’m not sure where to look without the debug log.

Below is an image of a normal system startup where item values are not displayed.

Thanks in advance for any information.

The issue may be with the Linux user under which the OH2 server is running. The Nest binding keeps its access token (and a copy of the PIN used to obtain it for comparison to see if the access token is valid) using the Java Preferences API. The Java Preferences are stored under the “user root,” and if the user running the server is different, the token is not found.

If you turn on binding DEBUG log entries (or TRACE for even more verbose logs) using

openhab> log:set debug org.openhab.binding.nest

it might offer more information, but I suspect it has to do with where the access token was stored when it was first obtained. The PIN is no longer valid after it’s first used to obtain the token.

You are absolutely correct watou. I changed the user ID from “openhab” to “root” by using the following command and saving the resulting systemd unit file:

sudo systemctl edit --full openhab2.service

I rebooted the Linux VM and my Nest items now appear as expected.

Thank you for all you do.

1 Like

Just to be clear, “user root” doesn’t refer to the root user. “User root” is a term from the Java Preferences API. (See this link and search the page for the phrase userRoot). But even if that phrase caused confusion, it seems you’ve ended up with a good solution, as long as you don’t mind the security aspects of running the server as the root user.