#Alexa devices

1 messages ยท Page 1 of 1 (latest)

lunar galleon
#

alexa_devices Let's have a chat about Amazon Alexa devices

#

@pallid shale @untold spindle @junior crag @woven flint @full ore

#

@plucky sentinel

pallid shale
lunar galleon
#

Do we know what Amazon expects with headers and such?

pallid shale
#

I think so, lib currently is able to retrieve all devices data

#

Only posting an announcement doesnโ€™t currently work.
But Iโ€™m quite sure we are pretty close for it as well.

queen dawn
#

What is Amazon devices ? You mean the Alexa integration ?

pallid shale
lunar galleon
untold spindle
rigid sphinx
untold spindle
#

@pallid shale Do you have a link to the test script at hand?

pallid shale
untold spindle
#

Yes, thought it would have been somewhere else ๐Ÿซฃ

pallid shale
#

All in the repo ๐Ÿ˜‰

pallid shale
#

I think I got it

#

at least I see in the log: Response 200 for url https://alexa.amazon.it/api/behaviors/preview

#

but not home to check if Alexa really speaks

#

PR updated

#

Works ๐Ÿš€ ๐ŸŽ‰ explode
I used my camera to get the audio from home and I can hear the message

pallid shale
lunar galleon
#

I would say merge in in between branch and get the new platform PR ready

pallid shale
#

Hi

#

finished also migration from httpx to aiohttp

#

Cookies needs a bit more handling. Anyone want to review the PR for letting me know if it's good to go ?

#

Found a simpler way

pallid shale
#

Released 0.14.0

pallid shale
#

Is ok to use from pydantic.utils import deep_update for nested dict update or there is a different, preferred way ?

lunar galleon
#

nested dict update?

pallid shale
#

update some values of a dict inside a dict

#

Was thinking to optimize with something like:
source = {'hello': {'value': 'to_override', 'no_change': 1}} overrides = {'hello': {'value': 'over'}} deep_update(source, overrides) assert source == {'hello': {'value': 'over', 'no_change': 1}}

pallid shale
#

Hi, small (but not so small) update:

  • Implemented both Alexa.Speak and AlexaAnnoucement
  • Tested with httpx: all features implemented works fine !
  • Tested with aiohttp: cannot pass login because of a missing redirect (getting 200 instead of 302)
  • Added a draft PR with a httpx wrapper to allow easy swap from one library to another
#

I spent tens of hours trying to understand what's wrong.
Played with:

  • headers
  • cookies / cookie_jar
  • encoding
    everything without success
#

Anyone willing to help?

pallid shale
#

Hi!

#

a few news:

  • added some features like "play music", "play sound", "send custom text command"
  • code cleanup and optimization
  • create branch "amazon_devices" on core side
  • opened draft PR for the new integration
pallid shale
#

Hi guys, anyone that can help with the aiohttp issue ?

lunar galleon
#

I will try to find some time in the coming week

pallid shale
#

Hi guys, what do you think if we temporary merge the PR for httpx, so we can progress on the HA side and leave the swap to aiohttp for later ?
We are stuck on that task since long time

lunar galleon
#

I am happy to do that

#

as in

#

I thought I would have time now, but I did not and dove in other things and reviews

#

and I expect next week to be revolving around community day, and the week after around my new appartment

pallid shale
#

Thanks! When Iโ€™ll be back home I will proceed with the merge.

pallid shale
#

Hi,
notify platform is ready ๐ŸŽ‰
Will add tests and then prepare a PR

lunar galleon
#

did we use entities?

pallid shale
#

You mean entities instead of actions? If so, yes !

lunar galleon
#

oh awesome

pallid shale
#

@lunar galleon for Alexa I need to be able to specify a method/mode between ( speak, sound, announcement, etc. ).
I though to add a "mode: XXXX" key to notify.send_message data payload, but it fails.
Is that the correct approach ? OR should I instead create more notify entities one per each "method" ?

lunar galleon
#

cc @fresh hull

fresh hull
pallid shale
#

Is not that we expose to Alexa is for talking to a echo

#

And we have different ways to do that: speak, announce, sound, etc.

#

They all work on my library

#

I just need to know if I can extend the data payload of the notify entity or instead I should create a entity for each type/mode

pallid shale
#

Just to clarify even more:

#

Current AMP behavior:

#
action: media_player.play_media
data:
  media_content_id: Metti Radio deejay su tunein
  media_content_type: custom
target:
  entity_id: media_player.echo_dot_sala
#

note: "type can be custom, speak, sound, annount, etc

#

First idea for new integration:

#
action: notify.send_message
data:
  message: test
  mode: speak
target:
 entity_id: notify.echo_dot_sala
#

note: "mode" can be custom, speak, sound, radio, etc.

#

Second idea:

#
action: notify.send_message
data:
  message: test
target:
 entity_id: notify.speak_echo_dot_sala
#

note: will create one entity for each mode

pallid shale
#

Morning, I decided to go ahead and commit notify platform and its tests.
Is based on the last idea exposed above

pallid shale
#

Hi everyone

#

I commited also the switch platform

#

We now have all the main features to include the new integration in core

#

What we miss compared to AMP ?

  • sensors: next alarm, next reminder, next timer
  • media player: real time status of what's playing
  • switch: music shuffle, music repeat
#

BTW, test coverage is 100% so far

pallid shale
#

Thx!

pallid shale
#

Hi guys, integration is finally ready for review !!! Fingers crossed !!!

lunar galleon
#

I'm not sure if it will make June release

#

As in. I don't really feel like rushing it in right now, although I do like the extra week of beta

pallid shale
#

Letโ€™s review anyway please. Then we can await merging if not wanted in beta

lunar galleon
#

@everyone Can you check what the mac addresses are for your alexa devices?

#

So far we have

#
C0:95:CF Amazon Technologies Inc
9C:C8:E9 Amazon Technologies Inc
74:D6:37 Amazon Technologies Inc
10:BF:67 Amazon Technologies Inc
untold spindle
lunar galleon
#

first 3

untold spindle
#

4C:17:44

pallid shale
#

Thx, this resolve to Amazon Technologies Inc as well

lunar galleon
lunar galleon
#

I think we will find many more during beta

rigid sphinx
#

does a fire stick count too? if yes then ec:2b:eb

pallid shale
#

yeah, there will be a lot

lunar galleon
pallid shale
#

seems so

lunar galleon
#

no I mean, do they have any use case in the integration?

pallid shale
#

you can send a custom command to start netflix for example of music and

#

those are present in AMP as well

rigid sphinx
#

yeah i use amp to send a turn tv off to a fire stick which sends to tv via hdmi-cec

pallid shale
#

you may also help finding those info for your devices:

#
"A2U21SRK4QGSE1": {
        "model": "Echo Dot Clock",
        "hw_version": "Gen4",
    }
#

IIRC, AMP shows those info

untold spindle
#

I think AMP does also include the Alexa app on mobile. ๐Ÿค”

pallid shale
#

Yeah but IMHO this doesn't make really sense

lunar galleon
#

@pallid shale bluetooth, shouldn't that be without device class

#

now it shows

pallid shale
#

and it shouldn't ?

#

I have it disconnected on 2 devices and connected on 1

lunar galleon
#

well the bluetooth itelf is not connected

pallid shale
#

is that a bluetooth enabled for you that shows as connected ?

