Pi-Hole (ad blocking DNS server) Controller

Posted on
Sat Apr 20, 2019 2:22 pm
Ramias offline
Posts: 136
Joined: Nov 24, 2015

Pi-Hole (ad blocking DNS server) Controller

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.

Posted on
Sat Apr 20, 2019 3:20 pm
jalves offline
Posts: 521
Joined: Jun 16, 2013

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

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 7.3.1 on a 27" iMac (mid-2017), 40G memory, 1T Fusion Drive, OS X 10.14.4
Jeff

Posted on
Sat Apr 20, 2019 4:45 pm
jay (support) offline
Site Admin
User avatar
Posts: 15462
Joined: Mar 19, 2008
Location: Austin, Texas

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


Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sun Apr 21, 2019 6:34 am
mundmc offline
User avatar
Posts: 479
Joined: Sep 14, 2012

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

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.

Posted on
Sun Apr 21, 2019 11:43 am
autolog offline
Posts: 2775
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT+1]

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

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

Posted on
Sun Apr 21, 2019 1:57 pm
Ramias offline
Posts: 136
Joined: Nov 24, 2015

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

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.

Posted on
Sun Apr 21, 2019 5:44 pm
johnfdl offline
Posts: 132
Joined: May 18, 2017
Location: Atlanta, GA USA

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

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?

Posted on
Sun Apr 21, 2019 6:00 pm
siclark offline
Posts: 885
Joined: Jun 13, 2017
Location: UK

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

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

Posted on
Sun Apr 21, 2019 6:40 pm
mundmc offline
User avatar
Posts: 479
Joined: Sep 14, 2012

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

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.

Posted on
Sun Apr 21, 2019 6:47 pm
johnfdl offline
Posts: 132
Joined: May 18, 2017
Location: Atlanta, GA USA

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

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.

Posted on
Sun Apr 21, 2019 8:53 pm
Ramias offline
Posts: 136
Joined: Nov 24, 2015

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

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.

Posted on
Mon Apr 22, 2019 12:37 am
siclark offline
Posts: 885
Joined: Jun 13, 2017
Location: UK

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

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

Posted on
Mon Apr 22, 2019 5:42 am
johnfdl offline
Posts: 132
Joined: May 18, 2017
Location: Atlanta, GA USA

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

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.

Posted on
Thu Apr 25, 2019 7:29 am
Professor Falken offline
User avatar
Posts: 283
Joined: Mar 29, 2015

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

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.

Posted on
Sat Apr 27, 2019 6:16 am
Professor Falken offline
User avatar
Posts: 283
Joined: Mar 29, 2015

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

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

Who is online

Users browsing this forum: No registered users and 1 guest