-
-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nest Protects state won't update after device looses connectivity #63
Comments
Thanks for reporting! I am not sure why this doesn't work, since I don't see any exceptions in your log. Can you check your log to see if there are any warnings or exceptions? The subscriber listening for new data lines are correct. The subscriber will be reregistered when an event comes in and/or the subscriber is expired. Do you have an idea what the |
Hi, Found these errors yesterday ,
|
Thanks! It seems that it can recover from these errors, so I am not sure where we will miss a status update. I need to dive into this. |
Not sure if this is related, but adding in case it helps: My Protect sensors in Home Assistant have been working well for about 2wk now. Early this morning, my WAN connection went down for about 45min. I noticed that all my Protect occupancy sensors kept their values from when the internet became unavailable and then they did not update for about 6 hours after the internet connection was restored. I restarted Home Assistant and they began reporting occupancy correctly again. I didn't have debug logging enabled, but this would be an easy scenario to test (temporarily disable WAN to HA). |
The occupancy sensor (and I presume all of the sensors, although I don't regularly have smoke in the house to check ;) ) gets locked to it's current state when the internet drops out. I found this out because I restart my router every evening; my temporary fix has been to schedule a HA restart shortly after my router restart. |
@brooksben11 I haven't had time to have a look yet, however I should be able to pinpoint the issue and fix it :-). You don't need a restart though, a reload of the integration is enough. And I need to set up a local environment for this probably, since this is hard to debug via GitHub Codespaces. When I kill my connection, I also lose access to my workspace 😄. |
Seeing same problem here. Interesting related to connectivity. I see it basically daily, reloading add-on fixes fir me. My internet us kind of flakey so makes sense on that front. (Basically state gets stuck and refuses to update) |
@Ibycus314 Yeah, I only notice the issue when I restart my router nightly, but my internet is rock-solid (I don't think it's ever dropped even momentarily in the 5 years I've lived here. Google Fiber for the win!). Outside of this issue, the integration has been awesome for me; my only complaint is the 10 minute deal with the occupancy sensor, but that's Google's fault. @iMicknl I'm fine doing a HA restart as a temporary fix, but is there a way to (easily) automate the reloading of an integration? A quick google search made it seem not easily doable and I don't feel like putting in much effort for an adjustment to a bandaid. :) |
@brooksben11, I recall that there should be a way to reload an integration / config entry. However, I will see if I can have a look at this someday. I agree that this is an important fix, but I just need to find some time to work on this. 😞 |
I haven’t looked at the code, but could it be some kind of authentication issue? I’m assuming some kind of cookie or some such associated with the API transaction. I wonder if the connection attempt fails the system needs to re-authenticate? |
@Ibycus314 I think that the issue is that we don't retry this scenario. In order to make sure that we don't end up in a 'retry loop', we only restart the event listener for known exceptions. It should be a relatively easy fix to check for disconnected exceptions, and retry accordingly. |
Sounds good, I’m sure you know your code way better than Me, I just know I’ve had tunnel vision in the past trying to track down bugs, figured a place to start anyways. |
Not sure if it helps, but I think it happens when the Smoke detector looses connectivity, rather than necessarily when the internet goes down (i.e. when home assistant looses connection). My microwave has a tendency to knock out my wifi, and just noticed the sensors seem to get stuck when the microwave runs (which shouldn’t impact home assistant’s connection) |
@lbycus314 and there is no mention in your log when the data is not updated? This one is hard for me to reproduce unfortunately. |
Had a bit of a dig, looks like most of the sensors (line power, battery health, etc) all say “Became unavailable” then immediately come back. Occupancy just stops updating (is there a specific part of the logs you’d like?) |
I wonder if there is an exception in your logs, or if this cannot be detected by our integration. In that case, we probably need to check if a device moves from unavailable to available and then refresh all states. Probably not only occupancy stops updating, but all status updates. |
So I recently did a quick test to determine whether it's the Nest devices or the Home Assistant instance losing connectivity that causes the sensors to stop updating (I also recently upgraded the Nest integration to the latest version, 0.3.5). I unplugged the ethernet cable to the Raspberry Pi running my Home Assistant instance for a few minutes and then reconnected. My logs look normal up until then and then just stop updating (as well as my motion sensor states staying stuck in their last state). So it's definitely an issue of the integration losing connectivity, not the Nest devices. Hopefully this helps narrow down the issue... |
Can confirm issue still present with latest releases. In terms of brooksben11’s comment, I would say either can loose connectivity and it be an issue. Every time I run my microwave for an extended period, it knocks out my wifi, causing the issue. |
I am currently looking into this, however does the app show anything when there is no connectivity? In my situation I have disabled my wifi network for one of my Nest Protects, but it still shows green in the app... |
Not that I’m been able to tell. Just doesn’t update status when it changes….
…Sent from my iPad
Sent from my iPad
On Jun 15, 2022, at 9:48 AM, Mick Vleeshouwer ***@***.***> wrote:
I am currently looking into this, however does the app show anything when there is no connectivity? In my situation I have disabled my wifi network for one of my Nest Protects, but it still shows green in the app...
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
Same for me. From what I remember everything looks normal but it doesn't update. |
That was my observation as well, so I need to see if there is a way to detect this... |
@iMicknl as you point out, seems like similar or same bug as the one I reported in #385. Have you made any further progress in troubleshooting and/or fixing this since the last post 2+ years ago? |
@iMicknl one thing that perhaps could help troubleshoot this is you had any standalone python (or other language) code that I could run and monitor. I can then "play" with the code, including adding more debugging output to get a better handle on where and why it is failing. Is it possible to extract the code as a standalone python script that writes the output to stdout. This would be easier for me than messing with my "production" HA setup since I hate to take it down and restart it unnecessarily. |
@puterboy it's probably a little easier for you to spin up a dev HA instance in a venv or container somewhere than it is for Mick to rewrite the integration to suit your needs. I'm sure he would love the help! https://developers.home-assistant.io/docs/development_environment/ |
This repository actually has a devcontainer that you can leverage as well (where HA is included). |
The problem
I have 8 nest protects and some are showing constant occupancy. Since installation integration of devices (over 3 days).
What version of this integration (ha-nest-protect) has the issue?
0.3.3
What version of Home Assistant Core has the issue?
core-2022.3.5
Device / Model
Nest Protect wired (all)
Diagnostics information
nest_protect-35892183b4b12d5b93434ae1d74a1b83-Nest Protect (Master)-0cbce05c3735b0bf53ae08c61b68005a.json.txt
Home Assistant log
Seeing alot of this,
Additional information
occurs on 3 devices at a minimum right now.
The text was updated successfully, but these errors were encountered: