Just another thought I had.
Only the TTS message actually interrupts the current audio, the phone call is rather irrelevant here.
Why not let it resume the audio after the TTS, but set the volume to 0 as long as the call is going on. Then you only have to set the volume to the original state after the call finished.
I just wanted to try your first idea. Thanks for your second Idea, it is perfect! Works great and I think I will keep it that way. The only āproblemā is that it has a little delay (Music ā TTS ā Music ā Mute), but it works good enough. Thanks again for your idea and brilliant service!
Very cool projectā¦ I had been imagining something like this for a while and finally got around to searching. This is exactly what I needed! Iāve got everything working but have a question about the new automation. It doesnāt yet support resuming Youtube for the screen-devices, right? I only see reference to the audio sources in the automation itself and it doesnāt seem to resume youtube for me out of the box. Let me know if Iām missing somethingā¦ Thanks!
Could you send a trace of the resume script and the helper script when this happens?
The automation checks for the media_player.play_media service call, but the actual resume is handled by the resume script.
It should resume YouTube as well, for now I donāt see a reason why it shouldnāt
I seem to be receiving some errors in the log, since upgrading to this version early this afternoon:
Logger: homeassistant.helpers.script
Source: helpers/script.py:405
First occurred: 18:33:36 (3 occurrences)
Last logged: 18:33:36
Error in 'if[0]' evaluation: In 'template' condition: UndefinedError: 'homeassistant.helpers.template.Wrapper object' has no attribute 'volume_level'
and
Logger: homeassistant.helpers.template
Source: helpers/template.py:141
First occurred: 18:33:06 (2 occurrences)
Last logged: 18:33:36
Template variable warning: 'action' is undefined when rendering '{{ iif(action is mapping,[ action ], action) | selectattr('service', 'defined') | list }}'
Template variable warning: 'homeassistant.helpers.template.Wrapper object' has no attribute 'mass_playing' when rendering '{{ player.mass_playing }}'
Thanks for the replyā¦ on closer inspection, it appears the resume automation isnāt firing at all. This is the output of a node red service_call event listener when Iām interrupting Youtube on the display. Do you spot anything that could account for the automation not triggering?
Resume after sending an image (eg a camera snapshot after somebody rang the doorbell) using media_player.play_media is now supported (also in the automation added in v2.7.0). While sending the image, the speaker is not in state playing so there is a new variable added to define a delay after which the resume will be started. The default is 20 seconds (if not provided).
I had this script up and running on version 2.6.0 - 21 July 2022, It was working beautifully. Now Iāve attempted to migrate to version 2.8.0 - 18 August 2022 and I canāt seem to get it to work. It seems to play Spotify, play for the tts interruption, then I can tell Spotify is reloaded on the speaker, but it doesnāt seem to have loaded the media to play. Iām at a loss.
Logger: homeassistant.core
Source: custom_components/spotcast/spotify_controller.py:104
Integration: Spotcast (documentation, issues)
First occurred: X
Last logged: X
Error executing service: <ServiceCall spotcast.start (c:01GBT68CW0TT2TNMH0DW3ACARZ): entity_id=media_player.main_living_area, force_playback=True, limit=20, repeat=off, random_song=False, ignore_fully_played=False, offset=0, shuffle=False, start_volume=101>
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/core.py", line 1731, in catch_exceptions
await coro_or_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1756, in _execute_service
await self._hass.async_add_executor_job(
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/spotcast/__init__.py", line 190, in start_casting
spotify_device_id = spotcast_controller.get_spotify_device_id(
File "/config/custom_components/spotcast/spotcast_controller.py", line 209, in get_spotify_device_id
spotify_cast_device.startSpotifyController(access_token, expires)
File "/config/custom_components/spotcast/spotcast_controller.py", line 88, in startSpotifyController
sp.launch_app()
File "/config/custom_components/spotcast/spotify_controller.py", line 104, in launch_app
raise LaunchError(
pychromecast.error.LaunchError: Timeout when waiting for status response from Spotify app
Thank you. I was banging my head against the wall wondering how I misconfigured your script. Good to know its an outside issue. Hopefully itās up and running soon. Issues Ā· fondberg/spotcast Ā· GitHub