Hi guys,
I am a bit lost, I tried a lot to setup spotify to run via a script and play a playlist on my google home mini.
Unfortunately it does not work.
I have the following script:
spotify_test_playback:
alias: Spotify playback
sequence:
- service: media_player.media_play
data_template:
entity_id: media_player.office_speaker
media_content_id: 'spotify:user:vladchiriloiu:spotify:playlist:3rzgkeEOq570xyFZlsv9mV'
media_content_type: 'playlist'
But whenever I execute the script, it does not work and throws this error:
Logger: homeassistant.components.websocket_api.http.connection.140102125000016
Source: core.py:1212
Integration: websocket_api (documentation, issues)
First occurred: 10:44:02 AM (1 occurrences)
Last logged: 10:44:02 AM
extra keys not allowed @ data['media_content_id']
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 134, in handle_call_service
connection.context(msg),
File "/usr/src/homeassistant/homeassistant/core.py", line 1234, in async_call
await asyncio.shield(self._execute_service(handler, service_call))
File "/usr/src/homeassistant/homeassistant/core.py", line 1257, in _execute_service
await handler.func(service_call)
File "/usr/src/homeassistant/homeassistant/components/script/__init__.py", line 207, in service_handler
await script.async_turn_on(variables=service.data, context=service.context)
File "/usr/src/homeassistant/homeassistant/components/script/__init__.py", line 284, in async_turn_on
await self.script.async_run(kwargs.get(ATTR_VARIABLES), context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 693, in async_run
await run.async_run()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 444, in async_run
await self._async_run()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 460, in _async_run
await self._async_step(not propagate_exceptions)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 138, in _async_step
self, f"_async_{cv.determine_script_action(self._action)}_step"
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 233, in _async_call_service_step
context=self._context,
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 101, in async_call_from_config
domain, service_name, service_data, blocking=blocking, context=context
File "/usr/src/homeassistant/homeassistant/core.py", line 1212, in async_call
processed_data = handler.schema(service_data)
File "/usr/local/lib/python3.7/site-packages/voluptuous/validators.py", line 208, in __call__
return self._exec((Schema(val) for val in self.validators), v)
File "/usr/local/lib/python3.7/site-packages/voluptuous/validators.py", line 287, in _exec
raise e if self.msg is None else AllInvalid(self.msg, path=path)
File "/usr/local/lib/python3.7/site-packages/voluptuous/validators.py", line 283, in _exec
v = func(v)
File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 272, in __call__
return self._compiled([], data)
File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 817, in validate_callable
return schema(data)
File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 272, in __call__
return self._compiled([], data)
File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict
return base_validate(path, iteritems(data), out)
File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 432, in validate_mapping
raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: extra keys not allowed @ data['media_content_id']
Can you please give me an idea on what I need to do to make it work?