chrisjshull / homebridge-nest

Nest plugin for HomeBridge
707 stars 111 forks source link

Nest Devices No Longer Reporting State to Homekit 4.6.6 (4.6.5) #537

Closed Tom5640 closed 2 years ago

Tom5640 commented 2 years ago

Hey All,

Nest plugin has been working perfectly for over a year - I use Nest account authentication - all of a sudden on Afternoon of 22 April, the devices are showing as responsive in HomeKit, but are not updating their state - I have had a couple of state updates since the problem began, but only a couple and not instantly like they used to up until yesterday (at one point there was a lag of about 4 minutes before the occupancy sensor in the kitchen updated and ran a homekit routine - turning on kitchen lights).

There has been no configuration changes, the issue appeared on Version 4.6.5 and it was during logging into the bridge I noticed an update, the update (4.6.5 to 4.6.6) did not resolve the issue so I have eliminated version upgrade causing or resolving the issue. I have rebooted homebridge/bridge/home hub & also re-authenticated via nest account.

Here is a screenshot showing devices present and responsive, but I've been moving about the hall and they are not triggering (Nest Protect Occupancy Sensors):

Screenshot 2022-04-23 at 13 36 47

Here is a log from after a reboot of the bridge:

23/04/2022, 01:41:44FTNESTNestFetching Nest devices. 23/04/2022, 01:41:49FTNESTNestiniting thermostat "Living Room Thermostat": deviceId: 09AA01AC42170UEW structureId: 7cc90c50-0f6e-11e8-953d-0e4162625ac0 23/04/2022, 01:41:49FTNESTNestiniting home_away_sensor "Home Occupied": deviceId: 7cc90c50-0f6e-11e8-953d-0e4162625ac0 structureId: 7cc90c50-0f6e-11e8-953d-0e4162625ac0 23/04/2022, 01:41:49FTNESTNestiniting protect "Hall GF": deviceId: 6416660000CFF0EC structureId: 7cc90c50-0f6e-11e8-953d-0e4162625ac0 23/04/2022, 01:41:49FTNESTNestiniting protect "Kitchen": deviceId: 18B43000417E759A structureId: 7cc90c50-0f6e-11e8-953d-0e4162625ac0 23/04/2022, 01:41:49FTNESTNestiniting protect "Hall 1F": deviceId: 6416660000CFEEE3 structureId: 7cc90c50-0f6e-11e8-953d-0e4162625ac0 23/04/2022, 03:56:23FTNESTNestERRORAPI observe: error Error: Stream closed with error code NGHTTP2_INTERNAL_ERROR at new NodeError (node:internal/errors:371:5) at ClientHttp2Stream._destroy (node:internal/http2/core:2330:13) at _destroy (node:internal/streams/destroy:102:25) at ClientHttp2Stream.destroy (node:internal/streams/destroy:64:5) at Http2Stream.onStreamClose (node:internal/http2/core:544:12) { code: 'ERR_HTTP2_STREAM_ERROR' } 23/04/2022, 03:56:23FTNESTNestERROR^^^^^ this message is for information only, it does not mean there is a problem, please do not file a ticket unless you actually have a problem with the function of the plug-in 23/04/2022, 03:56:23FTNESTNestERRORRetrying in 10 seconds.

adriancable commented 2 years ago

This looks like a Nest service side issue which usually self-resolves in a few hours.

Tom5640 commented 2 years ago

Thanks @adriancable . I suspected so too, but wanted to raise it as soon as possible just in case. It's been working very very intermittently this morning - perhaps around 10-20% success rate, I am away for the rest of the weekend so hopefully will be resolved by next week.

adriancable commented 2 years ago

@Tom5640 - NGHTTP2_INTERNAL_ERROR is the HTTP/2 equivalent of '500 Internal Error' that you may see sometimes when browsing the web, when there is a server issue.

It's hard to know the cause when something on the Internet isn't working right for you, but for sure it's not your network, your machine, or Homebridge.

Tom5640 commented 2 years ago