lunar galleon
#

yes

#

as in

#

I don't have it connected with anything

untold spindle
#

Device type for my Echo Dot Gen3 is already in your list.

lunar galleon
#

Can we add a discovery thing where we log in the logs that we found a model ID we have not seen yet and ask them to open an issue against the library?

plucky sentinel
#

Just walking off a mountain

pallid shale
plucky sentinel
#

1100 feet in 1k

lunar galleon
plucky sentinel
#

Too tired

lunar galleon
#

good luck

#

o7

untold spindle
rigid sphinx
#

along with other devices that have alexa built in which may crop up

#

they are at the bottom of the linked above

pallid shale
#

I don't know how trusty is this repo. Will check in the next days

#

Thx for sharing

rigid sphinx
#

yeah, thats fair. i have no idea how that data was sourced. if nothing else it gives you a list of possible random devices that might crop up

lunar galleon
#

ok whats still left ot merge

lunar galleon
#

there's a default implementation for discovery steps

#

it just starts a new flow with the user step, but only if there is no flow running or when there's no config entry added

pallid shale
#

But nothing is discovered

#

oh, DHCP is not getting data on the dev container lately

#

let me try live

lunar galleon
#

it worked for me at least

pallid shale
#

Yeah it's fine, was a dev container network issue

#

one thing less to do ๐Ÿ˜‰

pallid shale
#

Guys, everything that was reasy in now merged !!!

#

Cannot wait you all giving feedback and testing during beta !

untold spindle
#

Did it make it into this beta?

pallid shale
#

Yeah, thx to great help of @lunar galleon

untold spindle
#

Can't wait to retire AMP.

pallid shale
#

We still have 3 things to implement:

  • 3 sensors: next alarm, next reminder, next timer
  • 2 services: send sound and send custom command
  • media player entity with real time WS
rigid sphinx
pallid shale
#

Open to suggestion on how to implement the 3 sensors

#

Maybe a binary sensor that is "ON" if at least 1 timer is on and then in the extra_attributes list all those that are active ?

#

Will start with the services as those are ready from the library point of view

lunar galleon
rigid sphinx
#

attributes are on the way out i think ๐Ÿ˜›

lunar galleon
#

you sometimes need them

rigid sphinx
#

this is the chaos I currently have to give you inspiration on what NOT to do - https://pastebin.com/a7jxnyk5
I wrote this quite a while ago so... whilst i will take questions i may not be able to answer them...

pallid shale
#

throw an idea on the table

lunar galleon
#

services could work

pallid shale
pallid shale
#

How you see the state of the timer with a service ?

lunar galleon
#

response values of a service

pallid shale
#

what's the full flow ?
We have data in the coordinator that are refreshed on a schedule, and then ?

rigid sphinx
lunar galleon
untold spindle
#

I assume you mean like the weather.get_forecasts action?

lunar galleon
#

yes

pallid shale
#

thx for the pointer, will look into it

#

after implementing the actions

rigid sphinx
#

if the data is only on request then there needs to be some kind of push for when an alarm is set/canceled. perhaps an event too.
event types be something like timer set / timer cancelled / timer adjusted so can automate on when something happens

pallid shale
pallid shale
#

Hi guys

#

fine for everyone if I gather data only for active "schedules" ( Timers, Reminders and Alarms ) ?

#

I don't see a use case for those that are already OFF

rigid sphinx
#

when is a timer no longer active? when it reaches the end or when its silenced by the user?

#

I feel that seeing "recently active" timers would be nice. but to be fair i am not sure this means you need to pull the data from expired timers. its just a matter of a user being able to see it. using an event when things happens means a user to pull that data.

#

not exactly sure on implementation but hopefully my use case thoughts are sort of sensible

plucky sentinel
#

@pallid shale are we able to run both AMP and this integration at the same time? I would assume yes. Just asking before I attempt to use it later today

lunar galleon
#

yes

plucky sentinel
pallid shale
#

@rigid sphinx a Timer is no longer active when it expires or it's silenced by the user.
This is the structure I have in mind:

