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

Feature Request: Expose "Blocked Services" as an HA service #87

Closed
jeffehobbs opened this issue Nov 10, 2020 · 3 comments
Closed

Feature Request: Expose "Blocked Services" as an HA service #87

jeffehobbs opened this issue Nov 10, 2020 · 3 comments

Comments

@jeffehobbs
Copy link

jeffehobbs commented Nov 10, 2020

Problem/Motivation

AdGuard has proven to be a wonderful home network management tool as I try to keep my child focused on distance learning across devices. At the beginning of the school day, I turn off Discord, YouTube, Instagram and Twitter in order to focus on schoolwork. When homework is done, I will turn the services back on. Works great.

The problem is, this is a highly manual process. I have to go into Home Assistant, into Ad Guard, into Blocked Services, select the services to turn on and off and hit save.

Proposed changes

What would be great is if these blocked services could be exposed in the AdGuard API and subsequently controlled via Home Assistant. Then I could set up automations that would enable and disable services

I did a small amount of research around the AdGuard API and the adguardhome python package but could not confirm or deny how difficult this would be, or what the blockers are. I'd be interested in any data points here or any thoughts in general. Thanks for listening!

@jeffehobbs jeffehobbs changed the title Feature Request: Expose "Blocked Services" as an Feature Request: Expose "Blocked Services" as an HA service Nov 10, 2020
@AlecRust
Copy link
Contributor

I too am after this feature. I have a workaround for you in the meantime though. You can call a service to enable/disable a particular filter:

automation:
  - alias: 'Block social networks in morning'
    trigger:
      platform: time
      at: "08:00"
    action:
      service: adguard.enable_url
      data:
        # This seems to be the filter AdGuard Home uses for "blocked services"
        url: "https://raw.githubusercontent.com/AdguardTeam/FiltersRegistry/master/filters/filter_4_Social/filter.txt"

@jeffehobbs
Copy link
Author

Hey @AlecRust great call. I poked around in the AdGuard Home repo and found where those "Blocked Services" live:

/internal/dnsfilter/blocked_services.go

Next step is to pull some of those services urls out into a filter or set of filters.

Thanks for the link and example code, this is great!

@frenck
Copy link
Member

frenck commented Nov 10, 2020

This repository is not about the Home Assistant integration.

@frenck frenck closed this as completed Nov 10, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jan 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants