HomePod Connect: Spotify on HomePods with Spotify Connect

You can maybe use the spotify integration to choose the playlist. but not through owntone

Not sure if anyone else has encountered this, but Iā€™ve been having an issue with the Owntone integration controlling the HomePod Connect Owntone instance after a VM reboot. The integration would be able to read the state of entities, but no controls would go through until either a HA reboot or the Owntone integration config was deleted and re-added.

Looked into it a bit and ended up resolving it by changing the add-on config startup option to ā€œservicesā€ from ā€œapplicationā€, so that the add-on is ready prior to Home Assistant starting.

Iā€™ve created a PR for this, but it may need testing to see if it affects others with different configurations than myself.

I saw posts from @wildekek and @6502c and was hoping for some help with my setup. Hereā€™s what Iā€™m trying to do. Iā€™d like to be able to use an HA dashboard card to control Spotify (I have a premium account) and be able to select my playlists and output speakers, including Apple Homepod minis.

Hereā€™s what Iā€™ve doneā€¦
I have the following integrations setup:

  • Spotify
  • Spotcast
  • OwnTone/Librespot
  • HomePod Connect

Iā€™m able to launch the OwnTone setup and see my Spotify account info (playlists, etc.), as well as all of my speakers, including the Apple Homepod minis. However, I can only access this via a web page. I saw screen shots from @wildekek and @6502c of a mini player with multiple speakers. Are any of those Homepod speakers?

If so, would you mind sharing the setup (instructions, YAML, etc.)? I think Iā€™m close to getting this setup, I just need the dashboard card stuff working. Many thanks in advance.

(Example)
image

1 Like

This is the yaml configuration I use that reduces clutter and only includes the needed elements.

The LG webOS TV LQ625S device will run a script to turn on theTV and set volumes etc. It is not perfect, but works.


type: grid
square: false
columns: 1
cards:
  - type: custom:mini-media-player
    entity: media_player.owntone_server_2
    group: true
    icon: mdi:spotify
    artwork: material
    hide:
      name: true
      volume: false
      source: true
      power_state: false
      artwork_border: true
    scale: '1.4'
  - type: custom:mini-media-player
    entity: media_player.owntone_output_yamaha_tv_2
    group: true
    name: Yamaha TV
    hide:
      play_pause: true
      mute: true
      power_state: false
    background: black
  - type: custom:mini-media-player
    entity: media_player.owntone_output_ba790_ta_2
    group: true
    hide:
      play_pause: true
      mute: true
      power_state: false
    name: BA790 TA
  - type: custom:mini-media-player
    entity: media_player.owntone_output_onkyo_cd_living_room
    group: true
    name: Onkyo CD Living Room
    hide:
      play_pause: true
      mute: true
      power_state: false
  - type: custom:mini-media-player
    entity: media_player.owntone_output_basement_west_onkyo_cd
    group: true
    name: Basement West Onkyo CD
    hide:
      play_pause: true
      mute: true
      power_state: false
  - type: custom:mini-media-player
    entity: media_player.owntone_output_basement_east_2
    group: true
    name: Basement East
    hide:
      play_pause: true
      mute: true
      power_state: false
  - type: custom:mini-media-player
    entity: media_player.owntone_output_lg_webos_tv_lq625s_2
    group: true
    name: LG webOS TV LQ625S
    hide:
      play_pause: true
      mute: true
      volume: true
      power_state: false
    tap_action:
      action: call-service
      service: script.turn_on
      service_data:
        entity_id: script.turn_off_lg_webos_smart_tv
  - type: custom:mini-media-player
    entity: media_player.owntone_output_onkyo_cd_living_room_2
    group: true
    hide:
      play_pause: true
      mute: true
      power_state: false
    name: Living Room Onkyo CD
  - type: custom:mini-media-player
    entity: media_player.owntone_output_kitchen_speaker_2
    group: true
    hide:
      play_pause: true
      mute: true
      power_state: false
    name: Chromecast Speaker
  - type: custom:mini-media-player
    entity: media_player.owntone_output_sabrent_de86
    group: true
    name: Onkyo CD Attic
    hide:
      play_pause: true
      mute: true
      power_state: false
  - type: custom:mini-media-player
    entity: media_player.owntone_output_apple_tv_attic
    group: true
    name: Apple TV MBR
    hide:
      play_pause: true
      mute: true
      power_state: false
  - type: custom:mini-media-player
    entity: media_player.owntone_output_front_porch_pair
    group: true
    name: Front Porch Speaker
    hide:
      play_pause: true
      mute: true
      power_state: false
  - type: custom:mini-media-player
    entity: media_player.TuneAero
    group: true
    name: TuneAero
    hide:
      play_pause: true
      mute: true
      power_state: false