AmazonSchedule(
type='Alarm', 
status='ON', 
label=None, 
original_date='2025-05-28', 
original_time='06:00:00.000', 
recurring_pattern='XXXX-WD', 
remaining_time=0
)```
#

I would say for Alarm we may want 3 entities in the UI:

  • switch: enabled/disabled
  • sensor: time
  • sensor: recurrence
    creating and removing them dinamically ?
rigid sphinx
pallid shale
#

Plus 3 hardcoded and for "next alarm"

pallid shale
rigid sphinx
#

gotcha

#

most of my experience comes from "timers" rather than "alarms"

pallid shale
#

@lunar galleon what do you thin kabout the above design ?

pallid shale
lunar galleon
#

whats the label

rigid sphinx
#

yeah therees subtle differences in what may be wanted. e.g. timer wants to know the length/progress of the timer. whereas an alarm probably only needs "time until"

pallid shale
#

Yup, will rapresent different data for different types

rigid sphinx
#

would "remaining time" be a timedelta or just a number (e.g. in seconds)?

lunar galleon
#

we should do a remaining time, but rather the end time

pallid shale
#

is always a timestamp but one will be named "Alarm schedule" the other one "Timer"

pallid shale
#

or could be None; in this case I would use the internal number like "Timer nยฐ 27"

lunar galleon
#

so its not a sticking one?

pallid shale
#

Exactly

rigid sphinx
#

from what i remember from AMP stuff they have a UUID too right? is it worth adding this as a guanteed unique thing between things in case there is some need at some point?

pallid shale
#

Only sticking would the the โ€œnext alarmโ€

lunar galleon
#

hmpf, I think this isn't ideal

rigid sphinx
#

i remember a situation
if you:
set 10 min timer
set 5 minute timer
using alexa refering to "2nd timer" it will be the 5 min timer.
however on the timer list the 5 minute timer was first because it was "next up"
this means that if you have multiple timers of different lengths they change places in the data.

#

this is a "known issue" of my kitchen dashboard that the order changes

lunar galleon
#

The thing is, this will create entities that appear and dissapear on the go

#

I also have this issue with squeezebox

#

They also want to add alarms

#

Maybe this should be an entity type that just returns a list or so

rigid sphinx
#

was there any thought about the concept of a "timer" within ha itself? which could be used by integrations? e.g. seeing the timer on a VPE. i remember it coming up during a stream or afterparty at some point but no idea if it went anywhere

lunar galleon
#

there is a proposal for that laying around

plucky sentinel
#

@pallid shale nice job on the integration

#

already 100x faster than amp

pallid shale
pallid shale
pallid shale
lunar galleon
#

but it will likely be a difficult one

#

As in, I don't see a nice way to do entities for alarms

  1. They dissapear and are created whenever they feel like
  2. Thus they are hard to automate with
pallid shale
#

Depends, if you use always the same name for a timer or a reminder or a alarm then automation is easy

#

For example timer for cooking or timer for irrigation

#

The trick is to give those object a name (label in my data class)

lunar galleon
#

yes but they still come and go

#

you can't just put them on a dashboard

rigid sphinx
#

i imagine the majority of people dont set a name for their timers

lunar galleon
#

you need to do some fancy templating stuff to be able to properly see them

pallid shale
lunar galleon
#

so yes, you can put everything in entities, but it will be very hard to manage

#

yes, but that is not core

pallid shale
#

True

lunar galleon
#

Like, yes, it's a solution, but it's not the user experience I would want to give to a user

#

out of the box

pallid shale
#

I agree; one solution that would help in a lot of use cases is to first integrate autoentities ๐Ÿ˜Š

lunar galleon
#

I think even with auto entities this will be horrible tbh

#

But hence I think a new platform might fit better here, but I will have to check what others think of this

pallid shale
#

Why ? I use that a lot in my dashboard and is amazing the result (for me at least )

#

And if possible I would also avoid picking up entities

rigid sphinx
#

how silly of a suggestion is it to use a calendar? it will no doubt have some issues but I mean in concept, it does stuff at a specified time and you can measure how long until an event? and it has data fields?

lunar galleon
#

that's very silly michael

#

๐Ÿ˜‚

rigid sphinx
#

yeah, fair enough. it felt silly but it also felt like it "could work"

pallid shale
#

@lunar galleon want to comment about sounds ?

lunar galleon
#

I just did lol

#

but I am now going to bed because I need to sign documents tomorrow to get my house

plucky sentinel
#

Not getting anouncements from the new integration, are we 100% sure you can have both amp and ad running at the same time?

lunar galleon
#

Works on my device

plucky sentinel
#

Getting

#

I think that crashed the thread running it too. Just restarted to see if I can make it work

#

Yeah, definitely a bug somewhere here that crashes the speak/announce thread or callback

#

That exception above is what crashes it, reload does not fix it.

#

have to restart

#

well, that wasn't the reason it wasn't working at first. It's working now, still getting the above exception in the logs.

lunar galleon
#

That's, interesting?

plucky sentinel
#

also getting this on startup

lunar galleon
#

Check

pallid shale
#

I donโ€™t see it always here.
Is there a shared session for httpx like there is one for aiohttp ?

lunar galleon
#

Yes

pallid shale
#

So probably we need to swap to it to avoid the warning ?

lunar galleon
#

Or use the shared session

pallid shale
#

This is what I mean swap to the shared httpx session

lunar galleon
#

Ah

#

I thought you wanted to swap to aiohttp

#

Which is also fine

#

But

#

I don't want you to take on that pressure right now if you don't feel like it

pallid shale
#

Not yet, aiohttp is still not working for some reason

#

And I spent 10+ hours investigating without any luck

#

Found: create_async_httpx_client

#

Will code it once I have a PC in my hands

lunar galleon
#

I checked with the core team and I think it would be nice to improve the alarm entity proposal and give that a shot

#

Be sure to check with @wraith vessel because he also is working on alarms, but in squeezebox

wraith vessel
#

With the demise of attributes, we really do need an alarm entity

plucky sentinel
#

time entity

#

not sure how that would work with entities getting created and removed on the fly

#

as an FYI, WLED does that if you add/remove segments

#

because we don't use attributes, it's going to be very challenging for anyone to properly use anything but "next alarm"

#

probably will need a responding service to get active alarms

#

๐ŸŽ‰

#

maybe a new timer event entity with the new entity in the attribute, then dynamically create time entities while also having a next timer entity?

#

@lunar galleon thoughts?

#

still won't make automations easy though.

lunar galleon
plucky sentinel
#

Uh yes people do

#

WLED is literally designed to have presets create & destroy segments

#

it's a fucking nightmare to manage on HA"s side because of the thought that "people don't do that daily"

#

it was such a pain in the ass, that I just spent hours building presets in WLED instead of using normal automations in HA

#

it gets even worse if you use a real controller outside wled to control wled devices

#

anyways, maybe just a timer event entity? That would be a single entity that handles timers. Each new timer would just be an event. Users can use the time provided in the attributes of the entity to key off of

#

event.timers, with new_timer event type, update_timer event type, and attributes that describe the total duration and when it's ending. I.e. duration with timedelta, end with datetime, and source amazon device.

#

That wouldn't be too hard to automate with.

#

and it's in-line with HA's core philosophys

lunar galleon
plucky sentinel
#

Alright, then what? Something's gotta give, either a new platform or follow in line with current platforms, or dynamically created entities.

#

a sensor with attributes wouldn't make it through a PR

lunar galleon
plucky sentinel
#

Will your team members agree with that? I have my doubts.

lunar galleon
#

As in, I still can't guarantee that we want it, but we think it's worth exploring

#

Also because we now have 2 core integrations that both have active developers

plucky sentinel
#

what integrations?

#

(just curious)

lunar galleon
#

Amazon devices and squeezebox

#

There probably are more, but now they both are looking into alarms

#

Squeezebox now has basic support for it this release

#

But it's meh

#

They don't have names

#

So it's literally Alarm (asdakajdjdhsjabsbshsjwsomthing)

#

I still think that that is shitty in a way, but it's something

#

Like, I'd rather explore this solution than have more entities in the future like a time

#

Or a service to modify the schedule

plucky sentinel
#

I mean, what are people looking to get out of alarm?

lunar galleon
#

And I'm sure there are more integrations that can use this. I'm wondering if integrations that provide some sort of timer can also make use of this, like SmartThings

plucky sentinel
#

I'd assume it would be a single entity, alarms. With services to get / set active alarms like todo, calendar, and weather

pallid shale
#

Dont' forget Timers and Reminders, that area particular way of setting a "Alarm"

plucky sentinel
#

well, that's why I was leaning towards time entity because it's supported by the time trigger with offset

#

but I have no idea what this new "trigger system" is going to be

pallid shale
#

for Amazon Devices we can use "Name" (label) if provided by the user or the number under the wood, that won't change

plucky sentinel
#

so, that could solve alot of these weirdness

lunar galleon
#

Well, do we want ephermal entities that create and remove on the fly for timers?

#

Or what do we do with recurring alarms?

pallid shale
#

and we will still need to decide if we report only active objects or all retrieved objects

plucky sentinel
#

typically people are pushed to calendar with reoccuring events

pallid shale
#

for example Alarms in Alexa App are all listed so even if inactive you can enable them with a click

lunar galleon
#

Can they be combined? Or should they be separate? Because they have similarities

plucky sentinel
#

What about calendar? Now that I think about it

#

it's essentially a schedule

#

it has all the abilities we are looking for

lunar galleon
plucky sentinel
#

what do you mean? Calendars are polled and events update on poll

#

they have a start and end time

#

is there no way to update an event?

lunar galleon
#

So far we don't want those mutable as those probably would be too complex and the native app or way of configuring would be way better

lunar galleon
plucky sentinel
#

so if an event is updated in google calendar, it's not updated in HA downstream?

lunar galleon
#

It is

#

But not by HA

#

It's not that HA can move an event for you

plucky sentinel
#

that just seems like we add a new service for calendar to adjust it

#

with via supported features

#

I mean, alarms will likely end up close to calendar in functionality

#

just thinking out loud

lunar galleon
#

Because that's likely complex

#

Because yes, you could use that to configure alarms

#

But what if you want to configure the alarm sound for that event?

#

Volume?

#

Yes, we could support the basics but that would still be useless for a ton of people

#

Check all the services for charging schedule in wallbox and renault

plucky sentinel
#

Didn't think about volume/alerts

pallid shale
#

Maybe that one single entity type with a few features will make it for all ? If this is the idea, I strongly agree

plucky sentinel
#

Yes, that's what the current idea is

#

at least from what I gathered

#

it follows the same principles we have for weather, calendar, todo, etc

#

1 entity with things happening in the background for easy use in automations

lunar galleon
pallid shale
#

I suppose 1 entity type that will be used one for each object, not 1 entity for everything

pallid shale
lunar galleon
#

Same for alarms

pallid shale
#

and reminders, so basically they are very similar eachother ๐Ÿ˜‰

#
@dataclass
class AmazonSchedule:
    """Amazon schedule class."""

    type: str
    status: str
    label: str  # alarmLabel, reminderLabel, timerLabel
    original_date: str
    original_time: str
    recurring_pattern: str
    remaining_time: int
#

with that class you have all you need

lunar galleon
pallid shale
#

for example if type = Timer than you use remaining_time, and not if it's an Alarm. But still...

#

Entity model could be something like:
value = timestamp based on remaining_time for Timer, based on original_date/time for Alarms. Reminders is one of the other 2, need to recheck.
name = label or version (internal number)
persistent = if recurring_pattern not None

lunar galleon
#

But let's discuss this in a broader picture

#

And in a different channel

pallid shale
#

Yup

#

do you open the thread ?

lunar galleon
#

You can, I'm currently in a hardware shop

pallid shale
lunar galleon
#

we can make one in projects

wraith vessel
#

if you send me a link when you open it, I'd be interested as well

pallid shale
lunar galleon
#

nice

pallid shale
#

I need help with the device selector

#

anyone ?

lunar galleon
wraith vessel
lunar galleon
#

I know, hence I am connecting you 2 up so you have another reason to not weed the weeds and to make sure alarms are nicely integrated

wraith vessel
pallid shale
#

Morning, anyone that has an Amazon account from a country that is not Italy, Japan, Uk ?

#

@brave drum for example ๐Ÿ˜‰

brave drum
#

What do you need?

pallid shale
#

UK needs a fix that will be fine for Italy as well

brave drum
#

for PL: openid.assoc_handle=plflex

pallid shale
#

so I would says it's a rule

#

anyone from US that can check ?

brave drum
#

same for DE openid.assoc_handle=deflex

#

US: openid.assoc_handle=usflex

pallid shale
#

Thx

lunar galleon
#

@pallid shale how is debugging going?

#

Do we expect much more of these issues?

#

If so, we should try to debug more in the public so others can also try to figure out what's going on

rich juniper
#

Some users are also reporting issues in the documentation repository, if you need more testers.

lunar galleon
#

Ah I don't have eyes on that

pallid shale
#

@lunar galleon 3 things so far:

  • UK users are unable to authenticate, even if with a small change they are able to login. Under investigation
  • swap from httpx to aiohttp is progressing now; a huge debugging and reverse ingeneering work. WiP
  • documentation: need to add an alert about only supporting MFA via App right now
lunar galleon
#

what small change?

pallid shale
#

but that's a wrong approach

#

IMHO

#

to get an authenticated session teh value needs to be similar to:
DEFAULT_ASSOC_HANDLE = "amzn_dp_project_dee_ios"

#

I thing that "_<country>" needs to be appended only for non English speaking ones. But not sure. Cannot test on my own ๐Ÿ˜ฆ

pallid shale
#

About aiohttp: code is not finally working ๐ŸŽ‰ ๐Ÿš€ explode
It was a huge journey, really hard to go through, but in the end it's there
Really proud of not giving up and made it working

#

So I'll merge and release

lunar galleon
#

I don't have the time to test right now

untold spindle
#

Using pip and the testscript doesn't test those changes, right?

pallid shale
#

yup it will but need a complete syntax

untold spindle
#

I thought it would need a pypi release.

pallid shale
#

pip install "git+https://github.com/chemelli74/aioamazondevices.git@chemelli74-cookies#aioamazondevices==3.0.2"

#

If I didn't type any typos, should work

untold spindle
#

Roger, roger. I'll try it.

#

-# Noob at work.

pallid shale
#

which country are you using for aioamazondevices ?

untold spindle
#

Germany (de)

#

Using the script with the syntax
python library_test.py --country de --email mymail@gmail.com --password abcd12334 --otp_code 123456
seems to login, but there are a few error messages.

#
  File "d:\jorgw\Downloads\HDD\Home Assistant\library_test.py", line 267, in <module>
    asyncio.run(main())
  File "C:\Program Files\Python312\Lib\asyncio\runners.py", line 195, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python312\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python312\Lib\asyncio\base_events.py", line 691, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "d:\jorgw\Downloads\HDD\Home Assistant\library_test.py", line 176, in main
    save_to_file(f"{SAVE_PATH}/output-login-data.json", login_data)
  File "d:\jorgw\Downloads\HDD\Home Assistant\library_test.py", line 93, in save_to_file
    with Path.open(Path(filename), mode="w", encoding="utf-8") as file:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python312\Lib\pathlib.py", line 1013, in open
    return io.open(self, mode, buffering, encoding, errors, newline)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'out\\output-login-data.json'
2025-05-31 20:08:11.288 ERROR (MainThread) [asyncio] Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x00000112EF47F770>
2025-05-31 20:08:11.289 ERROR (MainThread) [asyncio] Unclosed connector
connections: ['deque([(<aiohttp.client_proto.ResponseHandler object at 0x00000112F0AB1FD0>, 27835.234)])', 'deque([(<aiohttp.client_proto.ResponseHandler object at 0x00000112F0CF67B0>, 27836.156)])']
connector: <aiohttp.connector.TCPConnector object at 0x00000112F06C8380>```
pallid shale
#

