Simple on/off controller for Pi-hole and some stats.
what is Pi hole in this context? Not an ad blocker.
hm - you use this in your smarthome scheme?
To avoid the WAF yes. Some results in google for instance (the advertisements) do not work with pihole active so sometimes you need to disable things from the couch
or when the house detect wife and kids at home, turn on pihole. Turn off pihole when you’re alone at home for all your adult viewing pleasure LOL…
Thank you for this! Blocks a few services the wife uses, but it’s a pain to make her go through the web interface to disable for a minute. Now she can just ask Assistant to do it for her
This is fantastic. Thanks.
Hi there! Also a newbie. I’ve been wanting to do something like this for a very long time, and now that I have a SmartThings hub, I’m excited to do it!
However, using your code, I’m getting the debug error saying that the IP address is missing in preferences, but I replaced deviceIP with the IP address of my Pi.Hole, as well as the API key.
However, reading through the code, I feel like that’s not what is supposed to be done. Where are you supposed to enter your info?
Thank you for this! Works fantastic.
How’d you get it to work? I don’t see where to specify the API key or IP address…
Once you install the device handler you have to create a device in the ide using the DH. Once you have that you go into the smartthings app and find the device you just made and go into the gear
So, I installed the device handler (that’s the script, right?) and then created the device in the IDE and told it that the “Type” was Pi.Hole.
in the SmartThings app with the halo/single circle, I see a device Named Pi.Hole, and it was on by default, however me toggling it doesn’t appear to be doing anything, and if I disable it via the webUI, it doesn’t display as “Off”.
Edit: Nevermind, I forgot to modify the device settings.
Thank you very much!!! Now to make it automatically turn back on after so long. Any idea how to do that?
Turn ON switch after it's been turned off for x minutes?
Where do I get my api key from? Assuming when I get home I can maybe get it from the Web interface
When you go into the dashboard on the pihole you can get it.
Thanks @CopyCat73, this is awesome. I reversed the Enable/Disable in you script and renamed it “Shut Your Pi-hole”. Now when I turn it on it disables Pi-hole and I set a timer to turn it off after a set time. Definitely WAF, I have it working with a button. Maybe I’ll set it up with Alexa and say “Alexa, Shut Your Pi-hole”
Edit: I now have it setup so when we say “Alexa, shut your Pi Hole”, Pi-Hole is disabled for 1/2 hour.