Giter Site home page Giter Site logo

Comments (9)

wawoodwa avatar wawoodwa commented on May 28, 2024 2

Ok, so I wrote some code for Pi-hole to be able to control groups via the API. I am going to submit a PR for it to see if they would add it in the next rev. I guess now I need to look at this code and see if I can add in a switch for it to be controlled via the plug-in.

from homebridge-pihole.

arendruni avatar arendruni commented on May 28, 2024

Hi @jacklawry!

This could be a real extension of this plugin functionality which is now limited to only disable/enable the entire Pi-hole.
I tried to look which requests the admin page makes when disabling a list and I couldn’t find a hint on where to add timer as a param in the request, though there should be an internal timeout inside the plugin to handle this.

I don’t have so much time to go any further in this feature now so if you want to try and integrate it, PR are always welcome!

from homebridge-pihole.

wawoodwa avatar wawoodwa commented on May 28, 2024

I am looking for the same thing! I manage mine based on groups that are enabled or disabled. I currently do it via a crontab. However, in looking at the code, the api.php and api_FTL.php doesn't appear to expose the more functional parts of the Pi-hole. Those files, if you wish to look at them, are in /var/www/html/admin. There is an api_db.php there, but it isn't included in the api.php, so you have to call it specifically to access any of its features.

But in looking in /var/www/html/admin/scripts/pi-hole/php/groups.php, it isn't a simple edit_group call. It requires all of the information on it (id, name, description, and enabled). It also requires a login token, unless $api is set.

I am going to look at it some more.

from homebridge-pihole.

jacklawry avatar jacklawry commented on May 28, 2024

At the moment I am able to control all the blocks I need (mainly YouTube) via ssh rules that I can enable and disable via some saved logic in the Shortcuts app on my phone but this would be loads better if it can be done.

from homebridge-pihole.

wawoodwa avatar wawoodwa commented on May 28, 2024

I think I am still going to look at this. I did submit the API change to Pi-hole FTL. Will see if it gets incorporated. In the mean time I will work on a fork of this to see if I can extend it based on the assumption they will accept it.

from homebridge-pihole.

wawoodwa avatar wawoodwa commented on May 28, 2024

@arendruni I am thinking of extending your plug-in to include multiple switches to control groups. I will fork it and see what I can come up with.

from homebridge-pihole.

arendruni avatar arendruni commented on May 28, 2024

Do you already know what needs to be changed to add this new feature?

from homebridge-pihole.

wawoodwa avatar wawoodwa commented on May 28, 2024

I have an idea, but nothing in stone. I am thinking that the plugin becomes a platform plugin, instead of multiple accessories that have to be independently configured. The main accessory can be turned on or off (enable / disable) and then other accessories representing groups that can be independently controlled.

from homebridge-pihole.

wawoodwa avatar wawoodwa commented on May 28, 2024

Ok, quick update. Pi-hole revved and didn't include my code. They forgot to review it before the update. I reached out to them and they apologized. However, they believe they are very close to 6.0, which has the functionality we need to make this concept work.

So, going to put this on the back burner momentarily until they get 6.0 out.

from homebridge-pihole.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.