Pi-Hole (ad blocking DNS server) Controller

Plugins that users have built. NOTE: plugins that were developed for Indigo versions older than 2022.1 will have to be updated to work with Indigo 2022.1 (Python 3 - see this blog post for details). If the plugin listed here is not in the Plugin Store (which will show updated plugins) then you will need to ask on the appropriate thread below if it has been updated and where you get get the update.
Ramias
Posts: 272
Joined: Tue Nov 24, 2015 5:21 pm

Pi-Hole (ad blocking DNS server) Controller

Post by Ramias »

My first released plugin. Pretty basic.

For those using pi-hole.net's local DNS ad blocking server to block ads, this will allow you to turn it on/off/toggle from an Indigo relay switch device. You can then easily publish this with Alexa Hue Bridge or Homekit Bridge to get voice control to enable/disable your ad block (for example, if the online TV shows you are watching fail to play with ad blocking enabled).

http://www.indigodomo.com/pluginstore/203/
Last edited by Ramias on Sat Apr 20, 2019 7:02 pm, edited 1 time in total.
jalves
Posts: 783
Joined: Sun Jun 16, 2013 11:35 am

Re: Pi-Hole (ad blocking DNS server) Controller

Post by jalves »

Thanks for this plugin! Its not anything I had thought about before but now that you've done it I can see how this will be useful!
Running Indigo 2024.2.1 on a 24" iMac M4), OS X 26.0
Jeff
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Pi-Hole (ad blocking DNS server) Controller

Post by jay (support) »

Jay (Indigo Support)
Twitter | Facebook | LinkedIn
User avatar
mundmc
Posts: 1068
Joined: Fri Sep 14, 2012 4:34 pm

Re: Pi-Hole (ad blocking DNS server) Controller

Post by mundmc »

Nice! Just what I needed: my wife occasionally needs to look at Google ad images, and it was a hassle for me to whitelist then blacklist the url. Now she can do it via Alexa via Indigo.
autolog
Posts: 4077
Joined: Tue Sep 10, 2013 3:07 am
Location: West Sussex, UK
Contact:

Re: Pi-Hole (ad blocking DNS server) Controller

Post by autolog »

Fantastic on two counts :
  1. I didn't realise Pi-hole existed and
  2. There's a Plugin to Control it. :D
