So I only have Nest Protects in my house. I see that the Nest app does show home/away but when I try to pull in the Nest status through the binding (and yes, I use “Home” in the Nest app):
Thanks for the trace log. (I recommend you delete it from your Drive account now and/or create a new Product and PIN to invalidate the access token.)
The away state was not given in the JSON payload, and my theory is that the product you defined does not have the “Away read/write” permission defined, so it was not included. Example of permissions I’m talking about:
Please make sure you have enabled all the permissions you might use in the product including Away read/write, and log in to the main Nest web interface to accept the update of the product. This ought to cause the next JSON payloads to include the away state, and allow you to change it from openHAB.
The PIN isn’t in the log, but the access token is. Probably too hard to use without the product id and key, but I’ll leave it to you. I hope my advice sorts out the issue with .away not appearing the JSON!
Then reauthorized the product and put the new pin in my Nest binding config (through Paper UI). Even restarted OpenHab. Trace is still showing Away=Null in the logs and the values are empty.
Any other ideas (could do a full binding uninstall / reinstall)? Maybe because it’s a Protect I should set the Away as read only?
If you are certain that the Product that the binding is now using has the Away permission, my reading of the API documentation is that it ought to be delivered in the JSON payload it returns to the binding. I don’t see how uninstalling and re-installing the binding would make any difference. The only remaining suggestions I can offer are:
Completely delete the Product at developers.nest.com, create a new Product with all the permissions you could ever use, enter the key, secret and PIN in the binding configuration, and see if structures(Home).away returns a value.
Send a “home” or “away” command to the item bound to `nest=“=[structures(Home).away]” and see if the API accepts it or if an error is logged.
Have a thorough read of the API documentation to see if I’ve somehow misread the conditions under which which the .away value should be returned in the situation where there is no thermostat in the structure, only Protects.
See if there is a way to report a problem to Nest regarding either a bug or a lack of documentation.
I have two Nest structures but neither doesn’t have a thermostat, and I’m not in a situation to remove the thermostat to see if that makes a difference.
I think the issue might have been that I had an old nest.cfg file in my conf/services with an old pin so that might have been not letting the new permissions through. Either way, I deleted and setup a new product (I did Read Only on Away) and now we are getting data.
Thanks for all the help and the work on the binding. Now if Nest/Google will just expose the individual protect occupancy status I could get even more value from my Protects on a room by room basis