-
-
Notifications
You must be signed in to change notification settings - Fork 34.4k
Description
The problem
When my playstation 4 is restarted i can no longer send actions from home assistant unless i manually reload integration. After i have reloaded integration it works fine until next time i restart ps4.
What version of Home Assistant Core has the issue?
core-2025.5.3
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
Sony playstation 4
Link to integration documentation on our website
No response
Diagnostics information
2025-05-28 15:46:20.026 WARNING (SyncWorker_4) [homeassistant.components.ps4.media_player] PS4 could not be reached
2025-05-28 15:51:35.146 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open with args ('/config/.ps4-games.00D9D1595257_cee2.json',) inside the event loop by integration 'ps4' at homeassistant/components/ps4/init.py, line 178: games = load_json_object(g_file) (offender: /usr/src/homeassistant/homeassistant/util/json.py, line 72: with open(filename, mode="rb") as fdesc:), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+ps4%22
For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#open
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/usr/src/homeassistant/homeassistant/main.py", line 227, in
sys.exit(main())
File "/usr/src/homeassistant/homeassistant/main.py", line 213, in main
exit_code = runner.run(runtime_conf)
File "/usr/src/homeassistant/homeassistant/runner.py", line 154, in run
return loop.run_until_complete(setup_and_run_hass(runtime_config))
File "/usr/local/lib/python3.13/asyncio/base_events.py", line 706, in run_until_complete
self.run_forever()
File "/usr/local/lib/python3.13/asyncio/base_events.py", line 677, in run_forever
self._run_once()
File "/usr/local/lib/python3.13/asyncio/base_events.py", line 2034, in _run_once
handle._run()
File "/usr/local/lib/python3.13/asyncio/events.py", line 89, in _run
self._context.run(self._callback, *self._args)
File "/usr/local/lib/python3.13/asyncio/selector_events.py", line 1243, in _read_ready
self._protocol.datagram_received(data, addr)
File "/usr/local/lib/python3.13/site-packages/pyps4_2ndscreen/ddp.py", line 114, in datagram_received
self._handle(data, addr)
File "/usr/local/lib/python3.13/site-packages/pyps4_2ndscreen/ddp.py", line 130, in _handle
callback()
File "/usr/src/homeassistant/homeassistant/components/ps4/media_player.py", line 101, in status_callback
self._parse_status()
File "/usr/src/homeassistant/homeassistant/components/ps4/media_player.py", line 165, in _parse_status
self._games = load_games(self.hass, cast(str, self.unique_id))
File "/usr/src/homeassistant/homeassistant/components/ps4/init.py", line 178, in load_games
games = load_json_object(g_file)
2025-05-28 15:57:17.845 WARNING (SyncWorker_8) [homeassistant.components.ps4.media_player] PS4 could not be reached
2025-05-28 15:57:32.292 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/ps4/media_player.py", line 251, in async_get_title_data
title = await self._ps4.async_get_ps_store_data(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
name, title_id, self._region
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/local/lib/python3.13/site-packages/pyps4_2ndscreen/ps4.py", line 107, in async_get_ps_store_data
result_item = await async_search_ps_store(title_id, region)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/pyps4_2ndscreen/media_art.py", line 216, in async_search_ps_store
async with aiohttp.ClientSession() as session:
~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.13/site-packages/aiohttp/client.py", line 310, in init
loop = loop or asyncio.get_running_loop()
~~~~~~~~~~~~~~~~~~~~~~~~^^
RuntimeError: no running event loop
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/ps4/media_player.py", line 283, in async_get_title_data
await self.hass.async_add_executor_job(self.update_list)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 880, in async_add_executor_job
tracked = asyncio.current_task() in self._tasks
~~~~~~~~~~~~~~~~~~~~^^
RuntimeError: no running event loop
Example YAML snippet
action: ps4.send_command
data:
entity_id: media_player.playstation_42
command: right
Anything in the logs that might be useful for us?
Additional information
No response