homebridge-nest icon indicating copy to clipboard operation
homebridge-nest copied to clipboard

Thermostats not being fetched

Open vihanb opened this issue 8 years ago • 12 comments

So I have two thermostats. One on the upper story, one downstairs. I've installed homebridge, and I'm on node LTS (v4.4.5). I've setup the API keys and all and I go and start homebridge and I get this:

$ homebridge
*** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node>
*** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node&f=DNSServiceRegister>
Loaded plugin: homebridge-nest
Registering platform 'homebridge-nest.Nest'
 ---
Loaded config.json with 0 accessories and 1 platforms.
 ---
Loading 1 platforms...
Initializing Nest platform...
Fetching Nest devices.
Scan this code with your HomeKit App on your iOS device to pair with Homebridge:                       

(I've removed the timestamps)

It appears to be able to successfully connect to my Nest account but, no devices actually show up.


My config also appears to be correct:

{
        "bridge": {
                "name": "Homebridge",
                "username": "DD:22:3D:E3:CE:31",
                "port": 51826,
                "pin": "987-65-432"
        },

        "platforms": [
                {
                        "platform": "Nest",
                        "token": "*********",
                        "clientId": "*********",
                        "clientSecret": "*********",
                        "code": "*********"
                }
        ]
}

vihanb avatar Jun 15 '16 06:06 vihanb

Okay, I ran it with homebridge -D and I get this line now:

[6/14/2016, 11:31:40 PM] [NestFirebase] User null is logged in with custom

which doesn't seem good but then again, I don't see any auth error

vihanb avatar Jun 15 '16 06:06 vihanb

I have the same error. This needs some investigation I think.

roffel avatar Jun 15 '16 19:06 roffel

@vihanb @roffel Has it ever worked for either of you? If it has ever worked for you then yes we need to look into this further. If not, my guess is there is something missing in your setup. The only thing I can think is there there is something messed up with the nest dev account setup.

You can try removing all the auth info (token, clientId, clientSecret, code), but make sure to keep a copy of it somewhere so you can go back to it. Then use my HomeBridgeController app to authorize instead (single button click to do all 14 steps 😄). I have not added that as an alternative on the Nest setup yet because I only have 50 auths atm; I have to get my app reviewed by Nest to get more

KraigM avatar Jun 26 '16 17:06 KraigM

I'm having the same issue. Has never worked for me. Tried using the HomeBridgeController app to use the one button click to authorize and got an authentication error stating, "Error: SecureChannelFailure (Unknown Secure Transport error `PeerHandshakeFail'.)"

Similar to @vihanb, mine authenticates just fine using the new API method via token, but just doesn't pull the devices. This isn't just the thermostat either. I also have a few protects and a nest cam.

rjtort avatar Jul 04 '16 17:07 rjtort

I'm having the same exact problem. I noticed that your setup instructions say to "Enable Thermostat with read/write v4", but the current permission is API v5. Would that cause any issues?

bubbinator91 avatar Jul 07 '16 20:07 bubbinator91

I've had the exact same issue - no devices coming through. Also seeing the null userId. If I rule out the home bridge completely and implement a raw client in JS using the web samples from Nest Developer documentation - I actually find that the root database request returns only metadata and does not contain any structure or devices nodes. I've tinkered as far as I can with permissions, different accounts, different names and settings and I just cannot get the devices node to appear. Possibly it's a Nest issue... Only thing I haven't tested is authorising against the Owner account in my family setup (my account is not the Owner) - which I hope to test soon.

driskell avatar Jul 23 '16 21:07 driskell

I can confirm the secondary accounts on Nest Family do not seem to work and do not return any structures or devices. However, authorising against the Owner account gave me a token that now returns everything! Sweet 👍

driskell avatar Jul 24 '16 12:07 driskell

I am having the same issue and do not have a Nest family account. Anyone find a fix?

jonesf14 avatar Sep 16 '16 04:09 jonesf14

And I'll add that I'm having the same issue. What's a Nest Family account? What's an Owner account? How do I fix this issue? Is the setup documentation up to date?

Is homebridge-nest able to discover Nest devices for anyone with a nest developer account created since September 15? What's the secret?

David-Noble-at-work avatar Nov 24 '16 23:11 David-Noble-at-work

Here's what I discovered. I hope these instructions help someone, perhaps jonesf14:

Issue resolved:

You must first register your product (e.g., Thermostat) with Nest. The simplest way to do this is to install the Nest app on an iOS device. Follow the instructions for setup that it presents all the way through to adding your Nest devices. End result: Nest user account and a set of registered Nest devices. I used my developer account to signin to Nest when I came to that place in the setup instructions.

You can then restart homebridge and see that each of your Nest devices are discovered by the homebridge-nest platform plugin.

To restart homebridge on OS X, type these commands in a terminal window:

launchctl unload ~/Library/LaunchAgents/com.homebridge.server.plist
launchctl load ~/Library/LaunchAgents/com.homebridge.server.plist

You should then see entries like this in your homebridge log file:

[11/24/2016, 3:58:16 PM] Initializing Nest platform...
[11/24/2016, 3:58:16 PM] Fetching Nest devices.
[11/24/2016, 3:58:18 PM] [Harmony Hub] Fetching Logitech Harmony activities...
[11/24/2016, 3:58:18 PM] Software version for Family Room Thermostat is: 5.6-7
[11/24/2016, 3:58:18 PM] Temperature unit for Family Room Thermostat is: Fahrenheit
[11/24/2016, 3:58:18 PM] Current temperature for Family Room Thermostat is: 77 F
[11/24/2016, 3:58:18 PM] Current humidity for Family Room Thermostat is: 35%
[11/24/2016, 3:58:18 PM] Target temperature for Family Room Thermostat is: 72 F
[11/24/2016, 3:58:18 PM] Target heating for Family Room Thermostat is: Heating
[11/24/2016, 3:58:18 PM] Away for Family Room Thermostat is: 0
[11/24/2016, 3:58:18 PM] Initializing platform accessory 'Family Room Thermostat'...

David-Noble-at-work avatar Nov 25 '16 00:11 David-Noble-at-work

Thanks for the response. My nest thermostat already is registered. I removed it and reinstalled it (on my iPhone) to make sure this wasn't the problem and I'm having the same issue.

jonesf14 avatar Nov 26 '16 14:11 jonesf14

I know this thread is a bit old, but for anyone new to this and just setting this up, I was having the exact same issue described above (init/fetching worked / no devices showing) only to find there was control character in the token, so worth a quick double check on that. Works fine now! :)

sschnoor avatar Oct 21 '18 20:10 sschnoor