thlucas1 / homeassistantcomponent_spotifyplus

Home Assistant integration for Spotify Player control, services, and soundtouchplus integration support.
MIT License
42 stars 3 forks source link

Initialization takes 7 minutes on every Home Assistant reboot #34

Closed peteruid closed 1 month ago

peteruid commented 1 month ago

System Health details

It's trying to enumerate the players in my home. It fails over and over and iterates over the list of them many times, timing out on each try.

Checklist

Describe the issue

I have a dozen Spotify Connect devices, all made by Bowers and Wilkins. For each one I get multiple failures trying to retrieve info about them. Total time to 'initialize' the plugin is 7 minutes, making it almost unusable in my system.

Reproduction steps

1.Configure Plugin 2.Wait 3.Profit? But seriously, that's all it is for me. Would be nice to have an option for a 'quick' check or similar to skip this for devices that don't respond to the queries. Interestingly, all of my devices are listed for use as 'target this device if nothing is playing', and that works great... ...

Debug logs

Logger: spotifywebapipython.spotifyclient
Source: /usr/local/lib/python3.12/site-packages/smartinspectpython/sisession.py:4458
First occurred: 10:25:21 PM (1 occurrences)
Last logged: 10:25:21 PM

Spotify Connect Zeroconf GetInformation call failed for Instance Name "Kitchen Valence" (Kitchen Valence.local.); instance will be ignored, as it is either powered off or not reachable via the local network

I get hundreds of instances of the above....

Diagnostics dump

No response

thlucas1 commented 1 month ago

@peteruid Thanks for reporting this. For 12 devices, the most it should take is 10 seconds per device * 12 devices = 120 seconds (2 minutes). That is assuming that the devices are not responding to network requests.

If you have some time, let's try to troubleshoot using some steps from the Spotify Connect ZeroConf Troubleshooting guide I put together ...

Can you issue the following DNS-SD command to list Spotify Connect players on the network: dns-sd -B _spotify-connect._tcp. local.

The output should look something like this:

C:\Users\thluc>dns-sd -B _spotify-connect._tcp. local.
Browsing for _spotify-connect._tcp..local.
Timestamp     A/R Flags if Domain                    Service Type              Instance Name
13:54:33.369  Add     3  5 local.                    _spotify-connect._tcp.    Bose-ST300
13:54:33.369  Add     3  5 local.                    _spotify-connect._tcp.    Bose-ST10-1 + Bose-ST10-2 (L+R)
13:54:33.369  Add     3  5 local.                    _spotify-connect._tcp.    Bose-ST10-2
13:54:33.369  Add     2  5 local.                    _spotify-connect._tcp.    Bose-ST10-1
13:54:33.417  Add     2  5 local.                    _spotify-connect._tcp.    HAVM-SpotifyConnect

Post the output so I can diagnose.

Based upon that output, pick one of the device Instance Name's listed and issue the following command, replacing INSTANCE_NAME with the Instance Name of the device you picked (e.g. Bose-ST10-1 in my example output above): dns-sd -L "INSTANCE_NAME" _spotify-connect._tcp local.

The output should look something like this:

C:\Users\thluc>dns-sd -L "Bose-ST10-1" _spotify-connect._tcp local.
Lookup Bose-ST10-1._spotify-connect._tcp.local.
14:44:38.719  Bose-ST10-1._spotify-connect._tcp.local. can be reached at Bose-SM2-341513fbeeae.local.:8200 (interface 5)
 CPath=/zc VERSION=1.0

Post the output so I can diagnose.

From that output, try to issue a Spotify Zeroconf Get Information call from a browser using the following syntax: http://<ipalias>:<port><cpath>?action=getInfo your link will look something like this (using my Bose-ST10-1 details above): http://Bose-SM2-341513fbeeae.local.:8200/zc?action=getInfo

Post the output so I can diagnose.

thlucas1 commented 1 month ago

@peteruid Hi Peter - any interest in trying to debug this issue? If you don't have time I understand, or you gave up on the integration I understand.

Please let me know when you get a chance. Thanks.

thlucas1 commented 1 month ago

No response from user - closing the issue.