@adriancable Okay thanks again / would be curious to know if anyone else in the UK is having similar issues. Again, I notice that the states have been changing, but are extremely slow to change - it's taken about 45 minutes for the next therm temperature to reflect in Apple Home.

Tom5640 commented 2 years ago

Hey @adriancable - this continues to be an issue I am afraid. Been on to Apple support too - just not sure where to turn. Going to try removing the Nest Bridge and setting it up in a new test home. Ideally would like to restart my nest protects and thermostat but I am not sure if I can!

I completely removed the bridge and set up again from scratch, and even added to a new test home in Apple Home App. Still not working/very slow to trigger occupancy sensors/update temperature from therm - only thing I can think is that Google are deprecating the Nest session access, and migrating to a Google Account may solve it. So strange after such a perfect operation for 12+ months.

adriancable commented 2 years ago

@Tom5640 - can you kindly edit your config.json, and below this line:

"platform": "Nest",

add:

"options": [ "Debug.Verbose" ],

Then run: homebridge -D

Then when the issue happens again, please email me the log to adrian.cable@gmail.com. Also, please tell me what device you're running Homebridge on (e.g. Raspberry Pi) and how that's connected to your network (e.g. wired via Ethernet to switch to router model XXX).

This isn't anything to do with Nest vs Google accounts so you don't need to go down that path (unless you want to migrate for other reasons).

This plug-in has 200,000+ users - if something changes or goes wrong on the Google/Nest side, I wake up to an inbox of 1,000+ emails. (This has happened before.) So, it is definitely something wrong with your set-up, we just need to find out what!

Tom5640 commented 2 years ago

Thanks so much @adriancable - I do not want to migrate from Nest to Google as I'd need to create a whole new gmail account as my account is a "workspace" account and isn't compatible so thanks for not letting me go down that road.

I'm using hoobs so I have done the equivalent (hoobsd -d) to fetch the log - do you know where this would be dumped to please?

Yeh, only other symptom is that the Home App in general sometimes doesn't refresh current state (of all plugins, even certified ones) and I need to force close and reopen the app to see the most up to date state - apart from that, it's just the nest homebridge plugin causing issues - of the 9 bridges I currently have running.

adriancable commented 2 years ago

@Tom5640 - the log is dumped to the console. You already cut and pasted a log at the top of this thread, so you don't need to do anything different.

Regarding the Home app not fetching the current state for any device, isn't this the same as what you're reporting with the Nest plug-in? If so, this definitely isn't a Nest issue. It sounds more like a router issue, or a HomeKit/iCloud corrupted state issue.

What device are you running Homebridge on? And how is it connected to your network? Something like:

Tom5640 commented 2 years ago

@adriancable I have emailed you the following, adding here in case this ever helps anyone else in the future:

After a few days of my own diagnostics:

  1. I have now established that it is exclusively the Nest bridge that is experiencing issues (all other bridges are updating state as normal - I am now using motion sensors in homekit routines rather than nest occupancy sensors as a result of the issue, and they are triggered immediately as expected)

  2. ALL of my Occupancy Sensors (3) in the Protects ARE triggered, but there is a random delay of between 0 seconds to 10 minutes for the notification to appear in the Home app/automation to be triggered:

IMG_7622.jpeg

For example "Kitchen" notification above shown as received "now" was received on my iPad/iPhone after I had been in the kitchen, made a coffee and was back up the stairs!

  1. Only:

states in the direction Device --> HomeKit are impacted by the issue. State changes from HomeKit -->Device are instantaneous.

For example, setting the nest thermostat in HomeKit (on/off, eco mode, temp), will immediately reflect in the nest app/physical thermostat display. Setting the nest thermostat in the nest app/physical device will take a random amount of time between 5 - 10 minutes to reflect on HomeKit.

Environment Details

Lenovo ThinkCentre Core i5-3570T/8GB/120GB SSD running Ubuntu 20.04.4 running Hoobs 4.2.2 (Homebridge 1.4) connected to USW-Lite-16-PoE connected to Unifi Security Gateway 3P Router on a 900Down/110Up FTTP connection.