I have now found a use for a Raspberry pi 3 I had in stock (in truth I had forgotten about it and wasn't using it).

So, I have setup the Raspberry Pi, Installed Pi-hole and installed the Plugin. Just doing intial testing on my MacBook before I switch the router across to use it.

Thanks for the plugin and heads-up on Pi-hole. :D
Ramias
Posts: 272
Joined: Tue Nov 24, 2015 5:21 pm

Re: Pi-Hole (ad blocking DNS server) Controller

Post by Ramias »

I am a big fan of PiHole. I run it as a docker container on my NAS now. It would choke up around 10pm at night for some reason on the Pi. Probably IO issues with the SD card.

Before I wrote the plugin I had a Virtual Device that invoked an ENABLE and a DISABLE action (just a line or two of python code for those actions) but it wouldn't work from Homekit Bridge (but it did with Alexa) so I just hacked together the plugin.
johnfdl
Posts: 177
Joined: Thu May 18, 2017 2:59 pm
Location: Atlanta, GA USA

Re: Pi-Hole (ad blocking DNS server) Controller

Post by johnfdl »

Thanks for this. I use one of my Raspberry PiBeacon's installed with PiHole. I've installed the plug-in, but unsure how I control it I created a device for it with my Pi's IP address and password. So how do I disable the PiHole?
siclark
Posts: 2356
Joined: Tue Jun 13, 2017 5:08 am
Location: UK

Re: Pi-Hole (ad blocking DNS server) Controller

Post by siclark »

Sounds great but I've just wasted 3 hours until 1am trying to install this onto a piBeacon pi. Giving up and going to recreate the SSD tomorrow and try again.
Sometimes you just wish you hadn't started something!!


Sent from my iPhone using Tapatalk
User avatar
mundmc
Posts: 1068
Joined: Fri Sep 14, 2012 4:34 pm

Re: Pi-Hole (ad blocking DNS server) Controller

Post by mundmc »

siclark wrote:Sounds great but I've just wasted 3 hours until 1am trying to install this onto a piBeacon pi. Giving up and going to recreate the SSD tomorrow and try again.
Sometimes you just wish you hadn't started something!!


Sent from my iPhone using Tapatalk
Out of curiosity, where did you hit a road block? I used to use 2 piBeacons, but I never tried to tweak the actual disk image I downloaded.

Curiosity aside, it’s still worth your endeavors. When I’m not home, I VPN in to my network for no other reason than to benefit from pihole’s DNS server.
johnfdl
Posts: 177
Joined: Thu May 18, 2017 2:59 pm
Location: Atlanta, GA USA

Re: Pi-Hole (ad blocking DNS server) Controller

Post by johnfdl »

johnfdl wrote:Thanks for this. I use one of my Raspberry PiBeacon's installed with PiHole. I've installed the plug-in, but unsure how I control it I created a device for it with my Pi's IP address and password. So how do I disable the PiHole?
Duh.....turn device off to disable, turn on to enable.
Ramias
Posts: 272
Joined: Tue Nov 24, 2015 5:21 pm

Re: Pi-Hole (ad blocking DNS server) Controller

Post by Ramias »

johnfdl wrote:
johnfdl wrote:Thanks for this. I use one of my Raspberry PiBeacon's installed with PiHole. I've installed the plug-in, but unsure how I control it I created a device for it with my Pi's IP address and password. So how do I disable the PiHole?
Duh.....turn device off to disable, turn on to enable.
Yep you got it.

The main (and probably only) purpose for this is for voice enablement of Pi Hole via he Alexa or HomeKit plug-ins.

Unless you wanted to schedule enabling or disabling; or always turn in at midnight in case you disabled during the day and forgot to reenable.
siclark
Posts: 2356
Joined: Tue Jun 13, 2017 5:08 am
Location: UK

Re: Pi-Hole (ad blocking DNS server) Controller

Post by siclark »

mundmc wrote:
siclark wrote:Sounds great but I've just wasted 3 hours until 1am trying to install this onto a piBeacon pi. Giving up and going to recreate the SSD tomorrow and try again.
Sometimes you just wish you hadn't started something!!


Sent from my iPhone using Tapatalk
Out of curiosity, where did you hit a road block? I used to use 2 piBeacons, but I never tried to tweak the actual disk image I downloaded.

Curiosity aside, it’s still worth your endeavors. When I’m not home, I VPN in to my network for no other reason than to benefit from pihole’s DNS server.
First pi it had issues with dialog not being installed that caused lots of issues. Eventually got that solved and everything uninstalled so I could reinstall it. That took 2 hours of trial and error.
Then it got half way and I had to manually install the components as the loader failed half way.
Once that done it then fully installed with all the screens appearing. I got to end with the password but got 403 forbidden error loading the admin webpage.

Curiously it installed fully in 5 mins on another pi but that one is more likely to be turned off and unplugged so wanted the original one running it. Might use the other as backup.


Sent from my iPhone using Tapatalk
johnfdl
Posts: 177
Joined: Thu May 18, 2017 2:59 pm
Location: Atlanta, GA USA

Re: Pi-Hole (ad blocking DNS server) Controller

Post by johnfdl »

Ramias wrote:
johnfdl wrote:
johnfdl wrote:Thanks for this. I use one of my Raspberry PiBeacon's installed with PiHole. I've installed the plug-in, but unsure how I control it I created a device for it with my Pi's IP address and password. So how do I disable the PiHole?
Duh.....turn device off to disable, turn on to enable.
Yep you got it.

The main (and probably only) purpose for this is for voice enablement of Pi Hole via he Alexa or HomeKit plug-ins.

Unless you wanted to schedule enabling or disabling; or always turn in at midnight in case you disabled during the day and forgot to reenable.
Yes, it's now voice enabled on Alexa and the family (and I) am happy that they no longer need to ask me to turn it off so they can click on ebates links.
User avatar
Professor Falken
Posts: 304
Joined: Sun Mar 29, 2015 7:07 am

Re: Pi-Hole (ad blocking DNS server) Controller

Post by Professor Falken »

This is great, thanks. I remember reading about Pi-Hole a while back, but then sort-of forgot about it. This new plugin spurred me to get a Pi, install it, then make it controllable from our Indigo dashboard control page, which the rest of the family will appreciate.

Still waiting to see if it breaks anything important. So far I like it, and may find that I VPN back home when out to utilize the filtering.

As you suggested, I also put in a midnight re-enable command in Indigo.

Thanks for writing the plugin.
User avatar
Professor Falken
Posts: 304
Joined: Sun Mar 29, 2015 7:07 am

Re: Pi-Hole (ad blocking DNS server) Controller

Post by Professor Falken »

So I am still playing with this, but in order to keep from too much family conflict, I've pointed the router back to the regular DNS servers for the time being. The Pi-Hole was blocking too much legit traffic , especially links in emails that they want to follow (it's probably blocking them because they're full of tracking cookies, but I'm not sure I can change human behavior nearly as easily as installing network hardware).

What I can't figure out is why it would continue to cause trouble even after I had disabled it using the web console. I assume that just cuts the filters and uses the downstream DNS, which I set to be our exact same previous one. I may try doing a clean install this weekend and see if that helps. It's possible that the micro SD card I used may have been a bit sketchy-- I seem to remember that that one may have given me some trouble in my drone a while a back. Anyway, this is probably a question more for the Pi-Hole forums than here.

But I do have an Indigo issue to ask about. Somewhat anticipating a little bit of growing pains as I searched for some limited "whitelist" items, etc., I put a toggle switch on our main CP dashboard to allow me or my wife to turn it off when it was blocking something that we wanted to see. The action on the CP element (a simple switch tied to the device state) was set to "toggle" the On/Off state of the pi-hole device. When I click the item, it will briefly turn the device off, but it almost immediately toggles right back on. I don't get this behavior when I use the turn-off or turn-on buttons in the device window in Indigo. So I assume it has something to do with the "toggle" command.

I could CP-design around this, I assume, by making separate On and Off buttons on the CP instead of a switch, but that's obviously less elegant. Is there a reason why the toggle command wouldn't work for a device but the On and Off commands would?

Thanks
Post Reply

Return to “User Plugins”