mpbzh / homebridge-plex

Plex plugin for homebridge: https://github.com/nfarina/homebridge
MIT License
58 stars 6 forks source link

check online status first #8

Open CloneDevil opened 6 years ago

CloneDevil commented 6 years ago

Is it possible to add a status check by pinging the server first? At the moment the whole Homebridge gets nearly locked when the server is not online.

mpbzh commented 6 years ago

Good input.

Does homebridge lock up while waiting for a reply from Plex or is it just constantly retrying and thus blocking homebridge?

CloneDevil commented 6 years ago

I think the problem occurs when I open the Homebridge-App and it automatically checks the status after selecting the room with the Plex-Server in it. I will look in the log-files later when I am at home.

mpbzh commented 6 years ago

That would certainly help fixing the ussue.

CloneDevil commented 6 years ago

Now I can't trigger it anymore! Your code became self aware and fixed itself. 🤪

Am 05.02.2018 um 17:18 schrieb Michael Burri notifications@github.com:

That would certainly help fixing the ussue.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

mpbzh commented 6 years ago

Feel free to reopen the issue when my code decides to act up again 😉

CloneDevil commented 6 years ago

Oh. Wrong github-repository!! I am testing too many projects at once. In the log it says: Getting current state...

Then after a while: Error getting state (status code 1): Error: connect ETIMEDOUT [my plex ip address]:32400

mpbzh commented 6 years ago

That still does not really answer my question:

Does homebridge lock up while waiting for a reply from Plex or is it just constantly retrying and thus blocking homebridge?

A slow request should not block the whole homebridge, because these requests are asynchronous which means homebridge should just go on working while it waits for the Plex server to reply.

Also it should not retry more quickly than it checks for the status anyways.

CloneDevil commented 6 years ago

Ok. I try to describe it as well as possible: I stopped Homebridge as service and startet it per SSH with "sudo homebridge" After waiting for a while to load I open the Homekit-App on my iPhone and select the room with the Plex-Status inside I see in the running SSH-window this message: "Getting current state..." No other Homebridge accessory can update for ca. half a minute. So the answer is that Homebridge locks up.

mpbzh commented 6 years ago

This looks like a platform limitation: https://github.com/nfarina/homebridge/issues/948

I'm not sure what to do about it. While I agree, that a non-reachable Plex should not block the whole homebridge, I'll have to think of an elegant solution for that problem.

Feel free to comment with any good ideas.

A320Peter commented 5 years ago

Has anyone came up with a solition for this? My homebridge also completely locks up if my plex server is not running and in Home app I navigate to the room which contains this plex sensor. If plex server is running, everything is fast.

MikeDeltaHH commented 4 years ago

Think there isn´t a solution!? To avoid this i´ve made an extra room (like homecinema) in my home with only this device and when my plex server is off i don´t navigate to this room... not perfect but better than nothing...