HomePod Mini 15.4.1, iPhone 12 Pro Max 15.4.1 connected to UniFi U6-Lite

Screenshot 2022-04-27 at 12.24.51.png

Time

Running Nest/Hoobs since April 21, first experienced issue Friday 22 April around 1400 BST. Prior no config changes made since 1 April 2022 (AP firmware updates).

Log

27/04/2022, 10:44:41FTNESTLoaded plugin 'homebridge-nest' 27/04/2022, 10:44:41FTNESTRegistering platform 'homebridge-nest.Nest' 27/04/2022, 10:44:41FTNESTLoading 1 platforms... 27/04/2022, 10:44:41FTNESTNestFetching Nest devices. 27/04/2022, 10:44:41FTNESTBridge is running on port 51876. 27/04/2022, 10:44:48FTNESTNestiniting thermostat "Living Room Thermostat": deviceId: 09AA01AC42170UEW structureId: 7cc90c50-0f6e-11e8-953d-0e4162625ac0 27/04/2022, 10:44:48FTNESTNestiniting home_away_sensor "Home Occupied": deviceId: 7cc90c50-0f6e-11e8-953d-0e4162625ac0 structureId: 7cc90c50-0f6e-11e8-953d-0e4162625ac0 27/04/2022, 10:44:48FTNESTNestiniting protect "Hall GF": deviceId: 6416660000CFF0EC structureId: 7cc90c50-0f6e-11e8-953d-0e4162625ac0 27/04/2022, 10:44:48FTNESTNestiniting protect "Kitchen": deviceId: 18B43000417E759A structureId: 7cc90c50-0f6e-11e8-953d-0e4162625ac0 27/04/2022, 10:44:48FTNESTNestiniting protect "Hall 1F": deviceId: 6416660000CFEEE3 structureId: 7cc90c50-0f6e-11e8-953d-0e4162625ac0

Example of Automations Now Made Unusable

IMG_7616.jpeg

I'm so grateful for all your help - I'll be making a donation to the project irrespective of whether we get to the bottom of this - please feel free to pass me a link or else I will do so next time I discover the link!

RogerSelwyn commented 2 years ago

I think I'm getting the same problem as this, or at least the same error in my logs and some of my sensors lock up. I use Homebridge-nest in Hoobs feeding Home Assistant. This has worked very reliably for quite some time. Very occasionally it would hang, but no more than once every couple of months. It has now hung the last few nights, after I did an update a few nights ago (I forget the exact update date, but I'd lay money it was the day it stopped working reliably).

What is strange is that, whilst I have 3 sites in Nest, I can see that only one of them has hung. Well, one site has two cameras with very little activity, so I can't easily if they are hung (though I'll try to remember to switch from away to home next time it hangs, to see if that site updates correctly).

My sites are:

  1. Location one
    1. Site 1 - two cameras - not easy to see if this fails
    2. Site 2 - thermostat, battery protect, wired protect - this site hangs
  2. Location two
    1. Site 3 - two wired protects - I can see this keeps updating

I can see site 2 hangs because the wired protect state doesn't change, and the hot water state doesn't change (I use a Home Assistant login for the heating controls which works through Google SDM api, so don't see what happens to the heating sensors).

RogerSelwyn commented 2 years ago

No I'm wrong, everything hung from the time of the error to when I restarted the plug-in.

adriancable commented 2 years ago

@RogerSelwyn - please email me at adrian.cable@gmail.com so we can debug this. Thanks!

marc115uk commented 2 years ago

FB5665B8-1286-406B-B952-F284D5907D95 Have been having same issues not reporting correct temperatures for the last few days using nest api, have tried deleting it and reinstalling it and now getting an error message saying it can’t connect to nest so unable to re set up ![Uploading 5D7BA9FB-9257-4A29-98D2-4DD7CB6E3E8B.jpeg…]()

adriancable commented 2 years ago

@Tom5640 / @RogerSelwyn / @marc115uk - just published 4.6.7 which should fix delays in correct reporting of state to HomeKit.

@marc115uk - please follow the instructions in the README to get a new Nest access token.