I’ve been trying for ages to get a local media mp3 file to play when triggered. The only way I have been able to get this to work is using a short lived token that I have to generate manually every 5 hours or so. So I am thrilled that a new media player feature was added in recent updates except it does not work on my RPi 3 setup. The new “Play media” action allows me to select a Google speaker and the local media file, but it doesn’t even make the connect ding on the speaker when triggered like before when it attempts but the media itself fails to play. It’s like nothing happened. I also can never get the text to speech to work which throws an error of “Failed to call service media_player/play_media.” I don’t see this error with the new action, but I’m not sure where to look for it. I have a second action after the “Play media” to change the speaker volume which fails to execute per the log trace “This node was not executed and so no further trace information is available.” I would really like to not have to manually set this every day. It kind of seems contrary to the idea of automation.
So I recalled reading this thread some time ago, and specifically I was interested in the node red approach. I am a total noob with node red, but I tried to copy the approach shown in this thread best of my understanding. I am able to build a https URL with a short lived auth token on it, but the node red flow connects and dings but no media plays. So, I thought I would just copy/paste this URL from a Debug node into my manual automation to test it. And nothing happens when it’s triggered. It’s like the auth key is no good. Does anyone have a working node red flow that uses a local mp3 audio? If I get the URL from the media tab using the browser network tools the URL works as I would expect. Or failing this, how does one use a long lived token to do something like this? I would really like to get this to work and am so disappointed that the new play media action does not work in this case (and apparently for many other cases as well). TIA!
Here is a log entry:
Logger: homeassistant.core
Source: components/cast/media_player.py:658
First occurred: 10:19:41 PM (9 occurrences)
Last logged: 10:39:50 PM
Error executing service: <ServiceCall media_player.play_media (c:33080fedff4293e11e6e3ce5f5f047f8): device_id=['a5d0a56a34474fa4d3ad1b911caa1e50'], entity_id=['media_player.living_room_speaker'], extra=, media_type=music, media_id=https://fakeplaceholder.duckdns.org/media/local/white_noise.mp3?authSig=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiI4ZTkzMzc1MjMzYzE0NzE0YWViOGE3OTAxMDVjZGE1MCIsInBhdGgiOiJodHRwczovL215Y3JvZnRob2xtZXMuZHVja2Rucy5vcmcvbWVkaWEvbG9jYWwvd2hpdGVfbm9pc2UubXAzIiwiaWF0IjoxNjQ3MTQ5MzU2LCJleHAiOjE2NDcxNDk2NTZ9.mhQW2T6sQiJ8PZrDTyZXmeEo5HesSfpPyWNjXuv-GMc>
Error executing service: <ServiceCall media_player.play_media (c:ea52a6863e4f731ee31843e3bb69b07d): device_id=['a5d0a56a34474fa4d3ad1b911caa1e50'], extra=, media_type=music, media_id=https://fakeplaceholder.duckdns.org/media/local/white_noise.mp3?authSig=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiI4ZTkzMzc1MjMzYzE0NzE0YWViOGE3OTAxMDVjZGE1MCIsInBhdGgiOiJodHRwczovL215Y3JvZnRob2xtZXMuZHVja2Rucy5vcmcvbWVkaWEvbG9jYWwvd2hpdGVfbm9pc2UubXAzIiwiaWF0IjoxNjQ3MTQ5MzU2LCJleHAiOjE2NDcxNDk2NTZ9.mhQW2T6sQiJ8PZrDTyZXmeEo5HesSfpPyWNjXuv-GMc>
Error executing service: <ServiceCall media_player.play_media (c:a181f15bb32291c8f5b1864defeff6f2): device_id=['a5d0a56a34474fa4d3ad1b911caa1e50'], extra=, media_type=music, media_id=https://fakeplaceholder.duckdns.org/media/local/white_noise.mp3?authSig=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiI4ZTkzMzc1MjMzYzE0NzE0YWViOGE3OTAxMDVjZGE1MCIsInBhdGgiOiJodHRwczovL215Y3JvZnRob2xtZXMuZHVja2Rucy5vcmcvbWVkaWEvbG9jYWwvd2hpdGVfbm9pc2UubXAzIiwiaWF0IjoxNjQ3MTQ5MzU2LCJleHAiOjE2NDcxNDk2NTZ9.mhQW2T6sQiJ8PZrDTyZXmeEo5HesSfpPyWNjXuv-GMc>
Error executing service: <ServiceCall media_player.play_media (c:74d81e3403eaec85808c7a95c29d9d14): device_id=['a5d0a56a34474fa4d3ad1b911caa1e50'], entity_id=['media_player.living_room_speaker'], extra=, media_type=music, media_id=https://fakeplaceholder.duckdns.org/media/local/white_noise.mp3?authSig=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiI4ZTkzMzc1MjMzYzE0NzE0YWViOGE3OTAxMDVjZGE1MCIsInBhdGgiOiJodHRwczovL215Y3JvZnRob2xtZXMuZHVja2Rucy5vcmcvbWVkaWEvbG9jYWwvd2hpdGVfbm9pc2UubXAzIiwiaWF0IjoxNjQ3MTQ5NTg0LCJleHAiOjE2NDcxNDk4ODR9.qxruLTZ8MCJCwtzE_mWB7WW-KJc3tyWeTNYZRbMrUj4>
Error executing service: <ServiceCall media_player.play_media (c:f98e8e585606ef3add19da81c4515544): device_id=['a5d0a56a34474fa4d3ad1b911caa1e50'], extra=, media_type=music, media_id=https://fakeplaceholder.duckdns.org/media/local/white_noise.mp3?authSig=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiI4ZTkzMzc1MjMzYzE0NzE0YWViOGE3OTAxMDVjZGE1MCIsInBhdGgiOiJodHRwczovL215Y3JvZnRob2xtZXMuZHVja2Rucy5vcmcvbWVkaWEvbG9jYWwvd2hpdGVfbm9pc2UubXAzIiwiaWF0IjoxNjQ3MTQ5ODc1LCJleHAiOjE2NDcxNTAxNzV9.FbDbJw24es9cVWGzwP6B9ZJKwAGcIdEQ8FO_vjwZz2I>
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/core.py", line 1654, in catch_exceptions
await coro_or_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1673, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
await self.hass.helpers.service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 668, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 949, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 705, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/components/cast/media_player.py", line 658, in async_play_media
await self.hass.async_add_executor_job(
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.9/site-packages/pychromecast/quick_play.py", line 77, in quick_play
controller.quick_play(**data)
File "/usr/local/lib/python3.9/site-packages/pychromecast/controllers/media.py", line 665, in quick_play
self.play_media(media_id, media_type, **kwargs)
File "/usr/local/lib/python3.9/site-packages/pychromecast/controllers/media.py", line 566, in play_media
raise PyChromecastError()
pychromecast.error.PyChromecastError