I am making a spotify controller using their API https://developer.spotify.com/console/get-users-available-devices/ but when I only receive a response with 3 devices, but on my phone when I click "connect to a device" I get every device in my house (8). Is there another API you can use that gets all the devices? Something I've noticed is that if I start playing music on the devices that are not shown they will pop up, very weird
Unfortunately the web API does not support certain devices, including third-party speakers. Moreover, I've noticed that devices are sometimes not available if the app is not open, or your phone screen is locked, or the device isn't actively playing music. After playing music they will only stay available for a few minutes.
While those devices may be accessible via the Spotify app, they aren't through the API. This is super frustrating, and makes using the Player API very difficult, but unfortunately it's been this way for a long time and it doesn't look like Spotify intends to fix it any time soon.
See this issue: https://github.com/spotify/web-api/issues/671
And device list doc: https://developer.spotify.com/documentation/web-api/guides/using-connect-web-api/#devices-not-appearing-on-device-list
Related spotify community post: https://community.spotify.com/t5/Spotify-for-Developers/v1-me-player-devices-returns-empty-array/m-p/5224904
Note: If you are trying to connect to Sonos devices, they are restricted via the Spotify API but may be accessible via the Sonos API