but as of now, i have to manually turn it on and off for my kids. So they cant watch youtube during school hours from 8am to 3pm. they can watch whatever after for 1hour.
is there a way to automate this process? if Adguard cant do it, what can? i know there are free software that can do this but i am hoping HA can
What I know is that, at least, the AdGuard Home integration that Jim mentioned above is unfortunately not what we are looking for.
Reading the documentation of the integration, the enable_url and disable_url (and add_url & remove_url) actions are designed to manipulate filter subscription addresses
… which would be under the DNS blocklists section, if you want to do the same from GUI.
I have made some progresses, though. Let me share the paths I have went through:
In AdGuard Home, there is this place where you can go and block services. Ideally I’m looking for a way to filp the youtube switch here based on automation.
And per the document, one can use /blocked_services/get and /blocked_services/update to update the blocked services. To see yours, try http://x.x.x.x:port/control/blocked_services/get on your AGH ip:port
So far I have managed to grab all the blocked services, and write the info into an attribute of a sensor.
sensors:
- platform: rest
name: "Blocked Services per AdGuard Home"
unique_id: "agh_blocked_services"
authentication: basic
username: !secret user
password: !secret pwd
resource: http://ip:port/control/blocked_services/get
method: GET
headers:
User-Agent: Homeassistant REST
Content-Type: application/json
value_template: '1' # dummy value because we are going to save the list into attribute instead - see next line - but the state of the sensor has to have something.
json_attributes:
- ids
scan_interval: 60
verify_ssl: false
I suppose the gameplan / next steps are to use the attribute data of the sensor above, and add/remove youtube to the data, and update the data back to AdGuard Home, using /blocked_services/update.
So this is where I’m am… I just have not figured out how to proceed with the gameplan above. (Yup I’m coding newbie here.)