-
-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
Philips TV crashes and shows unavailable #49801
Comments
philips_js documentation |
Your tv has likely crashed. |
By that i mean can you restart your tv completely. Pull the power plug on it for half a minute. |
I tried to unplug the tv and set it up again but nothing. It always worked, only with the latest version I had problems. |
What TV model is it? |
my tv is a 46PFL4468H / 12 and I use version 1 of the api. I had version 2021.4.4 and it worked then I upgraded to 2021.4.6 and it didn't connect anymore |
Can you turn on debug logging for "haphilipsjs" and for "homeassistant.components.philips_js" |
are you sure it was 2021.4.4? it should be identical to 2021.4.6. 2021.4.3 was a bit different |
I am experiencing the same issue:
|
@klatka what model tv, what version. Your issued look different. You get a read timeout on the context endpoint. While @baccaglini-fabio seem to get something different on the ambilight/mode endpoint. |
This is from the TV: Model: 65PUS8102/12 I think this is API version 6 |
yes it's true, I had read that the .4 had problems with the updates of the .5 on facebook and I waited for the .6 .. I had the .3 version! |
@klatka your issue is different then. First fully restart your tv. They are so crash prone @baccaglini-fabio okey, then it makes more sense. I need those debug logs. |
Here is the code: (my menu lang is italian not Ukrainian) 2021-04-30 22:06:49 DEBUG (MainThread) [haphilipsjs] Get succeded: system -> { |
So your tv breaks down when we grab ambilight data.. christ how many bugs can philips get into their API's. |
I have also an issue with the philips tv integration and the tv in general... dont know what happens: `> /usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py:1013: InsecureRequestWarning: Unverified HTTPS request is being made to host '192.168.1.8'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
|
You have a custom component that is logging errors. And the built in component have authentication errors. Remove the custom component and readd the built in config entry. |
@elupus the TV is now a few years old, I change it and choose another brand .. maybe it's better! |
fixed it.... Hope you also merge it with https://github.com/jomwells/ambihue and https://github.com/jomwells/ambilights to get my automations work again ;) |
Hello, I have also an issue with the philips tv 65oled935/12 Logger: aiohttp.server Error handling request The above exception was the direct cause of the following exception: Traceback (most recent call last): Thx |
After a full restart the TV is available in HA but only for 5 Minutes. Then the ambilight integration stops and also the TV is unavailable. Logger: homeassistant.components.philips_js Unexpected error fetching philips_js data: The above exception was the direct cause of the following exception: Traceback (most recent call last): The above exception was the direct cause of the following exception: Traceback (most recent call last): |
I just got a crash on my tv too now. I think grabbing ambilight data might be crashing it. I will post an updated lib without that later. |
This is likely the background crash in the SSL engine on the TV: restlet/restlet-framework-java#852 |
Same probs here :P |
I have a similar experience (that the SSL fails to work) as mentioned in the link. However, in my case the SSL already stops after the TV sends its SYN ACK, and fails to respond on the CLIENT HELLO (part of the SSL handshake). From WireShark it looks as if TV believes it has not received a CLIENT HELLO whereas the client awaits the SERVER HELLO. The interesting part here is that there is no pattern in when this occurs. Power cycling the TV will get things back online. Powering TV ON / OFF through Home Assistant may work for a number of times. Leaving the TV off for hours, then power it on could in some cases cause this behaviour. In other cases, leaving the TV running for hours (and using Home Assistant to change channels, volume etc.) would work, and then all of a sudden the SSL connection would start to act up (especially seen the TV had been turnoff). Currently I have a support case running against Philips for this. Unfortunately the push-back I get is that 'we do not really see the problem as the JointSpace queries only are defined for port 1925' :/ Ideas: |
You can tell httpx which backend to use with something like this:
I'm at work now, so I cant directly copy and paste my modifications, there could be an error in there. Regarding to closing of connections, in my opinion this has always been the responsibility of the layer that created the socket. I see the httpx client has several calls to close on exceptions but apparently they missed at least one. I would suggest you explicitly close the connection after every update (not necessarily every request in update, but I suspect the TVs are rather eager on closing the connection) or notifyChange, especially if an exception was caught. |
I have a disappointing update to report. Changing the backend doesn't really help. I seems my TV was just in a good mood that evening and the following 24 hours. I guess its just another exception that needs to be caught with anyio backend and then ignored. Again I noticed that the https endpoint will become available again if you stop trying to access it for long enough. But as far as I can tell it isn't caused by a specific number of connections. A certain request causes a deadlock and follow up requests seems to exacerbate the issue. Maybe a timer/time variable that is shared between threads? Also the unannounced switching to deep sleep is really bad for the reliability. I would have expected a notification for the powerstate but there doesn't seem to be one. I'm really curious how the app handles that, or is it just as unreliable? I tried settings up a mitm proxy with an emulator but couldn't get the app to pair yet. |
There is a solution? |
@Emrvb i might have found a culprit. See mentioned pull request above. Without that sockets are leaked on some types of exceptions. |
Nice find. It should at least increase stability. I still suspect something is causing a deadlock on the tv side (in my case). I haven't had time yet to properly monitor it. I still havent had any bright ideas about the deep sleep issue. There should be a proper way to handle that. That XTV service cant be that bad. |
it turns out that we are waiting for a fix in the next build ha core 21.11.3? |
No. This is a fix that is needed in httpcore project. After which a chance in home assistant core is needed. |
Then we are waiting, thank you for not leaving the project! |
Fixed by #59723 please open new issue and link to this after the release if problem persist. |
Is the problem fixed or not? how do i make the integration work? |
It should be fixed by the mentioned merged pull request. Which will be part of next release of home assistant. So report back if you still have issues after that is released and you have tested it or if you can test dev branch of home assistant. |
I understand, I'm waiting for the update of the home assistant, after, of course, I will unsubscribe if there are problems and provide the logs |
How to call the YouTube application from the library through the service? Or, for example, the "right" button? Send command doesn't work .. |
I still have the same problem. Home Assistant: core-2021.12.2 Error: Falha ao chamar o serviço remote/send_command. can't handle event type ConnectionClosed when role=SERVER and state=SEND_RESPONSE |
|
Yes issue remain. There is another issue for this still open. #57093 (comment) Waiting for a fix in httpcore library #60150 |
Thanks! It worked for me! But let's say YouTube kids can't start this way, I do it like this: |
Please refrain from support discussions in issues. |
This specific issue should no longer be a problem. It was due to leaking connections. I will close this for now. |
The problem
no longer recognizes the TV on
What is version of Home Assistant Core has the issue?
2021.4.6
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Core
Integration causing the issue
Philips TV
Link to integration documentation on our website
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Logger: homeassistant.components.philips_js Source: components/philips_js/__init__.py:175 Integration: Philips TV (documentation, issues) First occurred: 26 aprile 2021, 8:41:24 (11 occurrences) Last logged: 7:16:47 Unexpected error fetching philips_js data: can't handle event type ConnectionClosed when role=SERVER and state=SEND_RESPONSE Traceback (most recent call last): File "/srv/homeassistant/lib/python3.9/site-packages/httpx/_exceptions.py", line 326, in map_exceptions yield File "/srv/homeassistant/lib/python3.9/site-packages/httpx/_client.py", line 1492, in _send_single_request (status_code, headers, stream, ext) = await transport.arequest( File "/srv/homeassistant/lib/python3.9/site-packages/httpx/_transports/default.py", line 169, in arequest return await self._pool.arequest( File "/srv/homeassistant/lib/python3.9/site-packages/httpcore/_async/connection_pool.py", line 218, in arequest response = await connection.arequest( File "/srv/homeassistant/lib/python3.9/site-packages/httpcore/_async/connection.py", line 106, in arequest return await self.connection.arequest(method, url, headers, stream, ext) File "/srv/homeassistant/lib/python3.9/site-packages/httpcore/_async/http11.py", line 72, in arequest ) = await self._receive_response(timeout) File "/srv/homeassistant/lib/python3.9/site-packages/httpcore/_async/http11.py", line 133, in _receive_response event = await self._receive_event(timeout) File "/srv/homeassistant/lib/python3.9/site-packages/httpcore/_async/http11.py", line 169, in _receive_event event = self.h11_state.next_event() File "/usr/local/lib/python3.9/contextlib.py", line 135, in __exit__ self.gen.throw(type, value, traceback) File "/srv/homeassistant/lib/python3.9/site-packages/httpcore/_exceptions.py", line 12, in map_exceptions raise to_exc(exc) from None httpcore.RemoteProtocolError: can't handle event type ConnectionClosed when role=SERVER and state=SEND_RESPONSE The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/srv/homeassistant/lib/python3.9/site-packages/haphilipsjs/__init__.py", line 462, in getReq resp = await self.session.get(self._url(path), timeout=TIMEOUT) File "/srv/homeassistant/lib/python3.9/site-packages/httpx/_client.py", line 1539, in get return await self.request( File "/srv/homeassistant/lib/python3.9/site-packages/httpx/_client.py", line 1361, in request response = await self.send( File "/srv/homeassistant/lib/python3.9/site-packages/httpx/_client.py", line 1396, in send response = await self._send_handling_auth( File "/srv/homeassistant/lib/python3.9/site-packages/httpx/_client.py", line 1434, in _send_handling_auth response = await self._send_handling_redirects( File "/srv/homeassistant/lib/python3.9/site-packages/httpx/_client.py", line 1466, in _send_handling_redirects response = await self._send_single_request(request, timeout) File "/srv/homeassistant/lib/python3.9/site-packages/httpx/_client.py", line 1492, in _send_single_request (status_code, headers, stream, ext) = await transport.arequest( File "/usr/local/lib/python3.9/contextlib.py", line 135, in __exit__ self.gen.throw(type, value, traceback) File "/srv/homeassistant/lib/python3.9/site-packages/httpx/_exceptions.py", line 343, in map_exceptions raise mapped_exc(message, **kwargs) from exc # type: ignore httpx.RemoteProtocolError: can't handle event type ConnectionClosed when role=SERVER and state=SEND_RESPONSE The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/update_coordinator.py", line 173, in _async_refresh self.data = await self._async_update_data() File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/philips_js/__init__.py", line 175, in _async_update_data await self.api.update() File "/srv/homeassistant/lib/python3.9/site-packages/haphilipsjs/__init__.py", line 621, in update await self.getAmbilightMode() File "/srv/homeassistant/lib/python3.9/site-packages/haphilipsjs/__init__.py", line 946, in getAmbilightMode data = await self.getReq("ambilight/mode") File "/srv/homeassistant/lib/python3.9/site-packages/haphilipsjs/__init__.py", line 475, in getReq raise GeneralFailure(err) from err haphilipsjs.GeneralFailure: can't handle event type ConnectionClosed when role=SERVER and state=SEND_RESPONSE
Additional information
No response
The text was updated successfully, but these errors were encountered: