amosyuen / ha-tplink-deco

Home Assistant TP-Link Deco Custom Component
MIT License
157 stars 29 forks source link

Add parental controls #189

Open JohannHilbold opened 1 year ago

JohannHilbold commented 1 year ago

Hey guys, I'm wondering if it's possible to add parental control switches. In the Deco app (on Android at least) you can display information and turn on/off internet for some "device groups". Although the information is not very accurate, the toggle internet feature works pretty well.

image

Describe the solution you'd like Ideally, I would like to expose some switches on HA to toggle internet for this or that group.

Describe alternatives you've considered Well I can use the Deco app to turn it off/on, but the idea was to automate it in HA. The HA companion app exposes an "interactive mode" boolean which says when the screen of a mobile/tablet is turned on or off. So when "kid A" has had "interactive mode" for 2 hours that day, it's time to take a break from the internet!

Additional context I'm a developper myself and although I don't know python, the few lines I've read on this repo here don't scare me that much (yet). With a bit of help and some pointers on how this addon works, I wouldnt mind trying to do it myself.

Cheers

amosyuen commented 1 year ago

So this integration connects with the router web admin UI not the mobile app. I don't think I saw parental controls in the router web admin UI. If the router doesn't support it, then you would need to figure out how to reverse engineer the mobile app API and auth.

JohannHilbold commented 1 year ago

This is correct. The web admin UI does not display parental controls. But at the end of the day, when a parent turns off internet for their kid, it must be done at the router level. So all there is no official API for Deco? All this integration does is mimic the admin web UI ? it's a nice feat, but that does seem to limit the possibilities for me

edit: oh wow, I just google tplink deco API and found dozens of forum posts on https://community.tp-link.com/ asking for an API... And no answer

amosyuen commented 1 year ago

Yep, pretty much can only try to reverse engineer their API which is quite time consuming. Usually much harder with mobile.