I want to add my vote here as well. Having kids today with their own PC, android phone and iPad tablet and needing to enter each app for limiting screen time is frustrating. Especially when you know this is something that is perfect for managing in home assistant.
I have exactly same needs, find a way to get a combinate daily use time for Android + PC + Nintendo Switch, then ideally turn them all off when the daily limit fixed is reached…
the 3 system offer both functionnalities (time log + time limit) but is their way to get theese data from API? is it possible to lock thru API?
here is the deal…
Still nothing I guess?
Well. It should now be possible for someone to develop it since there’s a webpage for this sort of thing now.
https://familylink.google.com/
It shouldn’t be rocket science to open the developer tab and see the calls to the api.
How would you get around session cookies timing out etc? As an example, if you do inspect when hitting “Lock device” on familylink.google.com, it uses the function timeLimitOverrides on https://kidsmanagement-pa.clients6.google.com/kidsmanagement/v1/people/214154125125125/timeLimitOverrides:batchCreate?%24httpHeaders=Content-…
With a bunch of headers. The query can be replicated but after a while it fails.
I started to take a look at family link (having done switch parental controls + MSFT family safety). And this was where I got to, requests to the API are successful but the cookie will timeout, and so far I’m not sure how to refresh that cookie yet.
I might see if I can take some inspiration from badnest (https://community.home-assistant.io/t/i-made-a-crappy-nest-thermostat-integration-that-will-work-as-a-stopgap-until-alternatives-come-out)
Brought this back just to say I’m playing with making an Android virtual machine in VirtualBox, which I put Family Link and Tasker on along with some of the Autotools. I figure to use a webhook to let HA trigger a Tasker task to lock or unlock kid’s phone, and make webhooks to let Tasker report Family Link status back to Home Assistant.
I figure that approach might come in handy for other things that lack HA integrations but which do have Android apps.
I also wish this would be available in HA as a plugin…
Wondering if there Isn’t any easier way through the APIs?
I’ve tried the APIs, unfortunately they are all gson (GitHub - google/gson: A Java serialization/deserialization library to convert Java Objects into JSON and back) based APIs and without extremely heavy reverse engineering, there is just no way to get the data currently. I also tried to reverse engineer the mobile app, but that took me to a dead end because the app seems to proxy the requests via a different package (probably Google Services Framework), maybe the iOS app will be different, but I don’t have an Apple device to test with.
Added my 2c. I really need this feature. We have controls for every other platform parental controls. Not family link though.
Is there a way to add Amazon Parent’s Dashboard into HA? I haven’t been able to find that. Though, I would prefer Google Family Link.
I use Google Family Link for my kids too.
After reading some network calls in my browser’s dev console, I could script some data harvesting in python, along with the auth cookie. It could then be quite easy to have it in HA.
The major issue is dealing with the auth cookie from Family Link’s webpage you’ll need to refresh…
[
['Google Chrome', '4 min.'],
['WhatsApp Messenger', '1 min.'],
['Pokémon TCG Pocket', '1 min.'],
['Snapchat', '0 min.'],
['Weather', '0 min.'],
['Google', '0 min.'],
['Discord - Talk, Play, Hang Out', '0 min.'],
['Google Calendar', '0 min.'],
['Google Messages', '0 min.']
]
This was the hurdle I came up against, and eventually gave up… I couldn’t figure out how to ensure the cookie was valid and also implement something that would refresh in the background without needing a prompt for auth.
I need this too please.
It would help so much to be able integrate with HA for customisation
Thx
Hi @5AMsan
Could you share details of the API calls you could detect to the APIs ?
I made some tests but was not able to detect this calls.
Thanks
Here you are, reply here if you need more details, maybe I’ll be able to help some more.
That’s indeed the missing point. Using a trusted browser can help but for how long ? At some point Google will ask for auth and we won’t be able to automate this part IMHO
Is there a way to find out how long the auth lasts? For me I’d gladly accept some kinda manual reauth weekly if it means I don’t have to open the Family Link app every day.
I’m wondering if it’s worth looking at how badnest handles this for inspiration because that uses cookie auth for Google logins