seems out folder is not created, I use that to same html and investigate what's wrong

#

you can add:

Path(filename).parent.mkdir(parents=True, exist_ok=True)

at line 93 of library_test.py, just before Path.open()

untold spindle
#

I can run it with the options in the json file and the otp parameter

  "country": "DE",
  "email": "mail@gmail.com",
  "password": "abcd1234",
  "single_device_name": "Echo Dot",
  "cluster_device_name": "Everywhere",
  "login_data_file": "out/login_data.json",
  "save_raw_data": "True"
}```
pallid shale
#

Nice !

#

@plucky sentinel what about you ? Can you test, so if we are 3 from 3 different countries I think we can go with it

untold spindle
#

But it still gives errors and doesn't play any sound.

pallid shale
#

Oh, you didn't post anything after the change I suggested

#

please share updated output then

untold spindle
#

The output without your changes?
It does create the login data files now. And it does recognize the Echo Dot.

pallid shale
#

With the suggested change, the folder is created right ?

untold spindle
#

The folder has been created even without those changes. It needed the login_data_file parameter.

pallid shale
#

So when you run the library_test.py script, it doesn't sound.
But the script output where is ?

untold spindle
#

The output is stored in the out directory as expected.

#
Traceback (most recent call last):
  File "d:\jorgw\Projekte\amazon\library_test.py", line 188, in main
    device_cluster = find_device(
                     ^^^^^^^^^^^^
  File "d:\jorgw\Projekte\amazon\library_test.py", line 117, in find_device
    return next(
           ^^^^^
StopIteration

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

Traceback (most recent call last):
  File "d:\jorgw\Projekte\amazon\library_test.py", line 267, in <module>
    asyncio.run(main())
  File "C:\Program Files\Python312\Lib\asyncio\runners.py", line 195, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python312\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python312\Lib\asyncio\base_events.py", line 691, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
RuntimeError: coroutine raised StopIteration
2025-05-31 20:29:46.271 ERROR (MainThread) [asyncio] Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x000001DEF40B0BC0>
2025-05-31 20:29:46.271 ERROR (MainThread) [asyncio] Unclosed connector
connections: ['deque([(<aiohttp.client_proto.ResponseHandler object at 0x000001DEF552E1B0>, 29131.171)])']
connector: <aiohttp.connector.TCPConnector object at 0x000001DEF5505280>```
lunar galleon
#

