Please check v1.8.1
Update
Version 1.8.1 - 6 April 2022
Bug fixes
- Fix for resuming/restoring groups when interrupted by an service call sent to a group member
Iāve been scrolling around and canāt find the source to this Update prompt (links to static code here or another post that says āno longer maintainedā).
Could you please link to version 1.8.1?
The link in this section (from the start post) directs to the latest version on GitHub, which is 1.8.1. now.
Direct link to the script on GitHub here
If you mean that by static code, thatās ineed what it is. It is not a blueprint, so youāll have to update yourself by replacing the current code with the new one. Just replace the part after sequence
(line 62 in my code) so you donāt need to set up your variables again. Make sure you donāt remove any scripts which are placed after this one in case you use scripts.yaml
Works like a charm, thank you!
Great! Thanks for the feedback!
Thank you for the link!
Sorry I scrolled from bottom up to see the latest information and saw code excerpts in this thread. Often is the way on the forums.
I really appreciate it being pushed to Github to receive the updates
Well, itās over 1000 lines now, so it would be a big chunk of code to place here.
And I would have to change it in two places, so this is a lot easier for me. I change it in my own config, test it, and after confirmation that it works properly (or sometimes without, if Iām too hasty, and trust myself too much) I commit it to GitHub.
Update
Version 2.0.0 - 8 April 2022
BREAKING
-
fixed_picture
has bee changed toradio_data
and now also provides the option to add a fixedtitle
for the radio stream. As TuneIn changes the title according to the song playing (well at least it should, but this seems broken lateley) it will no longer refresh after resuming the stream, as TuneIn is no longer used then. To prevent this thetitle
can be provided as well now, for example the slogan of the radio channel can be used here.
New features
- You can provide
extra
setttings to your service call. Curruntly supported arevolume
,wait
andtts
. - Supports sending TTS together with picture and text when sent to a player with a screen.
- More information on how it works here
Docs
- Craeted a separate doc for script call examples which shows how to use the new features. Description how to use the script to send a TTS and change the volume is also placed there now.
- Partial rewrite of the script docs
It took some time, but I did implement your suggestion now
Testing 2.0.0 - everything OK, but some error ocurring.
Would zou be so kind to help me?
https://www.codepile.net/pile/9qBPKME4
Logger: homeassistant.core
Source: custom_components/spotcast/spotify_controller.py:104
Integration: Spotcast (documentation, issues)
First occurred: 8:22:21 PM (1 occurrences)
Last logged: 8:22:21 PM
Error executing service: <ServiceCall spotcast.start (c:d2f293f527554261a768ef4c2af4358e): entity_id=media_player.google_home, force_playback=True, start_volume=101, ignore_fully_played=False, limit=20, shuffle=False, random_song=False, offset=0, repeat=off>
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/core.py", line 1652, in catch_exceptions
await coro_or_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1677, in _execute_service
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 "/config/custom_components/spotcast/__init__.py", line 182, in start_casting
spotify_device_id = spotcast_controller.get_spotify_device_id(
File "/config/custom_components/spotcast/spotcast_controller.py", line 205, in get_spotify_device_id
spotify_cast_device.startSpotifyController(access_token, expires)
File "/config/custom_components/spotcast/spotcast_controller.py", line 87, 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
Iāve seen similar error messages today, but then when sending a TTS using Google Cloud TTS.
It sometimes didnāt work, and sometimes did, without changes to the script or the service call.
So I kinda expect there is something wrong in a dependency, maybe PyChromecast. I donāt think I can solve this on my end.
Moreover another type of error.
Did you change the way how to call the script?
Logger: homeassistant.components.script.google_home_resume
Source: helpers/script.py:1397
Integration: Script (documentation, issues)
First occurred: 9:01:34 PM (2 occurrences)
Last logged: 9:01:34 PM
00 š Google Home Resume: Perform service calls defined in action: Error executing script. Error rendering template for variables at pos 1: UndefinedError: 'homeassistant.helpers.template.Wrapper object' has no attribute 'target'
00 š Google Home Resume: Error executing script. Error rendering template for repeat at pos 15: UndefinedError: 'homeassistant.helpers.template.Wrapper object' has no attribute 'target'
Did you already upgrade to 2.0.1? I remember fixing this today
Oh wait, itās complaining about target, not extra. Could you share a trace again? Think I forgot a check syndrome m somewhere, and I usually use target
in my service calls.
I would like to know which template caused this
Yes, 2.0.1 installed
I was already editing my post, could you provide the trace?
Think I found it, and resolved it in v2.0.2 which I just uploaded.
Could you please check, and if let me know if that works?
I will update the start post tomorrow, going to bed now
2.0.2 indeed solved that type of errors.
Only one remained present:
Logger: pychromecast.socket_client
Source: /usr/local/lib/python3.9/site-packages/pychromecast/socket_client.py:396
First occurred: 11:15:04 PM (2 occurrences)
Last logged: 11:15:26 PM
[([::ffff:c0a8:114]):8009] Failed to connect to service ServiceInfo(type='host', data=('[::ffff:c0a8:114]', 8009)), retrying in 5.0s
Hi,
Decided to try this tremendous piece of work for which I am thankful, but I am not sure what to modify:
- I have 2 google mini speakers
- I donāt have and donāt want speaker groups !!!
- i have a script called radio_script which gives me my favourite radio station
- i have a simple ringbell which plays 10 seconds of a mp3 file.
Where I should declare (script line number xxx) my 2 google home mini (repeat, not as a group) for my radio script to resume after somebody rings doorbell ?
Thank you