The background: I’m trying this for four years now, with intermittent success. Sometimes it works, but most times it doesn’t.
Just simple playback to Kodi. Kodi is integrated into HA via the official integration, I can see it in the Media sources, I can play to it via HA Media browser UI.
HA 2023.8.3 (irrelevant, happening for years)
Kodi 19.5 (LIBREELEC 10.0.4) (ditto)
The Issue: When trying to play media to it via an automation though, almost always (but not always!) I’m just getting a “no active player” popup in HA. In log:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 659, in async_trigger
await self.action_script.async_run(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1569, in async_run
return await asyncio.shield(run.async_run())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 420, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 470, in _async_step
self._handle_exception(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 493, in _handle_exception
raise exception
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 468, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 703, in _async_call_service_step
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 665, in _async_run_long_action
return long_task.result()
^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 1974, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2011, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
return await service.entity_service_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 870, in entity_service_call
response_data = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 942, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/kodi/media_player.py", line 242, in wrapper
await func(obj, *args, **kwargs)
File "/usr/src/homeassistant/homeassistant/components/kodi/media_player.py", line 749, in async_set_shuffle
raise RuntimeError("Error: No active player.")
RuntimeError: Error: No active player.
The goal: to have NFC tags starting playback on TV for my kid. I have it working for Spotify but Kodi is half broken and Jellyfin support is practically nonexistent in HA.
Any tips? Thanks.