There’s no one solution. Depends on what you want to do:
Use both and accept the delay in the alexa_media component. You can reduce the scan_interval to reduce the delay but you risk getting blocked by Amazon if you poll too often.
Remove the Spotify component and only rely on the alexa_media component to control in HA. You’ll lose whatever features Spotify has as the most we can do it get it on par with the Alexa app.
Submit a pull request or issue showing how the alexa_media component can determine what the Spotify component is doing. I have no way to test it, so you’ll be reliant on someone else to figure out how to implement that code.
I’m using 0.86.3. Yesterday was working properly, but today is not working.
I’ve got these errors:
Updating alexa media_player took longer than the scheduled update interval 0:00:10
An error occured accessing the API: An exception of type JSONDecodeError occurred. Arguments:
(‘Expecting value: line 8 column 1 (char 7)’,)
Update for media_player.living_room fails
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py”, line 221, in async_update_ha_state
await self.async_device_update()
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py”, line 349, in async_device_update
await self.hass.async_add_executor_job(self.update)
File “/usr/lib/python3.5/asyncio/futures.py”, line 380, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.5/asyncio/tasks.py”, line 304, in _wakeup
future.result()
File “/usr/lib/python3.5/asyncio/futures.py”, line 293, in result
raise self._exception
File “/usr/lib/python3.5/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/home/homeassistant/.homeassistant/custom_components/media_player/alexa.py”, line 495, in update
self.update_devices(no_throttle=True)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/util/init.py”, line 315, in wrapper
result = method(*args, **kwargs)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/util/init.py”, line 315, in wrapper
result = method(*args, **kwargs)
File “/home/homeassistant/.homeassistant/custom_components/media_player/alexa.py”, line 221, in update_devices
for device in devices:
TypeError: ‘NoneType’ object is not iterable
Great work on this componet. I was an early adopter of this, but eventually moved away to the alexa script, for some of the features like last alexa, and routines, etc. I have been following this closely, and will probably move on back very, very soon. I think the only thing holding me back at the moment, is the TTS using scripts, vs the notify service. Mostly I just don’t want to go back and change my automations haha. I’m not in a rush at all, just wondering if you had a rough timeline on when you may be introducing the notify service for this component.
Couple of questions. How are you using this component in regards to turning things on/off? I suspect you’re asking more of a generic Alexa question, but not 100% sure. As far as the ring ligvht staying on, probably not related to HA at all. I do you have “follow on” mode enabled with your echos? Thats the feature with Amazon/Alexa where you say a command, and then she listens again to see if you have another command. For example “Alexa turn on ___” Action happens, and then you say “and turn off ___” without having to say “alexa” a second time. I used it for a few days, but found it more annoying than useful.
I would say stuff like “alexa turn off the living room lamp” …“and the kitchen lights” … and “lock the front door”… etc
OK, but again, how are you using this media component? This is mostly for people using TTS or playing music, not turning on/off switches. Now people do use alexa integration to turn on/off a switch that may run a script or automation that may be used to have thier alexa start music, run a routine, speak using TTS.
I think to simple turn things on and off you better use emulated_hue or ha cloud.
As @ptdalen said most of us use this component to send tts, volume and get the metadata from played music.