Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to use Amazon Freetime to pause devices #349

Closed
boojew opened this issue Sep 8, 2019 · 7 comments
Closed

Add the ability to use Amazon Freetime to pause devices #349

boojew opened this issue Sep 8, 2019 · 7 comments
Labels
enhancement New feature or request help wanted Extra attention is needed no-issue-activity question Further information is requested

Comments

@boojew
Copy link

boojew commented Sep 8, 2019

Is your feature request related to a problem? Please describe.
One of the cool features in the Amazon ecosystem is to use Amazon Freetime to pause devices on-demand for a fixed period of time.

Describe the solution you'd like
I would love to see a boolean switch added to HomeAssistant that would allow me to set freetime on/off for a device.

Describe alternatives you've considered
I currently do this by blocking the device at the firewall level, but that breaks the device entirely. Freetime allows it to continue to function for services like announcements and dropin

Additional context
Add any other context or screenshots about the feature request here.

@alandtse alandtse added enhancement New feature or request question Further information is requested labels Sep 8, 2019
@alandtse
Copy link
Owner

alandtse commented Sep 8, 2019

We can look into it. Features have been backlogged as we try to work through the login issues. One thing that would be helpful is if someone could figure out the API call to the Alexa website. That will be the first step.

@alandtse alandtse added the help wanted Extra attention is needed label Sep 8, 2019
@alandtse
Copy link
Owner

alandtse commented Sep 9, 2019

Specifically, I'd need someone to capture the API traffic to enable or disable on a device. You can probably use Chrome with the webapp. I just don't happen to have FreeTime on my devices.

@airdrummingfool
Copy link

I have been looking for a way to "mute" Alexa devices (so they stop listening) via the API, and this seems like a good workaround for the lack of Mute API.

I was able to grab some requests from the API using Chrome. Note that I've removed my device type, device ID, and device serial number.

Here's the API command to disable FreeTime:

Request URL: https://alexa.amazon.com/api/unassign-device-from-child/DEVICE_SERIAL_NUMBER/DEVICE_TYPE
Request Method: POST
Host: alexa.amazon.com
Origin: https://alexa.amazon.com
Pragma: no-cache
Referer: https://alexa.amazon.com/spa/index.html
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
X-Requested-With: XMLHttpRequest

Body: {deviceType: "DEVICE_TYPE", deviceSerialNumber: "DEVICE_SERIAL_NUMBER"}

Here's my guess at the API-ish call that actually enables a call. Note that the childDirectedId field is formatted like this (partially obscured): amzn1.account.ABCDEFG1H2IJK3ABC7ABCD436ABC

Request URL: https://parents.amazon.com/ajax/enable-device-services
Request Method: POST
Host: parents.amazon.com
Origin: https://parents.amazon.com
Pragma: no-cache
Referer: https://parents.amazon.com/deviceOobeSuccess?deviceId=DEVICE_ID&deviceTypeId=DEVICE_TYPE_ID&experience=BYOD&childDirectedId=CHILD_DIRECTED_ID
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
X-Requested-With: XMLHttpRequest

Body: {"deviceId":"DEVICE_ID","deviceTypeId":"DEVICE_TYPE_ID","childDirectedId":"CHILD_DIRECTED_ID","deviceServices":["ELF","COMMS","ThirdPartyMusic","FirstPartyMusic"]}

@airdrummingfool
Copy link

Actually, FreeTime doesn't seem to be the great workaround for muting a device that I hoped it would.

Unfortunately when I disable the device using FreeTime, Alexa still responds with "Sorry, I can't play right now" when I say the wake word and then a command - so she's still listening.

@alandtse
Copy link
Owner

Thanks @airdrummingfool. Do you see any other API call that is grabbing the child id list? I'm assuming this won't work unless you identify the kids that need to be blocked.

@github-actions
Copy link

Stale issue message

@eddedre
Copy link

eddedre commented Dec 29, 2023

I’m actually looking for the functionality to be able to pause/resume freetime on my kids Alexa. I would be willing to capture any data needed to get the feature reopened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed no-issue-activity question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants