Closed andrewjswan closed 5 months ago
Hey there @elupus, mind taking a look at this issue as it has been labeled with an integration (philips_js
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
philips_js documentation philips_js source (message by IssueLinks)
It could be going into sleep on the network i suppose. How long does it stay on?
TV is working, in touch, ping is on. I can get information as above. But in HA it is off. Android TV integration is configured, it works without problems.
The TV is in the status on for a couple of minutes, that's all. The log above and the screenshot of the story confirm this.
Can you please post debug info file that you can get from the integration config entry screen.
~13:33 - I turn On TV ~13:34 - media_player Turn On. All Ok ~13:38 - media_player Turned Off. :( TV work, Android TV on this TV work ... In log no error or warning ... Debug info: config_entry-philips_js-cea04c589d04d4f6e073ef3c5b7986f0.json.txt
After i turn off TV in log:
2023-02-17 13:42:24.397 WARNING (Thread-95) [pychromecast.socket_client] [55PFL7008(192.X.X.X):8009] Heartbeat timeout, resetting connection
2023-02-17 13:42:27.309 ERROR (MainThread) [homeassistant.components.androidtv.media_player] Failed to execute an ADB command. ADB connection re-establishing attempt in the next update. Error: Reading from 192.X.X.X:5555 timed out (9.0 seconds)
2023-02-17 13:42:29.291 WARNING (MainThread) [androidtv.adb_manager.adb_manager_async] Couldn't connect to 192.X.X.X:5555. TcpTimeoutException: Connecting to 192.X.X.X:5555 timed out (1.0 seconds)
2023-02-17 13:42:54.432 ERROR (Thread-95) [pychromecast.socket_client] [55PFL7008(192.X.X.X):8009] Failed to connect to service ServiceInfo(type='host', data=('192.X.X.X', 8009)), retrying in 5.0s
I have the same issue, the tv worked just fine for a few days. Did you fixed it?
No :(
Do you guys have "Use events.." setting turned on in integration options for the config entry of philips?
@andrewjswan those logs are not from the philips intehration. Looks to be from the androidrv one. Are you using both?
Yes, Use event used...
@elupus homeassistant.components.philips_js
- not Philips integration?
Yes i use both, since this integration does not work, and I need to understand the status of the TV.
@andrewjswan can you try turning that event feature off to test if problem persists. Also disable the android integration and dlna (if enabled) temporarily.
I unplug and plug again the TV but with HA turned off and the tv responds again to its Ip:1925/system. When I turn on the HA, the TV turns off on network, maybe a script/command puts the TV into sleep on network. I'm gonna reinstall HA because i do not have too much things
I tried, the same thing, but you can’t turn off the TV yet, there is no button.
If you can't reach the /system endpoint the TV has crashed/locked up. You can try and restarting HA att that point. And see if it recovers temporarily.
Maybe there is some http connection leak in HA that has cropped up.
At the time of turning off the essence in, I tried to go to the address http://ip_address_of_tv:1925/system, the answer from TV was. I tried to monitor this answer at the time of the transition, as well as the answer from TV was always. I thought that there are problems with the connection of TV and the network since it was connected by WiFi, but by switching to the Lan nothing changed. TV on the router does not drop the time of the session.
If I make a HA restart, then TV does not always receive the status in HA, but if you turn off the TV and turn it on, then if my memory does not fail me, it turns on. Since android TV integration works on the same TV, it is always in touch for now the TV is on, there are no breaks. If you need, I can give additional information.
2023.05 - No change, everything is the same.
I enabled the following option in the TV settings: “Turn on with Wi-Fi”, which is supposed to keep the TV online while standby. Checking my network with HA shows that the TV is at least always connected to the Wi-Fi network as intended. However, after usually a couple of seconds, the TV becomes unavailable as a media player, so turning on is not possible.
You likely need to have some wakelock app for your tv. You see in your log that adb also disconnects.
I switch TV from WiFi to Lan, the some... ADB work, but TV mediaplayer turn off after some minutes...
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
2023.8 the some
2023.8.4 same problem here.
TV goes on if i switch on through HA but after a few minutes, in HA the TV appears as off.
Static ip, ping ok
I did several test and I found my specific problem. Isn't a integration problem but an IP's problem that I can't understand but i solved it with a workaround. I'll write here only for suggest other user with same problem to check this behaviour.
Previously my philips tv was set to static IP and as i wrote before, the ip was correct ! Ping ok... At first switch on the tv mantain the ip... after switch it to off, the tv maintain the IP...
From the second switch on the problem appears: the ping stops to respond to the static ip setted and tv get an ip from DHCP server! In the option menu the tv still setted to static ip but it use the dynamic one got from dhcp.
So the static ip configuration on tv doesn't work good, i solved setting up an static lease on my router for the tv's mac address.
However it is possible to add a configuration menu for the integration that permits to change device's ip? Once it's setted, if tv's ip change, user have to delete integration and then reinstall it to set the new host/ip!
My IP does not change, if it changed, then Google TV did not work on this TV, but it works. And when you start the TV for a few minutes Online in HA then goes offline. But it is on the lan.
I don't know how works your Google TV config but are you sure that with another valid local ip doesn't work?
Because when my tv change its ip, internet still and works great every smart apps as YouTube / prime video ...
Only Ha stop to see It because Ha search for It at previously static ip.
The log above is there, I turn on the TV, it turns on in HA, also in HA turns on Google TV, which is on this TV, after a while TV has the status off, but Google TV is still on. If I turn off the TV, Google TV will also be turned off.
Maybe Google TV checks only TV's internet connection that works with every ip It used. Ha check only with the one ip you set, so when you switch on, the TV change local ip and doesn't replay to Ha anymore.
Do your test, check which local ip is using your TV, launch a ping to this ip, then turn off TV , wait some seconda and turn It on again.. meanwhile check ping reply and be sure that ping doesn't stops to reply.
Once again, TV and Google TV in HA have the same IP address, and since the status in HA changes, the address does not change, if the address changed, both entities would fall off.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
I had this issue, and as far as I remember the notification service was causing the philips tv to crash and become intermittently unavailable. I solved it by turning off "allow notification service" (the option to disable it appears after clicking "configure" inside your philips tv integration). It also says in the description of this option: "Allow the usage of data notification service on TV instead of periodic polling. This allows faster reaction to state changes on the TV, however, some TV's will stop responding with this activated due to firmware bugs."
I have 4 android philips TV's and only 1 works with the build-in integration with or without use of notification service. Same issue has been reported before https://github.com/home-assistant/core/issues/64359
The 3 none working TV's works fine with this integration: https://github.com/nstrelow/ha_philips_android_tv
Its annoying. But short of somebody with such a tv debugging the code to figure out what crashes them. Not much we can do.
@elupus I might have good news about this issue. I have been debugging and testing and got something working. In haphilipsjs init.py Line 260: limits = httpx.Limits(max_keepalive_connections=0, max_connections=3)
httpx.Limits first parameter is Max connections and second is Max keepalive
It seems to be reversed unless 0 means unlimited.
I canged it to: limits = httpx.Limits(max_connections=3, max_keepalive_connections=3)
The integrations has not crashed the JointSpace server on my TV (running for 16 hours now) and its only using 3 connections. Before it crashed after 5 minutes.
Just a follow up.... Lost connection after 17 hours. Needed to reboot TV. Now im trying with max_connections=1 and max_keepalive connections=1. I have https://github.com/nstrelow/ha_philips_android_tv integration running and connected to the same TV in my HA production. It might influence the stability of the test.
Another follow up... I have all my 4 philips TV's running in my HA production, without any TV crashes since my last follow up.. I'm using Max Connection=3 and Max keepalive = 3
If you want to test: Download this repository https://github.com/danielperna84/ha-philipsjs. Change Line 260 in init_py from: limits = httpx.Limits(max_keepalive_connections=0, max_connections=3) To: limits = httpx.Limits(max_connections=3, max_keepalive_connections=3) Copy the haphilipsjs folder to your config folder. Restart HA.
Please report back.
If you want to test:
Does the integration out of the box use this library? Or do I need to reconfigure the TV in the HA?
It uses the library out of the box. No need to reconfigure the TV
Copy the haphilipsjs folder to your config folder.
/config/haphilipsjs
or
/config/custom_components/haphilipsjs
?
/config/haphilipsjs
Eh. This wont have any effect at all
You can add a dummy Log entry in async def getReq function to be sure its using the right library LOG.debug("Using local lib haphilipsjs")
You might have to reboot your TV if the JointSpace server has crashed
https://community.home-assistant.io/t/custom-component-for-library-file/334614
Weirdness. I need to check that internally with the team. That should not work.
If you want to test:
Better, but still bad...
Does it kill you server on the TV or does it reconnect again without rebooting your TV?
And is "Allow notification service" on? This kills my 3 "bad" TV's
https://community.home-assistant.io/t/custom-component-for-library-file/334614
Weirdness. I need to check that internally with the team. That should not work.
So.. Yes it does work. But please place them in a deps/ subfolder of your config directory instead, which should work too. Getting them from root of config will go away if i figure out how.
Does it kill you server on the TV or does it reconnect again without rebooting your TV?
I haven’t seen any reboots, but the status is still incorrect, the TV is working, but the status is Off (you can see it from the Android TV line installed on the same TV).
And is "Allow notification service" on?
Off
This kills my 3 "bad" TV's
What does it mean it kills? It is not safe?
So.. Yes it does work. But please place them in a deps/ subfolder of your config directory instead, which should work too. Getting them from root of config will go away if i figure out how.
/config/deps/haphilipsjs
? Or?
Those. wait for the integration update? Should I remove haphilipsjs
after updating? Or will he still be needed?
The problem
I turn on the TV (connected via Lan, the address is static), the media player in HA turns on, and after a while it turns off. Turned on the debugging in the log, I do not see anything special. But in the previous log there were warnings.
What version of Home Assistant Core has the issue?
core-2023.2.5
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Philips TV
Link to integration documentation on our website
https://www.home-assistant.io/integrations/philips_js/
Diagnostics information
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information