Hi, all my alexa groups (7) are music groups and working normal for all announcements or tts and I have two echo show and 6 other echos
Great integration!
I’m having some issues with the repeat switch for my Echo Dot… as per expected behaviour it is unavailable until an appropriate media service is active (like Amazon Music) - as expected, when playing it then becomes available. However, when I then toggle the now active switch, I get an error message of 'NoneType' object has no attribute 'data'
. The switch still toggles (and repeat does seem to activate), so not sure what the problem is. Full log of the error is as follows:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 185, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1491, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1526, in _execute_service
await handler.job.target(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
await self.hass.helpers.service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 658, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 760, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 695, in _handle_entity_call
await result
File "/config/custom_components/alexa_media/switch.py", line 222, in async_turn_on
await self._set_switch(True, **kwargs)
File "/config/custom_components/alexa_media/helpers.py", line 156, in _catch_login_errors
result = await func(*args, **kwargs)
File "/config/custom_components/alexa_media/switch.py", line 213, in _set_switch
await self._client.async_update()
File "/config/custom_components/alexa_media/helpers.py", line 156, in _catch_login_errors
result = await func(*args, **kwargs)
File "/config/custom_components/alexa_media/media_player.py", line 891, in async_update
or email not in self.hass.data[DATA_ALEXAMEDIA]["accounts"]
AttributeError: 'NoneType' object has no attribute 'data'
Any thoughts?
Hi, well here they don’t. I will try later on a different HA installation.
can you share any details about how you created your groups or other setup details? did you create the groups on the alexa app and then call the same named service in HA?
Create groups in the Alexa app, restart HA and use the groups like any other Alexa media player entity
Ok, got 2 new echo dots for prime day today and have been putting this through its paces back and forth, but finally figured out a few things. stereo pairs are not recognized in the “all group” in this integration. I have confirmed this. you can still do my workaround to add additional call service for any stereo pairs in your all group for your automation.
Can you please explain? What do you mean with the “all group in this integration”?
I created a speaker group in the alexa app called “all echos” it includes my 2 new echo dots, 1 echo show 5, and a stereo pair created in the alexa app as well. out of the 5 speakers, this “all group” only announces on the 3 individual echos in the group and ignores the stereo pair, but all work as expected playing music and sending announcements from the alexa app.
I don’t know the behavior of a stereo pair integrated in an Alexa group. I would add them to the group as single echo like all others.
not a chance, lol. if you have a matching pair of echos or echo dots and a fire tv 4k stick, you can setup a home theater with right and left channels. If you aren’t using stereo pairs, you are missing out on the best sound you can get from two echos imho. with sound bars for tv’s costing over $100 and up, I get super sound from a pair of 3rd gen echo dots that cost me under $50.
Okay, I see, thanks.
I have an “uberall” group as well, in there are three Dots, a Show and a Plus. The Plus and the Show built another group, as two Dots do, which built a stereo group.
When I send an announce to the “uberall” group it appears everywhere except on the stereo group (tts does not work at all).
On the other hand does an announce to the stereo group work, but I can’t play music on either group except on the stereo group when one of the members is addressed.
I am new to Home Assistant and been playing around with Media Player. I am able to control my amazon echo devices without any issue and issue commands.
As part of my setup I have 2 Phillip Hue lights connected to my Echo Plus.
Home Assistant has identified the lights, but when I attempt to toggle them on or off I get the error message “Failed to call service light/turn_off. can’t compare offset-naive and offset-aware datetimes”.
This happens for both lights and I’m unsure if I’m doing something wrong? After the error I can still turn the lights on/off with my amazon devices so the lights themselves are responsive.
Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/alexa_media/alexa_entity.py:329
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 10:17:24 PM (15 occurrences)
Last logged: 10:46:29 PM
[140075937409104] can't compare offset-naive and offset-aware datetimes
[140075988747264] Error handling message: Unknown error
[140075988747264] can't compare offset-naive and offset-aware datetimes
[140075788390352] can't compare offset-naive and offset-aware datetimes
[140075788390352] Error handling message: Unknown error
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 185, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1491, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1526, in _execute_service
await handler.job.target(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
await self.hass.helpers.service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 658, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 760, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 695, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 426, in async_handle_light_off_service
await light.async_turn_off(**filter_turn_off_params(light, params))
File "/config/custom_components/alexa_media/light.py", line 332, in async_turn_off
await self._set_state(False)
File "/config/custom_components/alexa_media/light.py", line 317, in _set_state
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 368, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 402, in _async_write_ha_state
state = self._stringify_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 374, in _stringify_state
state = self.state
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 772, in state
return STATE_ON if self.is_on else STATE_OFF
File "/config/custom_components/alexa_media/light.py", line 215, in is_on
power = parse_power_from_coordinator(
File "/config/custom_components/alexa_media/alexa_entity.py", line 277, in parse_power_from_coordinator
return parse_value_from_coordinator(
File "/config/custom_components/alexa_media/alexa_entity.py", line 305, in parse_value_from_coordinator
if is_cap_state_still_acceptable(cap_state, since):
File "/config/custom_components/alexa_media/alexa_entity.py", line 329, in is_cap_state_still_acceptable
return time_of_sample >= since
TypeError: can't compare offset-naive and offset-aware datetimes
Resolved - setting the time to 24 hour format fixed it - 2021.6: A little bit of everything - Home Assistant
What I find interesting also is I can ask that Alea if she is online and will say she is however I have some notifications inside the Alexa app that are set to speak on all devices but they no longer do on that device. The Alexa app when I click on the device shows it and shows the light in that room on. If I ask that Alexa the weather she replies with it. However if I go to my Everywhere group on the app that Alexa doesn’t show and when I edit that groups says she is offline but she isn’t physically offline. Sure if I try and chat with Amazon they will ask me to unplug it for the 100th time.
Hi,
I was wondering if there’s a way we can find out when alexa media player will need to be re-authenticated. I’ve run strings command on .storage/[email protected]
the dates returned are in the past or 11 months in the future.
Tue, 31-May-2022 22:22:23 GMT
Mon, 30-May-2022 22:45:06 GMT
+1 Jun 2021 22:22:23 GMT; Domain=.amazon.com
I’ve tried to use alexa voice command with my alarm setup in the past, but I wake up alexa requiring re-authentication so none of the voice commands work, so I’ve stopped using it for now until I can figure a way of when it expires, and manually re-authenticate somehow before it expires in the middle of the night.
Thanks
Alexa triggers an exeption when a rauthentification is needed. You see it in the notifications bar on the left bottom of HA.
In your case I would create an automation with mobile notification (HA companion app or other services). This is the event you have to use as trigger: alexa_media_relogin_required
Thanks
this kind of trigger would fire when re-authentication is needed at the moment the login expires,
any way there could be a more advance notice that it will expire at a certain day and time?
If amazon would provide such an information I’m shure that the alexa media_player team would pass it through to HA.
For the time being, there is no such information available. At least I’ve never heard that amazon gives a hint of an upcoming reauth.
Thanks
This is what i’ve put together, in case someone else needs an alert notification.
notify.mobile_app_iphone was created by installing HA app on iphone,
notify.alert_pierre_text is using platform smtp I use my mobile provider
email to text to receive a text message. I use a dedicated gmail account for HA to send email to text, I had to reduce some security settings in the dedicated gmail account for the smtp platform to work from HA.
below is untested with alexa media, if i encounter issues i’ll edit this post and correct any tweaks later.
in configuration.yaml
notify:
- name: alert_pierre_text
platform: smtp
server: smtp.gmail.com
port: 587
sender: !secret gmail_sender_username
encryption: starttls
username: !secret gmail_sender_username
password: !secret gmail_sender_password
recipient: #########@tmomail.net
sender_name: Home Assistant
in automation.yaml
- id: alexa_media_login_expired
alias: Alexa Media Login Expired
trigger:
- platform: event
event_type: alexa_media_relogin_required
mode: single
action:
- service: notify.mobile_app_iphone
data:
title: "Alert in HA"
message: "Alexa Media Login has expired"
- service: notify.alert_pierre_text
data:
message: "Alexa Media Login has expired"
I continue to get this message, even after updating from Core5.5 to Core7.1, changing my time format to 24-hr, and deleting and re-adding the integration.
The error message occurs every time I command the HA UI to execute an OFF, or ON command to any of the 6 zigbee devices that are paired to my Echo Plus. The first time for the ON and for the OFF command in HA gets executed, though the error message appears. After that, only the error message. These entities in HA also get updated when Alexa changes the states via voice commands any number of times, until a command is issued from HA. I have enabled logging as explained elsewhere in this topic, but i see no evidence of commands related to ON/OFF/DIMMING commands issued to the devices in question.