Does that work with output to Apple Homepod minis?

1 Like

pic1

@wildekek Do you mind sharing your YAML code? I like the look of the volume control on the same line as the speaker.

Hiding controls should give you that look.

- type: custom:mini-media-player
   entity: media_player.owntone_output_yamaha_tv_2
   group: true
   name: Yamaha TV
   hide:
     play_pause: true
     power_state: false
     controls: true

Thanks. The hide \ controls code worked for me.

hide:
  controls: true

image

Does anyone have the problem that it stops playing after about 3 songs? And then wonā€™t be able to open the song playing in Spotify, so u have to restart this integration and then only then it works

Hi Alex,
thanks for this modified OwnTone image. I am not using HA yet, but the image works nice in standalone mode. I am using it on my Raspi4 to have a default setting, which stream Spotify to all rooms with HomePods.
Spotify Connect works from WebPlayer, Android and old iPhones which otherwise can not stream to HomePods (with new home firmware) anymore.

First I saw a lot of ā€œRequest failed status: 500 Internal Server Errorā€ - in this link I found the solution that my AirPlay access was the problem.
Allowing AirPlay access

  1. Launch Home app on iPhone or iPad.
  2. Tap on the ā€¦ menu at the top right, then tap Home Settings.
  3. Tap Speakers & TV.
  4. I needed to switch from ā€œOnly People Sharing this Homeā€ to ā€œEveryoneā€ (also ā€œAnyone On the Same Networkā€ did not work)
  5. I also tried ā€œRequire Passwordā€, but I could not find where to configure the password in Owntone.

Btw, what are the benefits or the requirements of using the librespot-java library instead of the librespot in the linuxserver/daapd?

1 Like

Very happy that this addon works again! I canā€™t get used to Music Assistant and it keeps losing the connection to my speakers. Glad that Owntone works again!

Yeah I also tried it, but itā€™s so unreliable rn. Also after a couple of seconds the speakers are out of sync. Owntone is really doing a good job here.

The other one is the old deprecated implementation. Also it does not support Spotify connect (if I remember correctly). That was the reason I made the add on in the first place. Because at the time there was already an Owntone based add on which did not work with Spotify connect.

Yeah thatā€™s true. Itā€™s btw also mentioned in the first post.

Hi, thanks for this amazing addon.
Need a little help for the spotify connect configuration.
So i tried the ZERO_CONF and librespot can be discovered within local network, except it just keeps connecting. Also tried using username and password combination but then it doesnā€™t show up in spotify connect menu at all.
Is there any way to access the logs of librespot?
Thanks again.

Anyone know where the pipe goes?

I have a custom SMB directory mounted as my media directory and OwnTone doesnā€™t autostart the pipe from librespot-java.

Logs show the audio is running through the pipe with no issue; spotify is continuing to stream; OwnTone doesnā€™t show that anything is playing. Starting a Spotify stream from within OwnTone is fine, just not from within Spotify on other devices.

Did you ever get this working the way you described it? Iā€™m in the same boat.

Multiple HomePods. Spotify Premium.
I want to be able to pick a playlist from the dashboard (e.g. Spotify Lovelace Card) and tell it to play on one or multiple specific homepods. Bonus points if I can see the album art etc. on the player card.

Yes I did. I folllowed the OwnTone instructions and can play Spotify content (playlists, artists, etc) to one or more Homepods. The only catch I found is that I have issues if I try to setup a 2nd instance with another Spotify userā€™s profile. It seems to work best with only one. In the screenshot, Kitchen Mini and Family Room Mini are Homepods.

image

Thanks, thats encouraging. But where do you select to which homepod you want to cast? I can create a media card with the OwnTone Server just fine, and pick my Spotify playlists from the integrated media browser, but I donā€™t see a way to tell it where to cast right from within my dashboard. Iā€™d have to change it from the webserver frontend.

EDIT: Nevermind. Figured it out by looking at your screenshot some more.
You add one media player with the OwnTone Server entity to pick and control music. You add other media cards with each of your player entities (homepods etc.) and just use the on/off icon to activate/deactivate them.

Sorry itā€™s been a while so I donā€™t remember exactly, but I think you have it right. From what I recall, the OwnTone server handles the media, and each speaker is a separate media_player.xxx entity.

1 Like