NEST get values from thermostat

Hi All,

Because OpenHAB brought me much fun I bought a Nest so I can experiment further :slight_smile:

I, however, run into some weird behaviour in reading out the Nest data.

I started with installing the Nest Binding. Then I configured the nest.cfg file with the ID, Secret and Pin number from the website.

In my items file I put:

String NestHome_name “Name [%s]” {nest=“<[structures(Koninginnestraat 73).name]”} // writeable as of 1.9
String NestHome_country_code “Country Code [%s]” {nest=“<[structures(Koninginnestraat 73).country_code]”}
String NestHome_postal_code “Postal Code [%s]” {nest=“<[structures(Koninginnestraat 73).postal_code]”}
String NestHome_time_zone “Time Zone [%s]” {nest=“<[structures(Koninginnestraat 73).time_zone]”}
String NestHome_away “Home/Away [%s]” {nest=“=[structures(Koninginnestraat 73).away]”}
String NestHome_structure_id “Structure Id [%s]” {nest=“<[structures(Koninginnestraat 73).structure_id]”}
Switch NestHome_rhr_enrollment “Rush Hour Rewards Enrollment [%s]” {nest=“<[structures(Koninginnestraat 73).rhr_enrollment]”} // as of 1.9

In my sitemap file I put:

Text item=NestHome_name
Text item=NestHome_country_code
Text item=NestHome_time_zone
Text item=NestHome_away
Text item=NestHome_structure_id
Text item=NestHome_rhr_enrollment

With this I sometimes see some data on the sitemap in Basic UI. However, when I add:

String NestTStat_hvac_mode “HVAC Mode [%s]” {nest=“=[thermostats(Woonkamer).hvac_mode]”}

to the items file, and

Text item=NestTStat_hvac_mode

everything seems to crash, and no data on from all nest items are shown.

What happens here? And importantly what am I doing wrong an how should I fix this?

Would really appreciate some help here:)

Always look at the logs for errors as the first step in debugging problems.

yes. Certainly,

I found: org.apache.commons.beanutils.NestedNullException: Null property value for ‘thermostats(Woonkamer).name’ on bean class ‘class org.openhab.binding.nest.internal.messages.Structure’.

It looks like the name of the thermostat was not right. Maybe Nest maps the translated values of the standard locations for the Nest to English. So I tried “Living Room” instead of the Dutch translation and now things seem to work :slight_smile:

I do have one thing that i notice: Every time that I add a new item, all data from the nest goes away in the sitemap. After some time I can, again, refresh the webpage and the data is show. Has this to do with the 60000ms refresh interval?

Unless you are using persistence with the restoreOnStartup strategy, all of your Items get reinitialized to NULL (i.e. Undefined) whenever OH loads an .items file. You then have to wait for the next refresh from the Nest binding to repopulate the Items.

When using the restoreOnStartup strategy your Item’s states get saved to a database and they get initialized to their most recent value from the database instead of being initialized to NULL.