Nest - Can read but not update

Hi all,

I’m very new to OpenHab and as a first project I wanted to get it working with my Nest thermostat - I have an interesting problem that seems similar but not the same as others on this forum.

I’ve set up three items related to my Nest:

String  home_away       "Home/Away [%s]"        <present>       { nest="=[structures(Home).away]" }
Number  downstairs_temp "Downstairs Temp  [%.1f °C]"    <temperature>   { nest="=[thermostats(Living Room).ambient_temperature_c]" }
Number  living_room_target_temperature_c        "Target Temperature [%.1f]"     { nest="=[thermostats(Living Room).target_temperature_c]" }

All of these items correctly update, showing these respectively:

Away Status
Current Temperature
Target Temp

Also, I’ve set the sitemap to display these, and allow me to amend Target Temp:

Frame label="home"{
        Switch item=home_away mappings=[home="Home",away="Away"]
        Text item=downstairs_temp
        Setpoint item=living_room_target_temperature_c label="Target Temperature [%.1f °C]" minValue=0 maxValue=40 step=1
}

These all display the value fine (e.g. it hooked up to the Nest API and is reading back)- but I cannot get it to change the temperature or away status. Having enabled TRACE level logging I get these lines when trying to set the temp (I’ve partially blocked out my keys:

2016-05-20 14:53:57.075 [DEBUG] [.o.b.nest.internal.NestBinding] - About to set property 'thermostats(Living Room).target_temperature_c' to '10.0'
2016-05-20 14:53:57.078 [TRACE] [.o.b.nest.internal.NestBinding] - Data model for update: DataModel[devices=DataModel.Devices[thermostats={Q1DhGrdlGQOvhOJeTEA7DeW9-XXXXXX=Thermostat[device_id=<null>,name=<null>,locale=<null>,software_version=<null>,structure_id=<null>,name=<null>,name_long=<null>,last_connection=<null>,is_online=<null>,can_cool=<null>,can_heat=<null>,is_using_emergency_heat=<null>,has_fan=<null>,fan_timer_active=<null>,fan_timer_timeout=<null>,has_leaf=<null>,temperature_scale=<null>,target_temperature_f=<null>,target_temperature_c=10.0,target_temperature_high_f=<null>,target_temperature_high_c=<null>,target_temperature_low_f=<null>,target_temperature_low_c=<null>,away_temperature_high_f=<null>,away_temperature_high_c=<null>,away_temperature_low_f=<null>,away_temperature_low_c=<null>,hvac_mode=<null>,ambient_temperature_f=<null>,ambient_temperature_c=<null>,humidity=<null>,hvac_state=<null>]},smoke_co_alarms=<null>,cameras=<null>],structures=<null>]
2016-05-20 14:53:57.086 [TRACE] [b.n.i.messages.AbstractRequest] - About to execute 'https://developer-api.nest.com/?auth=c.WbIXXXXXXt8aByBNU9k22baLQdbLNiNXCroS0TJeNp6HwnbOQrmNbHu4l2M4KtnIrjxRa4sP3pljdKviX3XUo53VMwHv19XXXXXmMikQGBe2IhXulkDHwLPHfIletVCPhZsQldwQjGCXXXX'
2016-05-20 14:53:57.665 [WARN ] [b.n.i.messages.AbstractRequest] - Method failed: HTTP/1.1 400 Bad Request
2016-05-20 14:53:57.668 [TRACE] [b.n.i.messages.AbstractRequest] - {"error":"Write Error","type":"https://developer.nest.com/documentation/cloud/error-messages#write-error","message":"Write Error","instance":"xxxxxxxx-005c-472b-xxxx-e63603f45ad2"}
2016-05-20 14:53:57.671 [ERROR] [.o.b.nest.internal.NestBinding] - Error updating data model: DataModelResponse[devices=<null>,structures=<null>]

I assume it’s because the Device_ID and/or Name being sent to the Nest API is NULL, but I can’t see why this is happening?

What have I missed?

I’ve created a whole new Product in the Nest Developer site, exactly the same issue

  • Can read fine
  • Cannot write values back out

Banging my head against the wall with this one…

That’s a new one on me. The JSON being sent to the Nest API seems to be valid (based on the toString() output of the objects). Two questions:

  1. Do you have extra devices paired with “Works with Nest” from other manufacturers?
  2. Exactly how did you create your Product at Nest? Could you provide any screenshots with private information redacted?

Hi

It’s a basic UK Nest set up, no other Works With Nest products set up. I did a while ago have a Python script querying the API to pull down the temperature and log to InfluxDB, but it worked using the Username and Password rather than anything API related. This is also disabled now and has been for a few days. I can’t think that it would have left anything in an inconsistent state - but if it did how would I go about resetting it?

Product is set like this:

FYI I’ve deleted the above product after missing something in the redaction - however I’ve set the new product up in an identical way and still get the same error.

Interesting I screwed the setup of the new product so it could only READ the temperature, and when I tried to write to it it gave this error:

2016-05-20 16:20:18.882 [TRACE] [b.n.i.messages.AbstractRequest] - {"error":"No write permission(s) for field(s): target_temperature_c","type":"https://developer.nest.com/documentation/cloud/error-messages#no-write-permission","message":"No write permission(s) for field(s): target_temperature_c","instance":"65f9d469-a01f-xxxx-xxxx-xxxx0a29be10","details":{"fields":"target_temperature_c"}}

On granting the permission and generating a new PIN we’re back to the original error when I try to update

The above link in the error response says

You’ll get this message if there’s an error when writing resource use data.

But I can’t figure out how that relates at all to this circumstance. So either the documentation is wrong, there is a service problem (but their status page doesn’t report one), or there is still something off about the Product you created.

I see in the screenshot something odd, that the thermostat permission is read/write v4, but they recently updated it v5. So how can you even create a new Product with a v4 read/write permission?

…also, I assume you were getting a new PIN after each change/create of a Product, and pasting that into your openhab.cfg along with the matching client_id and client_secret?

That was my original product I set up last week - looks like V5 came out this week? I set up a new product yesterday from scratch after posting my un-redacted screenshot:

Same issue, even after updating the Client ID, Secret and PIN.

One question - I assume it’s my Nest account I active when the PIN is generated rather than the device? My rPi is headless so I’ve been authorising the account on my laptop but editing the openhab.cfg via SSH?

Looks like this one is a bit of a headscratcher - and I appreciate you looking at it and the time you’ve spent so far

Yes; they added the ability to change whether the thermostat displays C or F. Previously it was read only. I have yet to update the wiki after my update to the binding. You could try the latest JAR, but I’m doubtful it would make any difference here.

Correct – it doesn’t matter from where you generate the PIN, as long as you are logged into the Nest.com user account you intend to target. And the PIN seemed like an unlikely area of problems, or you would almost certainly not even have read access.

Have you ever received, or received an accurate-seeming, monthly Nest report email (subject could be “Nest April Report for Home”)? In the weird possibility that the documentation is correct, and the write error does in fact refer to “writing resource data”, then it could be an issue on the Nest service side. I wonder if Nest Support could inspect the state of your user account to look for problems?

And your previous Python script that used your username/password was using the unofficial API, which is at least one layer lower than the official Firebase/REST API, and it sounds like it was only pulling data and not trying to POST changes. I think the mobile and web apps still use the unofficial API, so this issue probably wouldn’t show there.

I would encourage you to try to get Nest’s attention on this strange issue, because I’m out of ideas at the moment. :worried:

John

I’m new here as well. I just wanted to point out that I’m in the exact same boat as pryonic. Total beginner here trying to get my nest set up as a first product. I also can read but not write, with the same error.

The only difference in our setups is that I am US and he is UK.

I just encountered the error and this page was the first thing I saw on google :slight_smile:

Let me know if you guys think of anything, I’ll keep looking around myself.

My Nest binding setup is allowing me to set target temperature with no errors:

{ nest="=[thermostats(Dining Room).target_temperature_f]" }

This is against a US account, if that matters. Maybe something broke with the May 2016 API update on the service side? Please report here if anyone sees other reports of API breakage from other integrations.

It may not be related, but here are the permissions I used above:

Do you have a lock set up on the thermostat? It won’t write anything if a lock pin is enabled.

I don’t have a lock on my thermostat, but I’m wondering if it has anything to do with the permissions - I am use Thermostat read/write v5 while watou is using v3. I’ve also tried the latest jar with no luck.

Here is a screenshot of my permissions, against a US account as well.

Thanks for all your help so far… this is all new to me - hopefully I’ll get the hang of it soon!

I’ve created a new Nest product with the latest permissions in my setup, but for various reasons I have to wait until it warms up before I can test to see if the difference between Thermostat read/write v3 and v5 permissions makes any difference. And if it does, it would suggest API breakage around the time of the May 2016 API update. I will report back when I can.

It warmed up, and I did my test with a Nest product definition using these (latest) permissions, and setting the target temperature works fine for me, no errors, and watched the Nest app reflect the change made from openHAB.

So I think there is some service-side issue with your account, and Nest Support ought to look into it. Please share if you have more details about anything that might be atypical about your configuration.

Thanks for the update. I will double check over my configuration and if I still can’t get it to work, will give Nest Support a call. I’ll update back if/when I know more!

1 Like

Hi, apologies I’ve not back to you in a few days I’ve been busy and not been playing with my Openhab setup.

It looks like this might have been as issue on the Nest side, as with me making no changes my updates have suddenly started working and I can control the nest from OpenHab

Thanks to everyone for their support, and good luck to those still struggling!

1 Like