# Bug Ticket
## Describe the bug
<A clear and concise description of what …the bug is.>
## Troubleshooting
Make sure to validate all the elements before submitting the ticket (Exception to the steps marked as optional)
* [ X ] Using latest version of spotcast
* [ X ] Using latest stable version of Home Assistant
* [ X ] I have setup the Spotify integration in Home Assistant
* [ ] I have renewed my `sp_dc` and `sp_key` values and restarted Home Assistant (see [README](https://github.com/fondberg/spotcast#enabling-debug-log))
* [ X ] (optional) I have Spotify Premium
* [ ] (optional) I am using multiple accounts
* [ ] (optional) I'm attaching relevant logs with level debug for component spotcast (see [README](https://github.com/fondberg/spotcast#enabling-debug-log))
* [ ] (optional) I'm using entity_id in the service call and have tried device_name but the issue remains
## Environment
- Installation type: [|Container]
- HA version: [2024.8 ]
- spotcast version: [ the latest ]
````
spotcast:
sp_dc: !secret sp_dc
sp_key: !secret sp_key
country: NL
````
I'm using spotcast for some while now but running into some strange issues recently, I hope that you can help to solve these.
1. Is it true that "search" is not supported anymore eg changed?
because I get these errors:
`Action spotcast.start could not be performed. extra keys not allowed @ data['search']. Got None
`
```
alias: Nestmini input Spotify search
description: ""
trigger:
- platform: state
entity_id:
- input_text.spotcast_spotify_search
enabled: true
condition: []
action:
- data:
limit: 20
force_playback: false
random_song: false
repeat: "off"
shuffle: false
offset: 0
ignore_fully_played: false
device_name: Woonkamer
search: "{{ states('input_text.spotcast_spotify_search') }}"
start_volume: 30
enabled: true
action: spotcast.start
mode: single
```
Do I need to change "search" into one of these?
album_name, track_name,playlist_name, show_name, genre_name or artist_name?
2. when I change "search" to "artist_name" and then trigger the same service/action:
```
action: spotcast.start
data:
limit: 20
force_playback: false
random_song: false
repeat: "off"
shuffle: false
offset: 0
ignore_fully_played: false
device_name: Woonkamer
entity_id: media_player.nestmini_woonkamer
track_name: eminem
```
it throws errors like:
```
Logger: homeassistant.components.websocket_api.http.connection
Bron: custom_components/spotcast/helpers.py:337
integratie: Home Assistant WebSocket API ([documentatie](https://www.home-assistant.io/integrations/websocket_api), [problemen](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+websocket_api%22))
Eerst voorgekomen: 13:58:16 (3 gebeurtenissen)
Laatst gelogd: 14:00:46
[140027486657344] Error handling message: Unknown error (unknown_error) admin from 10.0.0.2 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36)
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/spotipy/client.py", line 271, in _internal_call
response.raise_for_status()
File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 1024, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.spotify.com/v1/me/player/queue?uri=spotify:track:3OEer2dQj1eWhSqxatGiru
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 28, in _handle_async_response
await func(hass, connection, msg)
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 793, in handle_execute_script
script_result = await script_obj.async_run(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1799, in async_run
return await asyncio.shield(create_eager_task(run.async_run()))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 463, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 527, in _async_step
self._handle_exception(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 557, in _handle_exception
raise exception
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 525, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 764, in _async_call_service_step
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 727, in _async_run_long_action
return await long_task
^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2763, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2813, in _execute_service
return await self._hass.async_add_executor_job(target, service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/spotcast/__init__.py", line 336, in start_casting
add_tracks_to_queue(client, searchResults[1 : len(searchResults)])
File "/config/custom_components/spotcast/helpers.py", line 337, in add_tracks_to_queue
spotify_client.add_to_queue(track["uri"])
File "/usr/local/lib/python3.12/site-packages/spotipy/client.py", line 1946, in add_to_queue
return self._post(endpoint)
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/spotipy/client.py", line 328, in _post
return self._internal_call("POST", url, payload, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/spotipy/client.py", line 293, in _internal_call
raise SpotifyException(
spotipy.exceptions.SpotifyException: http status: 404, code:-1 - https://api.spotify.com/v1/me/player/queue?uri=spotify:track:3OEer2dQj1eWhSqxatGiru:
Player command failed: No active device found, reason: NO_ACTIVE_DEVICE
```
when I change it to "artist_name" it works without issue.
is there an issue with "track_name"?
any ideas?