Do we also need @clear cliff to run it?

pallid shale
#

@untold spindle please share the full output

pallid shale
untold spindle
pallid shale
#

Seems you have only 1 device: Echo Dot and no virtual group

#

is tha tright ?

untold spindle
#

Yes.

pallid shale
#

Can you double check on Alexa app ?

#

Ok the script needs to be updated for such scenario

#

Going to

untold spindle
#

It wouldn't be sufficient to remove the cluster_device_name parameter from the login json?

pallid shale
#
    if args.cluster_device_name:
        device_cluster = find_device(
            devices, args.cluster_device_name, lambda d: len(d.device_cluster_members) > 1
        )
    else:
        device_cluster = device_single
#

should work, not tested

untold spindle
#

Where does this have to be pasted in?

#

Instead of line 188 and 189?

pallid shale
#

instead of the block device_cluster = find_device(...

untold spindle
#

Still throwing an error.

#

I guess, I am doing something wrong.

pallid shale
#

without the log who can say that

untold spindle
#

Ah. User error.

#

Forgot to remove the parameter.

#

Now it is working and it played TTS, TTS with sound and music.

#

And a pasta timer.

pallid shale
#

๐Ÿ”

#

Should be 2 different type of music

untold spindle
#

It is.

pallid shale
#

So everything works fine with aiohttp and DE as country

untold spindle
#

Sorry for the difficulties.

pallid shale
#

BTW, can you double check is aiohttp (it's reported on opening the session and closing the session as well) ?

pallid shale
untold spindle
pallid shale
#

Thx!

#

Hopefully some one else from a differnt country than DE and IT will test and report back

untold spindle
#

I created a library_test.json like this one:

  "country": "DE",
  "email": "name@mail.com",
  "password": "secretpassword",
  "single_device_name": "Name of an Echo device",
  "login_data_file": "out/login_data.json",
  "save_raw_data": "True"
}```
and ran the test script with the parameters:
`python library_test.py --configfile library_test.json --otp_code 123456`
(The OTP code is only needed on the first run).
untold spindle
#

If the aiohttp version is working in your region.

#

So far we only checked DE and IT.

lunar galleon
#

Does @wraith vessel use alexa?

plucky sentinel
plucky sentinel
#

so yes, DL the lib

#

I'll just run it through vscode

#

NOT TODAY THO

#

dinner time ๐Ÿ˜Ž

clear cliff
pallid shale
#

Did you install applying the PR ?

#

Which country ?

clear cliff
#

Just tried pulling the request made to https://www.amazon.co.uk/ap/signin?... when using the browser amazon login flow and the difference it uses for the login flow on the site is assoc_handle=gbflex. Tried hardcoding this on the latest main commit in oauth_params and it appears to get further when running library_test.py. Get a 200 for that initial /ap/signin request, but then get a

2025-06-01 00:03:08.720 WARNING (MainThread) [aioamazondevices] Saving data to out\ap-signin_7.html
2025-06-01 00:03:08.736 DEBUG (MainThread) [aioamazondevices] Cannot find "auth-mfa-otpcode" in html source [https://www.amazon.co.uk/ap/signin/xxx-xxxxxxxx-xxxxxxx]

The HTML page it returns looks like this (under this is my email with a password prompt. I have a special character in my password if that means anything at all

#

UK

#

Or GB country code wise

#

Oh I got my email wrong lol, so if I fix that I get way further using assoc_handle=gbflex

#

Now get an error here:

Traceback (most recent call last):
  File "C:\Users\atims\repos\aioamazondevices\library_test.py", line 280, in <module>
    asyncio.run(main())
    ~~~~~~~~~~~^^^^^^^^
  File "C:\Users\atims\AppData\Roaming\uv\python\cpython-3.13.3-windows-x86_64-none\Lib\asyncio\runners.py", line 195, in run
    return runner.run(main)
           ~~~~~~~~~~^^^^^^
  File "C:\Users\atims\AppData\Roaming\uv\python\cpython-3.13.3-windows-x86_64-none\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "C:\Users\atims\AppData\Roaming\uv\python\cpython-3.13.3-windows-x86_64-none\Lib\asyncio\base_events.py", line 719, in run_until_complete
    return future.result()
           ~~~~~~~~~~~~~^^
  File "C:\Users\atims\repos\aioamazondevices\library_test.py", line 183, in main
    devices = await api.get_devices_data()
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\atims\repos\aioamazondevices\.venv\Lib\site-packages\aioamazondevices\api.py", line 577, in get_devices_data
    do_not_disturb_node = device[NODE_DO_NOT_DISTURB]
                          ~~~~~~^^^^^^^^^^^^^^^^^^^^^
KeyError: 'doNotDisturbDeviceStatusList'
clear cliff
#

Just opened my alexa app and its a mess, so this is probably unrelated. Apparently everything just sticks around even if unavaliable for months

pallid shale
#

The โ€œflexโ€ assoc is used when browsing in all languages but wonโ€™t work for auth session.
You should try using the same as for us

wraith vessel
untold spindle
pallid shale
#

@clear cliff let me know when you are available for digging into it

rotund flax
#

I submitted a pr in your repo for launching skills as well

pallid shale
#

are you sure you opened it on aioamazondevices repo ?

rotund flax
#

I think so

pallid shale
#

So those are correctly shown by the integration as they are supported

rotund flax
#

the sonos speakers don't have BT, only the newer models

pallid shale
#

ic

#

will check if there is a capability to filter binary sensor creation

rotund flax
#

This also applies to the Alexa Companion Windows App:

'4A18BFF7D5939CB4625B0D300B433A9D': AmazonDevice(
  account_name='Florian PC',
  capabilities=['DEEZER', 'TUNE_IN', 'AUDIO_PLAYER', 'APPLE_MUSIC', 'I_HEART_RADIO', 'VOLUME_SETTING', 'CHANGE_NAME', 'REMINDERS', 'TIMERS_ALARMS_NOTIFICATIONS_VOLUME', 'ADAPTIVE_LISTENING', 'FLASH_BRIEFING', 'KINDLE_BOOKS', 'AMAZON_MUSIC', 'DISPLAY_BRIGHTNESS_ADJUST', 'SIRIUSXM', 'MUSIC_SKILL', 'SLEEP', 'DREAM_TRAINING', 'SUPPORTS_CONNECTED_HOME_CLOUD_ONLY', 'TIMERS_AND_ALARMS', 'DEREGISTER_DEVICE', 'EARCONS', 'SET_LOCALE', 'SOUND_SETTINGS', 'PERSISTENT_CONNECTION', 'TIDAL', 'AUDIBLE', 'MICROPHONE'],
  device_family='REAVER',
  device_type='A1RTAM01W29CUP',
  device_owner_customer_id='A2V9S9YNS6348M',
  device_cluster_members=['4A18BFF7D5939CB4625B0D300B433A9D'],
  online=True,
  serial_number='4A18BFF7D5939CB4625B0D300B433A9D',
  software_version='2103540',
  do_not_disturb=False,
  response_style='CONCISE',
  bluetooth_state=False
), 
pallid shale
#

Does it make sense to have it in the integration ? IMHO it would be better to filter it out

lunar galleon
#

But does it work

#

Or does it falsely show capabilities it doesn't have

pallid shale
#

Don't have it installed to confirm

#

This remind me that we should also check for "online=True" before trying to send a message or perform an action

lunar galleon
#

@pallid shale is the list of supported devices just what we have test or all devices that currently are supported?

pallid shale
#

those that are actively reported in the log from the aioamazondevices

lunar galleon
#

because the list in the docs only mention 2

pallid shale
#

can you please review the 2 ready PRs ?

lunar galleon
#

which one

pallid shale
lunar galleon
lunar galleon
#

yes, hence I am asking, what about the rest?

#

Aren't they tested or don't they provide anything

pallid shale
#

mainly not tested; I expect some to provide usefull features some not

lunar galleon
#

can we then expand the list with the information we have now

pallid shale
#

beside the fact that the device is on not in the list, if it has the capabilities then it works

#

it's just not diplayed nicely

lunar galleon
pallid shale
#

Didnโ€™t get your point

lunar galleon
#

well, the docs currently only show 2 device types

#

while I think we support more

#

and there are people who make content consumed by end users

#

and they want correct information

#

so I am looking if we can expand that list

pallid shale
#

Yeah, docs need a bit of love. Will take care of that today

#

I also would like to know if we want to swap to aiohttp now that it works, at least for a couple of people

#

I spoke with Nick about the issues I found while developping and trying to swap out from httpx; he was awesome as always and has already fixed the most important of the two, releasing an rc version of the library.

#

So the question is: do we want to swap to aiohttp even if few people tested the PR in aioamazondevices ?

rotund flax
pallid shale
#

I think we can create a list of well-known skills and the last item of the list would be "Custom".
If you select it then you have a text field that allow you to specify the full skill name

#

So will have the best of both ๐Ÿ˜‰

plucky sentinel
#

I just realized I forgot to check the aiohttp version of this

#

Sorry!

clear cliff
#

Updated to the latest beta and am now able to finish the config flow and my devices show up. Thanks for the fixes ๐Ÿ‘

pallid shale
rotund flax
#

Sounds good, but wouldn't it be better to maintain this within the HA integration?

#

And how do we decide which skills are common and working as well? Because it seems random which skills can be launched and which not

pallid shale
#

I think we should create a list with a boolean property โ€œsupportedโ€

rotund flax
#

Shouldnt be included at all when its not supported, should it?

pallid shale
#

exactly, if we know it's not supported we add it to the list as supported=false so we filter that out from the list and if you use it from custom we can raise a NotSupported error ๐Ÿ˜‰

rotund flax
#

Ahhh gotcha, good idea

pallid shale
#

Found also a few additional sensors to expose:

rigid sphinx
#

someone the other day was talking about a home/away state which i dont think is attached to the device but instead its a alexa skill of some sort. they were complaining that it wasn't exposed with AMP. i told them that new integration is coming but that kind of thing might just not be exposable no idea if you have seen anything related to that?

#

#1376329927120523366 - i was and still am pretty sure that its not device related so probably out of scope. but something to keep an eye out for i guess

pallid shale
#

Ask them if the Alexa App can set this on the device; if so it should be douable by the integration, if it's not in the app but it's a skill or something else then it won't.

pallid shale
#

but before proceeding would be ncie to know how many of those 169 integration users are on b5

lunar galleon
#

why?

pallid shale
#

To know if the main part of them is using aiohttp

#

Which the library version with b5 uses

lunar galleon
#

No way to know that

pallid shale
#

ic, so what you suggest ? Wait or proceed with the cleanup ?

pallid shale
#

First 2 additional sensors from Echos:

sensors=[AmazonDeviceSensor(name='temperature', value=27.0, scale='CELSIUS'), AmazonDeviceSensor(name='illuminance', value=8, scale=None)])}
pallid shale
pallid shale
lunar galleon
#

I think so

lunar galleon
#

Okay, shall we consider renaming to Alexa Device?

pallid shale
#

I donโ€™t think is a good name honestly; if any โ€œAmazon Linked Devicesโ€

lunar galleon
#

Meh, not a big fan of that one as

  1. you need to explain what "linked" means
  2. Kindle also is a device you link to amazon
untold spindle
#

Amazon Alexa Devices?

tall vessel
#

I'm thinking if we should drop โ€žAmazonโ€œ. Yes itโ€™s โ€žAmazon Alexaโ€œ, but โ€žAmazon Alexa Devicesโ€œ could be taken to implicate only Amazon's devices specifically

#

Are supported

#

Which is not true

lunar galleon
#

@pallid shale are we going for a domain change?

#

If so we need a little more work

pallid shale
#

I would say that everything should be aligned as itโ€™s new and we have no constrain to do a clean job

lunar galleon
#

aight

#

are you behind a PC?

pallid shale
#

Yup but only for 15min

lunar galleon
#

ah

#

check

pallid shale
#

Then I have a work call and then I need to move by car

lunar galleon
#

i was wondering if you could open the docs PR

#

but I will take care of that then

pallid shale
#

Sorry a little short on time right now ๐Ÿฅฒ

#

Alexa devices

lunar galleon
#

no problemo

#

I am now mostly happy we didnt merge the other PRs yet

pallid shale
#

Why? It was not more work

lunar galleon
#

well

#

it was to now try to cherry pick the right changes on the beta

#

that would be aweful if we had more PRs like new platforms

pallid shale
#

Ic

untold spindle
#

Has the "custom" notify entity to send commands to Alexa not been included in the integration, yet?

rotund flax
plucky sentinel
#

@pallid shale getting hit with a wave of issues on github

plucky sentinel
#

I'm assuming the custom commands didn't make the release?

#

because many people are asking about it from the docs

pallid shale
#

Yeah not yet merged

#

I have 3 PRs with new staff pending

#

Hopefully they will be merged soon so I can proceed with other thing (too much pending changes are a hell to maintain) and next release will be full feature compared to AMP

plucky sentinel
#

dealing with it in template entities. It really holds back development speed

pallid shale
#

Exactly

junior crag
#

As Nabu Casa support, I want to strongly advocate for a name that reflects what the integration does and doesn't do. We get too many tickets about AMP as it is.

#

Alexa Control? Alexa Speakers? Alexa Notify or Announce? Or is using "Alexa" as a reference too specific?

The majority of tickets are wondering why they don't get TTS functionality with a Nabu Casa sub, yet they also have AMP, and it all requires an elaborate explanation about media_players, tts, local media, custom integrations, etc.

#

anyway, my 2 cents...which are EUR cents because we just got back from Ireland and I didn't spend all my coins!

lunar galleon
pallid shale
#

870 users and just a small bunch of issuesโ€ฆ not bad, really not bad

pallid shale
untold spindle
#

@pallid shale Which of the files besides the api-phoenix.json do you need exactly? There are some containing login data in the out folder.

pallid shale
#

The 2 api-phoenix json

untold spindle
#

The test script just created one phoenix file before failing.

untold spindle
#

It just creates more of those phoenix files, if I run the script multiple times.

#
C:\Program Files\Python312\Lib\site-packages\aioamazondevices\api.py:355: RuntimeWarning: coroutine 'AmazonEchoApi._ignore_ap_sigin_error' was never awaited
  if not self._ignore_ap_sigin_error(resp):
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Traceback (most recent call last):
  File "D:\jorgw\Projekte\amazon\library_test.py", line 280, in <module>
    asyncio.run(main())
  File "C:\Program Files\Python312\Lib\asyncio\runners.py", line 195, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python312\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python312\Lib\asyncio\base_events.py", line 691, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "D:\jorgw\Projekte\amazon\library_test.py", line 183, in main
    devices = await api.get_devices_data()
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python312\Lib\site-packages\aioamazondevices\api.py", line 701, in get_devices_data
    devices_sensors = await self._get_sensors_states(entity_ids_list)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python312\Lib\site-packages\aioamazondevices\api.py", line 562, in _get_sensors_states
    for sensors in json_data["deviceStates"]:
                   ~~~~~~~~~^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable
2025-06-14 12:46:41.072 ERROR (MainThread) [asyncio] Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x0000022D17FEE990>
2025-06-14 12:46:41.073 ERROR (MainThread) [asyncio] Unclosed connector
connections: ['deque([(<aiohttp.client_proto.ResponseHandler object at 0x0000022D18020350>, 6411.984)])']
connector: <aiohttp.connector.TCPConnector object at 0x0000022D16F475C0>
pallid shale
#

Yes indeed but if clean up the folder and then run once the script there will be just 2 of those

untold spindle
#

The screenshot I posted is the state of the script being run once. Just one file.

#

Well, one containing "phoenix".

pallid shale
#

Ok we need to debug this more in depth together

#

Can you fire up the aioamazondevices container in VScode by any chance ?

untold spindle
untold spindle
#

Not sure if I got it fully running.
It stopped with an error in Studio Code.

Installing the current project: aioamazondevices (3.1.2)
An error has occurred: FatalError: git failed. Is it installed, and are you in a Git repository directory?
Check the log at /home/vscode/.cache/pre-commit/pre-commit.log
[33159 ms] postCreateCommand from devcontainer.json failed with exit code 1. Skipping any further user-provided commands.

pallid shale
#

Just did a fresh install and it worked flowlessly

untold spindle
#

Sorry, on my computer I cannot get it running.

pallid shale
#

๐Ÿ˜ฆ

untold spindle
#

It is just throwing lots of errors.

pallid shale
#

Even with other repo ?

untold spindle
#

I only got it (potentially) working by downloading your repo and using that to create a container. It also threw an error, but at least it got me into the container environment.

#

We can try that one. Don't know what exactly you need.

pallid shale
#

Nice

#

I want to save json_data before parsing so that we can see what's missing/different in your scenario

untold spindle
#

I transferred the login data to the container. So if you have some time, we can try it.

pallid shale
#

Hi, sorry was busy during the WE

#

I also noticed that I was so concetrated in making aiohttp work, that I badly managed exceptions

steep grove
pallid shale
#

Hi

pallid shale
#

@steep grove, building v3.1.10, please once ready test and report back

steep grove
#

On HA I'm getting 503 which gives me impression that something is different on HA environment, maybe different headers that gives the error from amazon servers.

pallid shale
steep grove
# pallid shale <https://github.com/home-assistant/core/pull/147055>

I changed the requirements files and did the upgrade inside the container. The correct version was used but something that I did not understand is different and giving 503 response from amazon. I will try to put more debug prints again tomorrow to try to see differences between sent data.

steep grove
#

Found one thing, if I use curl or wget with default user agent to get https://www.amazon.com I got same 503 response and information that came from cloudfare, if I change the user-agent if gives me the 200 response. Apparently something on the request is really making cloudfare/amazon give the 503 response. I will do more tests tomorrow.

pallid shale
#

We fixed the agent in the latest 3.1.10 to be exactly the same as Alexa Mobile App

#

if you get the error only on HA, plaese remove integration config, restart HA and try again after updating manifest.json in order to use 3.1.10

steep grove
pallid shale
#

That doesn't make really sense as the headers and all the stuff of the call are hardcoded by the library, not by HA

#

Only option is you are using a old version of the library inside HA compared to the one used from command line testing

steep grove
# pallid shale Only option is you are using a old version of the library inside HA compared to ...

its the same version. I have run the pip upgrade, checked the code and put prints. added call to request http://www.amazon.com.br failed with 503, changing user-agent to standard chrome that request passed but not the login. I have also checked the aiohttp that is the same version.

pallid shale
#

Can you proxy Alexa app ? We need to check the specific parameters for Brazil

steep grove
#

And also it was giving the 404 before and now only 503.

tall vessel
#

did you see the recent change regarding the cookie_jar in aiohttp

#

maybe they don't like getting other cookies

#

and/or reusing the client and you need to use your own one instead of the shared ClientSession

pallid shale
#

But same library version has the same behavior ๐Ÿ˜‰
And yes I know about the cookie change as I dealed about it with Nick

tall vessel
#

ah then maybe I just misunderstood - just saw "different behaviour in HA and lib" and my mind jumped to the session

steep grove
#

got again some 404 but not continuing and printing () for history on 404

    # Endpoint URI_SIGNIN replies with error 404
    _LOGGER.debug(f"history = {response.history}")
#

as i'm getting same error from command line I understant that there is no shared ClientSession, or aiohttp can share clients between two different process ?

steep grove
#

I'm sure now that I'm getting any kind of web firewall. after more tests I only get 503 again. I will leave it and test again tomorrow. But that response.history behaviour is related to the aiohttp that is not returning the url used every time.

pallid shale
#

IF you think to have found a issue with aiohttp, please open a issue on its repo

steep grove
#

I understand now that the check should try first to use response.url like before and when there is a history also check for the first one as its done now.

#

Apparently amazon sometimes does a single response and sometimes a redirect.

pallid shale
#

signin if working always ridirect

#

if it doesn't is because some parameters are wrong

pallid shale
#

you can verify by inspecting Alexa Mobile App via proxy

rotund flax
pallid shale
#

@rotund flax Will look into the first thing as soon as the pending PRs are merged ๐Ÿ˜‰

#

Donโ€™t want to open thousands of things

#

About the second question, yes once everything else is accepted and merged

pallid shale
#

Evening

#

I added the key I saw, I for sure missed some

#

so if someone can check would be amazing

steep grove
pallid shale
#

you can install 3.1.19, which is part of the beta btw

steep grove
#

I already made some tests with this version, just did not checked this data, I think that email should be redacted also on the json data. Itล› being changed on the place that indicates logging but not inside the json contents .

#

I dont know what is the lifetime of session ids, if they are long maybe more data should be redacted

#

About my problem with 503 I have some progress, I have tested today with this 3.1.19 and I can reproduce consistently, but cant find the exactly root cause.

pallid shale
#

yeah we alrady found a few placed I missed

#

and a couple of fields as well

#

going to wrap up a PR in the afternoon

#

but at least it's a start ๐Ÿ˜‰

steep grove
pallid shale
pallid shale
steep grove
rich juniper
#

I've cleaned up the issues at the documentation issue tracker. To summarize: There are still some issues with Brazil and Chile specific accounts. I've directed them to the core issue tracker so hopefully that moves forward.

#

Overall, people are happy with it becoming part of core, so keep up the great work being done on this. ๐Ÿ™‚

pallid shale
#

Morning everyone, I have stil l4 things in my todo list:

  • fix the retry for 429 like Alexa docs says => PR draft but seems to cause more trouble than what it fix
  • custom action => PR draft, need advice on the right way to go
  • alarm/time/schedules => need to open an architecture discussion for the way to go ?
  • HTTP2 websocket for Media Player management
#

Expecially for nยฐ 2 and nยฐ 3 I need help for taking a decision

lunar galleon
#

2 is that about the list of devices?

#

And for 3 i think we should find a way how we could put alarms and timers into an entity platform in a way together with the other integrations and their abilities

#

As in, that takes effort, but trying to put alarms and timers and whatnot in the current entities sounds very hacky

#

As in, I'm happy to look at quick wins so it at least becomes a bit usable, but I would be opposed to putting the whole functionality in what we have today as that effort would be better put in a solution that could benefit all integrations

pallid shale
#

2 is about selector

#

device or entity id ?

pallid shale
#

Once we have a better solution ,then we can move there

latent anchor
pallid shale
#

seems to block login for some somehow, but cannot figure out why ๐Ÿ˜’

pallid shale
#

This will block all errors from wrong selected country

lunar galleon
pallid shale
#

nope, i was thinking about 3 entities: next alarm, next schedule, next timer

pallid shale
#

Anyone that can help testing PR #335 and #309 please ?

latent anchor
#

I can give it a shot, with a bit of direction on how to apply them

#

I was able to add the integration again now, but still failing, so it looks like I can reproduce the issue. Yesterday, I wasn't even able to activate the integration at all

#

Yeah, I see 429 in the logs.

pallid shale
#

Is for the phoenix endpoint right ?

#

If so fix should be in #338

latent anchor
#

yes, phoenix

#

let me see if I can figure this out - one sec

#

Where can I get the manifest.json?

#

found it

#

ah, I guess the changes are in a library, not the main integration?

latent anchor
#

Oh man, what a headache ๐Ÿ™‚ Is there an easy way to test this without enabled root access to the container? @pallid shale

latent anchor
#

I have a few different docker folders - any idea how to determine which one is active?

#

this is kinda nuts ๐Ÿ˜„

latent anchor
#

might have found a better way to test

#

@pallid shale I think I am testing the branch for the phoenix fix, but it doesn't seem to work. Not sure how I can confirm 100% that I am on the correct branch of the library

latent anchor
#

sent

latent anchor
#

@pallid shale Still having issues, even on 2025.7. Not sure what to do

pallid shale
#

As first thing, updated debug log

latent anchor
#

sent in DM

plucky sentinel
#

Just was able to test the latest release, seems like many of the previous issues are gone, nice job @pallid shale and helpers

pallid shale
#

I'm overwhelmed by requests about timers and alarms

#

95% of people will be able to get rid of AMP if we add those

#

how can we progress on that task ?

plucky sentinel
#

with alarms, you can make timestamp sensors

#

but you won't have snooze, etc

#

nore do they have an alarming state, etc

#

oh yeah, this goes back to the previous discussion

untold spindle
#

Wouldn't a first workaround be the command notify entity, so that they can set, deactivate and snooze the alarms or timers by "voice"?

plucky sentinel
#

Well, IIRC there were discussions about how to handle this in the past

#

the problem is, if we go entity route, there will be an n number of entities with no official clean way of doing things

#

in regards to other entities, we should have something that is similiar to a calendar or forecast that has specific triggers, conditions, and actions

#

At this point, someone basically needs to write up a proposal in arch discussions, then enact the plan

pallid shale
#

@plucky sentinel do you mind helping writing a template for the "last_called" ?

#

Like AMP did

plucky sentinel
#

What do you mean?

#

a template entity to get last_called?

#

something like this?

{% set target = 'speak' %}
{% set last_notify = integration_entities('alexa_devices') | select('match', '^notify') | select('search', target ~ '$') | select('has_value') | expand | sort(attribute='state', reverse=True) | first | default %}
{{ last_notify.name }}
pallid shale
#

Wow interesting, can you check both speak and announce ?

#

Then I think we should add it to docs

plucky sentinel
#

yah

#
{% set last_notify = integration_entities('alexa_devices') | select('match', '^notify') | select('search', '(speak|announce)$') | select('has_value') | expand | sort(attribute='state', reverse=True) | first | default %}
{{ last_notify.name }}
pallid shale
#

The only bad thing is that part of it is localized

#

I need to use (parla|annuncia)$

plucky sentinel
#

son of a bitch

#

oh

#

wait

#

just this

#
{% set last_notify = integration_entities('alexa_devices') | select('match', '^notify') | select('has_value') | expand | sort(attribute='state', reverse=True) | first | default %}
{{ last_notify.name }}
pallid shale
#

Nice, thx

#

Asking user from AMP to tell me if this is enough for replacing the old "last_used" sensor or not

#

I'm not using it and I don't know exactly when it's updated

#

if only from HA or also from voice

plucky sentinel
#

They all want the one that's polled

#

i.e. if a user outside HA says "Alexa, turn on xyz", HA will reflect that

pallid shale
#

I suspected it

#

let's first add HTTP2 websocket then and once we have real time we will see how to add this

brazen salmon
#

one of my main goals is to get all my automations our of Alexa and into home assistant, but I've tried and tried and no matter what I can't tell my echo show to show the front door ring camera on motion or ding. I would also like to send a snapshot on that trigger to certain cell phones, but that's step 2...

untold spindle
#

Not implemented in the current HA version, yet.

brazen salmon
#

yeah

#

the frustrating part is that it's simple af to set up in Alexa, and out of reach of HA

#

do they have to negotiate these things with ring or alexa(amazon), "hey, give us access please, you benefit from giving us this access by broadening your audience/reach"?

brazen salmon
#

yeah

lunar galleon
#

like, if they gave us access to this, they would have lost you

brazen salmon
#

if they don't they will lose more bc that turns people off/sends them elsewhere

lunar galleon
#

so they lose any way

brazen salmon
#

and, they're never getting a paid subscription from me anyway

#

but if they broaden the reach/open up, more people would be like "I can use ring now, they're HA friendly"

lunar galleon
#

but they don't

#

because they are not HA friendly

#

or well, they probably know we exist and they tolerate us

brazen salmon
#

that makes people like us go "once bitten, twice shy" and go elsewhere(ditch ring).
If I knew I was going to get into HA, I would have told my brother "don't go Ring cams, you can't do anything but view it w/o a subscription"

brazen salmon
#

They should make an add-on or integration that rides off the ring integration and can take a snapshot or record like 15-30 seconds of vid

#

@lunar galleon in the dashboard, both in chrome and on my iphone, there is a thing on the bottom right corner of the ring popup that says "download snapshot", too bad there's not a way to automate that, or trigger that automatically given a condition. It's hypertext or something when you open the camera on the dashboard @pallid shale

pallid shale
#

Hi

pallid shale
#

Hi guys

#

Unfortunately I get only the first directive and nothing else

#

Anyone can help checking the code ?