Run a action when a url is opened

So i have new idea for automation
So i have pi hole set up to block ads but it also see which url is opened on a specific ip address.
I was wondering if there is some way so that i can set up an automation to say turn on the lights when i open google.com on my browser. This is just a vague example but is there a way to achieve it