Skip to content
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

device in integration unavailable #686

Open
bisquit2003 opened this issue Feb 23, 2024 · 2 comments
Open

device in integration unavailable #686

bisquit2003 opened this issue Feb 23, 2024 · 2 comments

Comments

@bisquit2003
Copy link

My Home Assistant version: 24.02.03 (but the problem was on all versions)

every time I restart my haos, my sonoff nspanel pro in integration goes to the unavailable status,
I have to go to the panel, close the android ha app and open it again and then everything will return to normal.
Is there anything we can do about it?

@codemunkie15
Copy link

I am also seeing this. Looks like a fix was implemented previously (#527) but it is no longer working.

I can see the web socket connection is definitely re-opened after a restart because I am getting logs in Home Assistant, but the entities don't seem to update; they stay as Unavailable until you refresh the browser.

2024-03-18 11:03:30.490 INFO (MainThread) [custom_components.browser_mod.connection] LOG MESSAGE: Send:
2024-03-18 11:03:30.491 DEBUG (MainThread) [custom_components.browser_mod.browser] Manually updated Browser Mod Coordinator data

@codemunkie15
Copy link

codemunkie15 commented Mar 18, 2024

@thomasloven I tried to debug this a bit and it looks like the connected property in the data (set in BrowserModBrowser.open_connection()) is lost on Home Assistant restart, which then causes BrowserModEntity.available to always return false.

browser.py

def open_connection(self, hass, connection, cid):
        ....
        self.update(hass, {"connected": True})

entities.py

@property
    def available(self):
        return self._data.get("connected", False)

Furthermore, I added some extra logging in the python classes and I can see BrowserModBrowser.close_connection() is called when Home Assistant restarts but the connection is never reopened with a call to BrowserModBrowser.open_connection(). Yet I am still receiving events from the browser in the websocket after a restart. Not sure what's happening here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants