Best Way to Toggle YouTube Blocking via AdGuard in Home Assistant

I’m trying to create a toggle switch in my Home Assistant dashboard that allows me to enable/disable YouTube blocking through AdGuard Home. However, I’m struggling to find the best method to implement this reliably.

I can block the services in the Adguard settings, but I wanted to create a switch so I can block/unblock them from my dashboard. I was hoping to create a conditional card that would appear on my dashboard if blocked so I know what’s blocking access.

Can anyone advise on the best method, please?

Create a toggle switch in Home Assistant to block/unblock YouTube via AdGuard Home:

  1. Add a Helper Switch (input_boolean.youtube_block).
  2. Use an Automation to toggle AdGuard filtering:

yaml

CopyEdit

alias: Toggle YouTube Block  
trigger:  
  - platform: state  
    entity_id: input_boolean.youtube_block  
action:  
  - service: adguard.filtering.enable  
    condition: "{{ is_state('input_boolean.youtube_block', 'on') }}"  
  - service: adguard.filtering.disable  
    condition: "{{ is_state('input_boolean.youtube_block', 'off') }}"  
  1. Use a Conditional Card to show status.

This works just like **Freecine, making control seamless.

Thank you for the reply.

For some reason, this doesn’t seem to work for me. Switching the block on or off does not seem to affect the switch.