I know this is a little edge case but I’m in an Amazon Household with parents who are in another property.(sharing Prime)
Unfortunately the way Amazon handles that is to merge all devices together. So after getting this component working, I have all my parents devices in my HA which isn’t really desirable.
Hope @keatontaylor doesn’t mind me replying on their behalf. You can use the GitHub history which seems be be pretty well documented and hopefully you can work out what you need from that. Looks like you just need to specify the device name (i presume as listed in the Alexa app) with exclude_devices in the media_player entry of your configuration.yaml. Have a look at: https://github.com/keatontaylor/custom_components/commits/master/media_player/alexa.py
This code was added by someone other than me to exclude devices. The code looks like it excludes based on the name of your echo in the Alexa app. Can someone give that a try?
This looks great! I also plan on connecting a dot to whole house audio and this type of setup looks like it would work well. Could you share your card that calls this flow? I have my head around Node-RED a bit, but haven’t figured out how to connect cards to it other than calling flows via URLs.
It’s based off the Alexa name and case sensitive. Specifically, it’s looking for the “accountName” attribute in the json from here (choose url for region).
The code only would stop the excluded devices from being discovered or updated. If you already have the devices (check your entity registry), it would appear but never update. Are the excluded devices showing music updates?
UPDATE: I actually tested it and was able to exclude devices without deleting from the entity registry.
Sorry, that flow may be a little outdated with my current setup now, but here is the related section of my lovelace config. It basically just contains some input_number/select/text entities I created, and I’m also using a custom “mini media player” component for displaying the currently playing song, along with play/pause buttons. Let me know if you need more help.
Thanks! I think I now understand how this gets passed to Node-RED; I make up whatever I want after the input and then listen for a change in Node-RED on that.
After updating the the last version of the component, i get an infinite series of these errors:
2018-12-25 11:23:25 ERROR (Thread-2) [custom_components.media_player.alexa] An error occured accessing the API: An exception of type JSONDecodeError occurred. Arguments:
('Expecting value: line 1 column 1 (char 0)',)
2018-12-25 11:23:25 ERROR (Thread-2) [custom_components.media_player.alexa] An error occured accessing the API: An exception of type JSONDecodeError occurred. Arguments:
('Expecting value: line 1 column 1 (char 0)',)
2018-12-25 11:23:25 ERROR (Thread-2) [custom_components.media_player.alexa] An error occured accessing the API: An exception of type JSONDecodeError occurred. Arguments:
('Expecting value: line 1 column 1 (char 0)',)
2018-12-25 11:23:36 ERROR (Thread-21) [custom_components.media_player.alexa] An error occured accessing the API: An exception of type JSONDecodeError occurred. Arguments:
('Expecting value: line 1 column 1 (char 0)',)
2018-12-25 11:23:36 ERROR (Thread-21) [custom_components.media_player.alexa] An error occured accessing the API: An exception of type JSONDecodeError occurred. Arguments:
('Expecting value: line 1 column 1 (char 0)',)
2018-12-25 11:23:36 ERROR (Thread-21) [custom_components.media_player.alexa] An error occured accessing the API: An exception of type JSONDecodeError occurred. Arguments:
('Expecting value: line 1 column 1 (char 0)',)
How to get rid of this?
EDIT: Also all the echo media players disappeared…
Traceback (most recent call last):
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 260, in setup_alexa
update_devices()
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/util/__init__.py", line 324, in wrapper
result = method(*args, **kwargs)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/util/__init__.py", line 324, in wrapper
result = method(*args, **kwargs)
File "/home/homeassistant/.homeassistant/custom_components/media_player/alexa.py", line 232, in update_devices
update_devices, url)
File "/home/homeassistant/.homeassistant/custom_components/media_player/alexa.py", line 302, in __init__
self.refresh(device)
File "/home/homeassistant/.homeassistant/custom_components/media_player/alexa.py", line 337, in refresh
if 'playerInfo' in self._session:
TypeError: argument of type 'NoneType' is not iterable
How to downgrade to the previous 0.9.5?
EDIT: It’s not an error due to the last release… i downgraded to 0.9.5 but i got same errors…
Has anyone else the same issues?
Might be that but all the dots and echos are working fine, just seems to be since i restarted HA (and updated it). I have since downgraded it and still no luck. It seems to log in ok then errors.
_ 2018-12-25 16:23:33 DEBUG (SyncWorker_2) [custom_components.media_player.alexa] Using cookies to log in_
_ 2018-12-25 16:23:33 DEBUG (SyncWorker_2) [custom_components.media_player.alexa] Log in successful with cookies_
_ 2018-12-25 16:23:33 DEBUG (SyncWorker_2) [custom_components.media_player.alexa] Setting up Alexa devices_
_ 2018-12-25 16:23:37 ERROR (SyncWorker_2) [custom_components.media_player.alexa] An error occured accessing the API: An exception of type JSONDecodeError occurred. Arguments:_
_ (‘Expecting value: line 1 column 1 (char 0)’,)_