Closed terba closed 3 months ago
Hey there @onfreund, mind taking a look at this issue as it has been labeled with an integration (kodi
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
kodi documentation kodi source (message by IssueLinks)
I have the same problem. I guess the integration just doesn't interpret a non-reachable kodi device as off? Seem like a logical thing to do.
Edit: It is especially non-sensical, since I can trigger the shutdown from HA, but HA still thinks it is running:
2024-01-21 22:05:58.401 DEBUG (MainThread) [homeassistant.components.kodi.media_player] Firing event to turn off device
2024-01-21 22:05:58.437 DEBUG (MainThread) [homeassistant.components.kodi.media_player] Run API method System.Shutdown, kwargs={}
2024-01-21 22:06:14.742 ERROR (MainThread) [homeassistant.components.kodi.media_player] Error calling async_update on entity media_player.alarmpi_home: TransportError("Error calling method 'Player.GetActivePlayers': Transport Error", TimeoutError())
2024-01-21 22:06:24.742 ERROR (MainThread) [homeassistant.components.kodi.media_player] Error calling async_update on entity media_player.alarmpi_home: TransportError("Error calling method 'Player.GetActivePlayers': Transport Error", TimeoutError())
2024-01-21 22:06:34.743 ERROR (MainThread) [homeassistant.components.kodi.media_player] Error calling async_update on entity media_player.alarmpi_home: TransportError("Error calling method 'Player.GetActivePlayers': Transport Error", TimeoutError())
2024-01-21 22:06:44.742 ERROR (MainThread) [homeassistant.components.kodi.media_player] Error calling async_update on entity media_player.alarmpi_home: TransportError("Error calling method 'Player.GetActivePlayers': Transport Error", TimeoutError())
Same here on Core Version 2024.1.5. The device just shows up as idle when it's suspended. It used to work up until a couple of versions ago. Not sure which version caused it to stop working.
Sounds like a good idea to interpret an unreachable device as off.
Error calling async_update on entity media_player.kodi: TransportError("Error calling method 'Player.GetActivePlayers': Transport Error", TimeoutError())
Error calling async_update on entity media_player.kodi: TransportError("Error calling method 'Player.GetActivePlayers': Transport Error", ClientOSError(113, 'Host is unreachable'))
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.
This is still a problem in version 2024.4.4
Same problem here, the device where Kodi is running is turned off entirely, but HA shows it as idle
and spams the logs with
Error calling async_update on entity media_player.kodi: TransportError("Error calling method 'Player.GetActivePlayers': Transport Error", TimeoutError())
Error calling async_update on entity media_player.kodi: TransportError("Error calling method 'Player.GetActivePlayers': Transport Error", ClientConnectorError(ConnectionKey(host='[IP_ADDRESS]', port=8080, is_ssl=False, ssl=True, proxy=None, proxy_auth=None, proxy_headers_hash=2284523216455086638), OSError(113, "Connect call failed ('[IP_ADDRESS]', 8080)")))
Error calling async_update on entity media_player.kodi: TransportError("Error calling method 'Player.GetActivePlayers': Transport Error", ClientConnectorError(ConnectionKey(host='[IP_ADDRESS]', port=8080, is_ssl=False, ssl=True, proxy=None, proxy_auth=None, proxy_headers_hash=2284523216455086638), ConnectionRefusedError(111, "Connect call failed ('[IP_ADDRESS]', 8080)")))
Hello @All,
I have pretty much the same problem and did some investigations. The reason is a bug in the HTTP Integration of Kodi into home assistant. After digging in the code I found out, that the _working_method is the connection via web socket.
First, you have to activate the web socket connection in KODI (e.g. https://kodi.wiki/view/JSON-RPC_API#WebSocket). Be aware, that I am unaware, if the JSON RPC has an authentication mechanism.
Second, you need to set the web socket port in home assistant. The port is usually 9090. I don't know if one can set the port in the UI. I've changed it manually in the corresponding _core.configentries file in the home assistant config directory. There is a value data.ws_port which needs the corresponding value.
Third, restart home assistant
Solved the problem for me at least. Probably, an (redo-able) configuration dialog supporting setting of the web socket would be good. Also a corrected integration taking the HTTP only connection into account.
regards
The problem
Kodi turned off, but the associated media_player displays on status. Meanwhile in the logs:
What version of Home Assistant Core has the issue?
2023.10.5
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
kodi
Link to integration documentation on our website
https://www.home-assistant.io/integrations/kodi/
Diagnostics information
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
The same as in #45917, but can not write there as it is closed (don't know why is better to create multiple issues of the same problem, than having one open until it gets solved).