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

Manage screen time requests #33

Open
3 tasks done
manonstreet opened this issue Feb 11, 2024 · 14 comments
Open
3 tasks done

Manage screen time requests #33

manonstreet opened this issue Feb 11, 2024 · 14 comments
Assignees
Labels
enhancement New feature or request upstream

Comments

@manonstreet
Copy link

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

No

Describe the solution you'd like

Provide a means to grant additional screen time for an account. Surface new screen time requests on a per account basis.

Describe alternatives you've considered

N/A

Additional context

I use Microsoft's Family Safety to manage my kids screen time. Although they are on a established schedule, there are many times when additional time is needed. This process involves requesting time on their computers when it runs out, opening the Family Safety iOS app, opening the notification, and selecting how much additional time to grant.

Ideally, the need for the Family Safety iOS app could be eliminated through use of this integration. Signaling a screen time request (event, boolean change, etc.) would allow for creating an actionable notification to grant additional screen time with one click.

@manonstreet
Copy link
Author

I was poking at the base python module code and see it already has the ability to get pending requests, and to approve pending requests (with a variable number of seconds).

Can this integration be extended to:

  1. Check for pending requests in the update interval loop (looks like every minute). As noted this can be exposed via a sensor (such as pending request boolean).
  2. Provide a way to manually trigger an update. This can be helpful when the kiddos run out of time at some critical moment in the game (I need to save! I am a about die!). They will request, and urgently ask for more time. I'd like a way to not have to wait for up to 1 minute before I can process the request.
  3. Provide a way to approve/deny the request. This is probably best done with a service.

Thanks!

@pantherale0
Copy link
Owner

Yes, the code is there. Will enable it as an experimental feature as it's not fully tested yet (especially with new version of family safety).

@manonstreet
Copy link
Author

Hi @pantherale0, curious when you might able able to implement this?

Thanks for your work on this integration, I use it daily!

@pantherale0 pantherale0 self-assigned this Oct 6, 2024
@pantherale0 pantherale0 added enhancement New feature or request upstream labels Oct 6, 2024
pantherale0 added a commit to pantherale0/pyfamilysafety that referenced this issue Oct 6, 2024
pantherale0 added a commit that referenced this issue Nov 9, 2024
add pending_requests as a new sensor (#33)
@pantherale0
Copy link
Owner

This is now available as a preview feature in 2024.12.0b0.

@pantherale0 pantherale0 moved this from In Progress to Testing in HA Family Safety - 2024.12.0 Nov 9, 2024
@pantherale0
Copy link
Owner

pantherale0 commented Nov 9, 2024

Hmmm, need to figure this out further, after some testing, the ID of the request changes every time you send a new http request to the endpoint to get the pending requests

@lordduckstein
Copy link

Hello pantherale0, thank you for your service.

I hope you find out that the "screen time request" works fine.
That is an option that i often use...

Thank You
Lordi

@pantherale0
Copy link
Owner

Hi @lordduckstein

If timed right, the feature does work, but as it's not something I use often it's difficult for me to test. Even screen time management in general is something that I don't really use much anymore.

I will continue to test though, and figure out better ways to manage them.

@and7ey
Copy link

and7ey commented Nov 11, 2024

@pantherale0 many thanks for your work!

Hopefully the functionality you are working on currently will work with the 2nd scenario @manonstreet suggested ("Provide a way to manually trigger an update").

@pantherale0
Copy link
Owner

Currently the 2nd scenario hasn't been included, but I wonder if that could already be done by using the homeassistant.update_entity service?

@and7ey
Copy link

and7ey commented Nov 22, 2024

@pantherale0 could you please clarify how to use it? I have time restriction from 7 am to 11 pm each day (and there is no limitation on the number of hours). sensor.user_available_balance shows 0. Let's say I want to give an additional 30 minutes after 11pm. What should I do?

@pantherale0
Copy link
Owner

@and7ey when the time has expired, a prompt appears on the device to "Ask a parent" for more time via a message (I can't remember the exact wording). This should than appear in Home Assistant as an extended attribute under sensor.user_pending_requests. You need to use the ID from that against the approve_request service call.

@and7ey
Copy link

and7ey commented Nov 24, 2024

a prompt appears on the device to "Ask a parent"

aah, I thought we are talking about scenario to give more time without user request, but re-read what manonstreet meant and understood that his idea is a different.

@pantherale0
Copy link
Owner

aah, I thought we are talking about scenario to give more time without user request, but re-read what manonstreet meant and understood that his idea is a different.

I could potentially expose some service calls for you to do this? In the past though I've allowed 24/7 screen time in the app, but then used a schedule with an automation to toggle the switches to block platforms from within Home Assistant.

Currently I don't actually really use any of this at all.

@and7ey
Copy link

and7ey commented Nov 25, 2024

I could potentially expose some service calls for you to do this

Yes, please. Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request upstream
Projects
Development

No branches or pull requests

4 participants