Echo Devices (Alexa) as Media Player - Testers Needed

working now thankyou

The same thing seems to happen.

Hmm, I may need to create a test amazon.fr account to see what is going on

I’ve just set this up, and it works perfectly (not that the docker version didn’t also work btw). This is much more straight forward and really good work. I guess the next step/evolution is to get it into HA as a core component :slight_smile:

Really impressed with the work you’ve put into this!

Thank you.

@pembo thanks!

For those who have gotten the component only non-addon version working. What location are you in? Everyone in the US, or have others in other countries gotten it to work?

I’m in UK and it’s all working good other than my inability to read the captcha’s right :smiley:

Will do more testing tomorrow when the house is awake, but everything looks like it was before :slight_smile:

I’m in Brazil. Can’t get the captcha

image

US for me.

@SouzaaThales, hmmm that is odd that you’re not getting the captcha image. If the captcha wasn’t present it wouldn’t even give you the configure button at all. Does restarting home assistant make any difference?

After 3 restarts I was still having the same problem, then I tried a random number, clicked the “confirm” button and the captcha appeared

Now it’s working.

Huh, so it seems that for whatever reason gathering the captcha fails on start, but works just fine when it grabs a new one after it is entered incorrectly.

Does v.6 Have 64 bit support?

Yep, I’m running on HassOS 64

Thanks! This is really good work, opens loads of opportunities now!

When trying to use with Hassbian, this line causes an error.

from bs4 import BeautifulSoup.

If I comment this line out and reboot, then this is the error log.

Error while setting up platform alexa
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/requests/models.py", line 346, in _get_idna_encoded_host
    host = idna.encode(host, uts46=True).decode('utf-8')
  File "/srv/homeassistant/lib/python3.5/site-packages/idna/core.py", line 361, in encode
    s = alabel(label)
  File "/srv/homeassistant/lib/python3.5/site-packages/idna/core.py", line 284, in alabel
    check_label(label)
  File "/srv/homeassistant/lib/python3.5/site-packages/idna/core.py", line 261, in check_label
    raise InvalidCodepoint('Codepoint {0} at position {1} of {2} not allowed'.format(_unot(cp_value), pos+1, repr(label)))
idna.core.InvalidCodepoint: Codepoint U+201C at position 1 of '“amazon' not allowed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/requests/models.py", line 394, in prepare_url
    host = self._get_idna_encoded_host(host)
  File "/srv/homeassistant/lib/python3.5/site-packages/requests/models.py", line 348, in _get_idna_encoded_host
    raise UnicodeError
UnicodeError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 129, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for
    return fut.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 91, in setup_platform
    login = AlexaLogin(url, email, password)
  File "/home/homeassistant/.homeassistant/custom_components/media_player/alexa.py", line 474, in __init__
    self.login()
  File "/home/homeassistant/.homeassistant/custom_components/media_player/alexa.py", line 511, in login
    resp = self._session.get(site)
  File "/srv/homeassistant/lib/python3.5/site-packages/requests/sessions.py", line 525, in get
    return self.request('GET', url, **kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/requests/sessions.py", line 498, in request
    prep = self.prepare_request(req)
  File "/srv/homeassistant/lib/python3.5/site-packages/requests/sessions.py", line 441, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/srv/homeassistant/lib/python3.5/site-packages/requests/models.py", line 309, in prepare
    self.prepare_url(url, params)
  File "/srv/homeassistant/lib/python3.5/site-packages/requests/models.py", line 396, in prepare_url
    raise InvalidURL('URL has an invalid label.')
requests.exceptions.InvalidURL: URL has an invalid label.

using amazon.com.au as login.

As it stands right now there is no auto-installation of python requirements/dependencies. If BeautifulSoup is not installed or not properly installed the custom component will fail.

A solution would be to install Beautiful Soup manually.

pip3 install bs4

The above command might work.

@keatontaylor I have run as you suggested, no luck.

Also tried pip3 install beautifulsoup4 and apt-get install python3-bs4. New error log below.

Error loading custom_components.media_player.alexa. Make sure all dependencies are installed
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/loader.py", line 86, in get_component
    module = importlib.import_module(path)
  File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 673, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/home/homeassistant/.homeassistant/custom_components/media_player/alexa.py", line 14, in <module>
    from bs4 import BeautifulSoup
ImportError: No module named 'bs4'

I get this error any ideas why?

        Error while setting up platform alexa
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/requests/models.py", line 346, in _get_idna_encoded_host
    host = idna.encode(host, uts46=True).decode('utf-8')
  File "/usr/lib/python3.6/site-packages/idna/core.py", line 361, in encode
    s = alabel(label)
  File "/usr/lib/python3.6/site-packages/idna/core.py", line 284, in alabel
    check_label(label)
  File "/usr/lib/python3.6/site-packages/idna/core.py", line 261, in check_label
    raise InvalidCodepoint('Codepoint {0} at position {1} of {2} not allowed'.format(_unot(cp_value), 
pos+1, repr(label)))
idna.core.InvalidCodepoint: Codepoint U+201C at position 1 of '“amazon' not allowed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/requests/models.py", line 394, in prepare_url
    host = self._get_idna_encoded_host(host)
  File "/usr/lib/python3.6/site-packages/requests/models.py", line 348, in _get_idna_encoded_host
    raise UnicodeError
UnicodeError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 129, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
    return fut.result()
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/media_player/alexa.py", line 91, in setup_platform
    login = AlexaLogin(url, email, password)
  File "/config/custom_components/media_player/alexa.py", line 474, in __init__
    self.login()
  File "/config/custom_components/media_player/alexa.py", line 511, in login
    resp = self._session.get(site)
  File "/usr/lib/python3.6/site-packages/requests/sessions.py", line 525, in get
    return self.request('GET', url, **kwargs)

I just posted the same thing above bud, @keatontaylor responded saying BeautifulSoup needs to be installed as a dependency, it hasn’t helped the component to load though.

How did you install beautiful soap if I may ask?