the error answer is: invocation of service not work
“Invocazione del servizio script/bose_spotify_diegocampy non riuscita. required key not provided @ data[‘device_id’]”
Spotify official integration - can remove if SpotifyPlus installed.
SoundTouch official integration - can remove if SoundTouchPlus installed.
not sure about Spotcast - the SpotifyPlus / SoundTouchPlus integrations do not use it.
The device_id is a required parameter; you can use an asterisk (e.g. *) symbol to use the default spotify media player as configured in SpotifyPlus options (see Figure 1 below); otherwise, you will need to specify the device id that you want to transfer to - use the Spotify Developer Web API UI to get your current device list (click the “Try It” button to execute the command).
all my best thanks, asterisk works!
not even a boolean was needed, the script simply works on google home and associated with a routine on it, now I can say “Hey google put some music on the Bose” and the music will start, as happens exactly with google home home. Many thanks again, as always the custom integrations work better than the official ones
@thlucas you were so kind, I’ll try to ask here directly:
I deactivated the standard Spotify integration and now use Spotify Plus, but the card you see below no longer works:
Spotcast also no longer works, perhaps because it referred to the original Spotify integration.
I ask you, is it possible to play Spotify music on a Chromecast device with Spotify Plus? Because that’s exactly what spotcast was for, otherwise you won’t be able to wake up the Google Chromecast and Google Home Mini devices.
Do you have anything to recommend to be able to do this, or do I also have to use the original spotify integration to do this?
Also for the card if you have any advice
@Diegocampy Not for sure, but it sounds like they both require the original Spotify integration.
Regarding the SpotCast, I am not sure if it will be compatible with SoundTouchPlus.
If nothing else, SpotifyPlus will work fine if it’s installed with SpotCast and the original Spotify integration - there are no dependencies in SpotifyPlsu for those 2 integrations.
I do not have any Chromecast devices, so not sure on this one. Does it have a Spotify Connect Player device ID assigned to it? You can check by making a call to the SpotifyPlus Get Player Devices service:
Do you see anything in the device list that identifies your Chromecast device? If so, then you can take the device id (the id value) for it and try something like this to play a track:
# transfer playback to specified device id.
service: spotifyplus.player_transfer_playback
data:
entity_id: media_player.spotifyplus_diegocampy
device_id: YOUR_CHROMECAST_DEVICE_ID
play: true
# play the track uri(s).
service: spotifyplus.player_media_play_tracks
data:
entity_id: media_player.spotifyplus_diegocampy
uris: "spotify:track:6zd8T1PBe9JFHmuVnurdRp"
device_id: YOUR_CHROMECAST_DEVICE_ID
The player_transfer_playback should wake up the device if needed, though not sure if that’s true for a Chromecast device. I know it wakes up my Bose SoundTouch if needed.
Please let me know if this works or not, as I am curious since I don’t have any Chromecast devices to play with.
no, it doesn’t appear, in fact you need spotcast to be able to recover them and make them work. No problem, I will keep both integrations installed and thank you very much again for all your help.
playing something on the Chromecast device to “wake” it up.
issue the call to spotifyplus.get_player_devices to get the device id list.
the device id should be in the list this time.
stop play on the Chromecast device.
wait about 20 minutes (maybe more) for the device to go back to sleep.
issue the spotifyplus.player_transfer_playback to transfer playback.
issue the spotifyplus.player_media_play_tracks to start play.
My Bose SoundTouch devices fall off of the device list after about 20 minutes, and I can issue the above sequence to get them to play. Maybe the Chromecast is different, but I am betting not.
My apologies for the vague explanation. Get the current list of Spotify Device ID’s via the Home Assistant Developer Tools \ Services interface. See screen capture (Figure 1) below for an example.
Do the following:
go to the Developer Tools \ Services tab.
select the SpotifyPlus: Get Player Devices service.
select your SpotifyPlus media player Entity ID (SpotifyPlus Diegocampy).
check the Refresh? box to retrieve devices from Spotify Web API.
click Call Service button.
the results are displayed below
find the device id for your ChromeCast device name in the results (in the example below, my Bose SoundTouch device name is Bose-ST10-1 and the device id is 30fbc80e35598f3c242f2120413c943dfd9715fe). If you don’t see your ChromeCast device name, then play a Spotify Track on the ChromeCast device (initiated from your phone or Spotcast). Once it is playing, call the SpotifyPlus: Get Player Devices service again - your ChromeCast device should be in the list if it is playing something.
copy the ChromeCast device id, for specifying in automation scripts.
note that you should not have to do these steps again if the deviec id stays the same for your ChromeCast device (it should - at least my Bose SoundTouch device id does not change).
@Diegocampy - I can’t see what you specified for the Entity ID and the Uri's values. You have to select your SpotifyPlus media player from the Entity ID list, and enter a Spotify Uri value in the Uri's textbox as well as the device id value.
@Diegocampy - I just pushed out v1.0.7 of SpotifyPlus today that might fix the play on ChromeCast issue. There were times that my Sou dTouch would not play either - something going on with the Spotify player. The fix I pushed makes things a little more stable. Give it a try and let me know if it helps. Thanks
@Diegocampy - Did you try it after installing the v1.0.7 that I pushed out yesterday? You might give that a try again if not.
If that doesn’t work, then I’m afraid you might still need to use the SpotCast route unfortunately. It works great for my Bose SoundTouch, but that doesn’t help you with ChromeCast.
@Diegocampy it appears you are talking about the SpotifyPlus integration media player instance. It works the same way as the stock Spotify integration media player, in that it cannot be powered on / off. There is no equivalent Spotify Web API call to power on / off a device, which is why it’s always in an “idle” state when not playing.
In your case, you can just use your SoundTouchPlus media player instance to play Spotify content, yes? The SoundTouchPlus does support power on / off options.
no no, I’m talking about the Bose, therefore the Sound Touch Plus integration.
In my images you can also see the Spotify Plus integration, it’s true, but I was talking about the BOSE. It is the one that is always indicated as waiting, even if it is turned off.
In the screenshot: “Cambiato in in attesa attivato dal servizio media_player:Turn off” in english “Changed to waiting triggered by media_player:Turn off service”.
I don’t understand if it’s my problem, or if this is really how the integration works