Echo Devices (Alexa) as Media Player - Testers Needed

Whats the reason for these messages in log?

Error setting up entry ###my login#### - amazon.de for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 190, in async_setup
    hass, self
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 60, in async_setup_entry
    return await hass.data[DOMAIN].async_setup_entry(entry)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 151, in async_setup_entry
    raise ValueError("Config entry has already been setup!")
ValueError: Config entry has already been setup!

This message appears for sensor, switch, alarm_control_panel and media_player
No issues in functionality.

Using latest version with version 0.100 home assistant and the min media page . There seems to be slight problem with setting the volume.
Previously I could use the slider bar to adjust volume . Now when ever I try change volume it immediately goes back down to 0 . As a result my notifications aren’t that loud anymore lol

Does it happen to the regular media player? Is it muted?

Can someone spot my typo please? Going a bit bonkers. :woozy_face:

This works under v2.3.3:

image

This script does not:

  alias: 'Echo Notify Test to Office'
  sequence:
    - service: notify.alexa_media
      data:
        target:
          - media_player.office
        data:
          type: tts
          message: "This is a TTS test message to Office using notify alexa media!"
  alias: 'Echo Notify Test to Office'
    sequence:
    - service: notify.alexa_media
      data:
        data:
          type: tts
        target:
          - media_player.office
        message: "This is a TTS test message to Office using notify alexa media!"
1 Like

Damn! I would have never figured that out. Can’t see any other examples of that double data entry in any examples in the forums at all. Thank you so much. It works!!

Hey Corey. Any chance you could show me what that looks like in a data_template? I’m trying to get Alexa to tell me when my soldering iron is turned on and off. Not quite sure where to insert the data_template bit in the below code.

  - alias: Notify Soldering Iron State
    trigger:
      - platform: state
        entity_id: switch.soldering_iron
    action:
        - service: notify.alexa_media_office_dot
          data:
            data:
              type: tts
            message: "The soldering iron is {{ trigger.to_state.state }}"
  - alias: Notify Soldering Iron State
    trigger:
      - platform: state
        entity_id: switch.soldering_iron
    action:
        - service: notify.alexa_media_office_dot
          data_template:
            data:
              type: tts
            message: "The soldering iron is {{ trigger.to_state.state }}"

That should do it, I’m glad it worked for you!

1 Like

Freak’n awesome, thank you. And of course, I just found the automation examples here!

1 Like

Yeah happens on both players. Definitely not muted
Thanks

It’s all good, I have been there. Sometimes even though the information is there for whatever reason it gets missed. I can’t tell you how many times my check config had a error in automations or scripts and after a hour of looking I missed a ( - ) or space lol

That’s what makes our community the best, we are all here for each other. Have a great day buddy!

I am trying to upgrade to 100.2 using the docker (not HASSIO) image and getting the following errors in the log:

2019-10-16 19:40:08 INFO (SyncWorker_8) [homeassistant.util.package] Attempting install of alexapy==0.5.0,
2019-10-16 19:40:15 ERROR (SyncWorker_8) [homeassistant.util.package] Unable to install package alexapy==0.5.0: ERROR: mycroftapi 2.0 has requirement websocket-client==0.44.0, but you’ll have websocket-client 0.56.0 which is incompatible.

Any ideas on how to fix this?

The message appears if for some reason it’s trying to load the config entry more than once. Would need logs to understand what is causing it but it shouldn’t cause any functionality issues since HA catches it.

Need logs to figure out why. Check the wiki.

You’re on an old version of alexapy. What version of alexa media are you using? You should move to the latest version as no work is being done on older versions.

1 Like

+1 on this. I have built an alarm that repeats a song each X minutes and increments the volume each iteration: the volume regulation doesn’t work anymore. I’m on 0.99.3, I’ll try to update and see if something changes.

1 Like

Couldn’t agree more Corey. I’ve been on other coding forums where you’re told “you won’t learn unless you figure it out for yourself” which sucks. Got that a few times and I’ve never been back. HA forums rock and everyone here is so helpful which is what makes the platform so successful. Thanks again for your assistance.

It’s the standard HASS Docker container from dockerhub so I assume whatever it is grabbing using Pip. i guess i’ll have to create a custom image and upgrade alexapy manually. The alexa media was downloaded from github yesterday, not sure where to find the version. Manifest says “requirements”: [“alexapy==1.3.2”], but the container isn’t able to get that version on its own.

EDIT: Ok, a little more investigation, this doesn’t look related to alexamedia but more of a docker container issue. Something has changed in the way the docker containers use permissions since my previous version (91). It just can’t get permissions to update stuff in my setup. Thanks for leading me down the right path…

Alexa does not work anymore. The issue:

AlexaLogin session is missing required token: 'csrf' This may result in authorization errors, please report

Several restarts, Update to100.2 - no success

Now it’s getting worse:
I uninstalled the component - restart - install - same error.
Even the numer of old versions in HACS configured to 8, no 1.4.1 available.
How can I roll back now?

ok, it seems that only the announce does not work, which doesn’t make it better because all the other stuff is not useful for me up to now.
When I start play music via speech, the cover is shown and a timer ist rorrectly shown as well.
There is something wrong

Got this error a few minutes ago
All what I did is testing tts and announce.

Fri Oct 18 2019 17:49:45 GMT+0200 (Mitteleuropäische Sommerzeit)
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 936, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore  # noqa
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 981, in create_connection
    ssl_handshake_timeout=ssl_handshake_timeout)
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 1009, in _create_connection_transport
    await waiter
ConnectionResetError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/config/custom_components/alexa_media/media_player.py", line 278, in _handle_event
    await _refresh_if_no_audiopush(already_refreshed)
  File "/config/custom_components/alexa_media/media_player.py", line 194, in _refresh_if_no_audiopush
    await self.async_update()
  File "/config/custom_components/alexa_media/media_player.py", line 565, in async_update
    no_throttle=True)
  File "/config/custom_components/alexa_media/helpers.py", line 143, in wrapper
    result = await func(*args, **kwargs)
  File "/config/custom_components/alexa_media/media_player.py", line 362, in refresh
    session = await self.alexa_api.get_state()
  File "/usr/local/lib/python3.7/site-packages/alexapy/alexaapi.py", line 456, in get_state
    '&screenWidth=2560')
  File "/usr/local/lib/python3.7/site-packages/alexapy/alexaapi.py", line 104, in _get_request
    return await self._request('get', uri, data)
  File "/usr/local/lib/python3.7/site-packages/alexapy/alexaapi.py", line 73, in _request
    ssl=self._login._ssl)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 483, in _request
    timeout=real_timeout
  File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 523, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 859, in _create_connection
    req, traces, timeout)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 1004, in _create_direct_connection
    raise last_exc
  File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 986, in _create_direct_connection
    req=req, client_error=client_error)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 943, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host alexa.amazon.de:443 ssl:<ssl.SSLContext object at 0x72638870> [None]
Fehler beim Aufrufen des Service notify/alexa_media_office. required key not provided @ data['message']

Hi, I would like to point out the situation, it was a hard day yesterday :sweat:
The component itself is connected and shows covers when I start playing music ordered by speech and a given timer is shown correctly as well. I’m on 100.2 and Alexa 2.3.3.
Annonce and tts are not working without giving errors directly.
The only errors I got yesterday are shown in my post before.
Both functions worked in the morning. All what I did was a restart because I moved some hue bulbs to deConz.
I would like to rollback to 1.4.1 now but I don’t know how.
Can anybody help?

Set HACS to show enough versions to show 1.4.1. Currently that is about 12-13 entries.

Have you tried recreating the pickle file? The errors in the logs are showing both connection issues and the fact the cookie is no longer valid.

Oh sorry!! It wasn’t my week obviously.
The pickle file. There were tons of posts regarding this.
And it solved the problem.
Please forget the bloody stuff I wrote before.

Thanks a lot :blush: