PiHole Script

All kinds of 'OS' scripts

Moderator: leecollings

Post Reply
TapNL
Posts: 30
Joined: Monday 24 April 2017 21:52
Target OS: -
Domoticz version:
Contact:

PiHole Script

Post by TapNL »

I created a script to add output of the PiHole api to Domoticz

Link to the script on the wiki: https://www.domoticz.com/wiki/Display_o ... PiHole_api

Link to the website of the PiHole project: https://pi-hole.net
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: PiHole Script

Post by EddyG »

Hi,

Nice interface.
The output is already JSON, so a little more readable solution might be:
INPUT=`curl -s 'http://192.168.2.159/admin/api.php'`
DOMAINSBLOCKED=`echo $INPUT | jq -r '.domains_being_blocked'`
.....

or even better switch to lua.

In the crontab full path should be used, so /home/pi/......
Derik
Posts: 1601
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: PiHole Script

Post by Derik »

mmm
My pihole fucku.. my xu4....
Something with rights...
My hdd is going straid to hell....
ScreenShot040.jpg
ScreenShot040.jpg (71.29 KiB) Viewed 8642 times
from the time i did install pihole....
Now i try to get my space back... :-)

Run pihole on a old rpi... works great
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
jjnj

Re: PiHole Script

Post by jjnj »

Nice script, thanks a lot for sharing!

Verstuurd vanaf mijn LG-H870 met Tapatalk
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: PiHole Script

Post by EdwinK »

Thanks, too bad Pi-Hole was making my system unresponsive. :(
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
qwerk
Posts: 222
Joined: Tuesday 22 July 2014 7:21
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Netherlands
Contact:

Re: PiHole Script

Post by qwerk »

EdKo66 wrote:Thanks, too bad Pi-Hole was making my system unresponsive. :(
pi-hole did the same to my raspberry. where I run domoticz.
I now have a docker version on my synology, that runs great, stable and on low resources.
MsbS
Posts: 35
Joined: Friday 19 May 2017 14:00
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: PiHole Script

Post by MsbS »

I keep PiHole, Domoticz and Squeezebox (Logitech Media Server) on one Pi2 and it works just fine. Though my Domoticz only has a few switches so far.
simonrg
Posts: 329
Joined: Tuesday 16 July 2013 22:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8807
Location: North East England
Contact:

Re: PiHole Script

Post by simonrg »

@TapNL thanks for introducing me to Pi-Hole - really useful tool.

I like to keep things inside Domoticz, so I have created a Lua script instead and used Customer Sensors, so Domoticz will create graphs similar to the Pi-Hole dashboard display.

Lua is quite good for this sort of task as the combination of a json library and tables, means that the real work is done in 4 lines:

Code: Select all

for JsonField,DeviceName in pairs(PiHoleFields) do
    i=i+1
    commandArray[i] = {['UpdateDevice'] = otherdevices_idx[DeviceName] .. "|0|" .. decoded_response[JsonField]}
  end
Needless to say the whole code is a bit longer:

Code: Select all

--~/domoticz/scripts/lua/script_time_pihole.lua
commandArray = {}
-- =============================
-- Query pi-hole and make data available in Domoticz
-- =============================
--Uservariables
PiHoleIP="192.168.89.251" -- ip of your Pi-Hole machine
-- PiHoleFields is a table of the json keys and Domoticz device names, which is used to retrieve the data
-- from the json returned by Pi-Hole and upload it to the named appropriate Domoticz device.
-- Basically in PiHoleFields table - json_field = "Domoticz Device Name"
-- Before installing the script create 7 Domoticz dummy device virtual sensors, all customer sensors, 
-- except ads_percentage_today which is percentage custom sensor.
PiHoleFields={domains_being_blocked="Domains Blocked",dns_queries_today="DNS Queries",ads_blocked_today="Ads Blocked",ads_percentage_today="Ads Percent",unique_domains="Unique Domains",queries_forwarded="Queries Forwarded",queries_cached="Queries Cached"}
-- Set how often the date is checked by:
minutesbetween = 5
time = os.date("*t")
-- Check every hour
--if time.min == ReportMinute then
--if time.hour == ReportHour and time.min == ReportMinute then
if (((time.min)%minutesbetween) == 0) then
  -- Only load libaries now
  io = require('io')
  http = require('socket.http')
  https = require "ssl.https";
  JSON = require('JSON')
  -- Retreive Pi-Hole Information
  PiHoleURL = "http://"..PiHoleIP.."/admin/api.php"
  jresponse, status = http.request(PiHoleURL)
  decoded_response = JSON:decode(jresponse)
  i = 0
  for JsonField,DeviceName in pairs(PiHoleFields) do
    i=i+1
    commandArray[i] = {['UpdateDevice'] = otherdevices_idx[DeviceName] .. "|0|" .. decoded_response[JsonField]}
  end
end
    
--LUA default
return commandArray
And you need to have socket and json libraries installed as described here for a Raspberry Pi - http://www.domoticz.com/wiki/Upload_ene ... et_library and http://dkolf.de/src/dkjson-lua.fsl/home.
Raspberry Pi 2 B - 2A@5V PSU - Raspbian + Domoticz + RFXtrx(89), LightwaveRF House(dimmers, sockets, wireless/mood switches), Owl CM113, 4 LaCross Temp / Humidity Sensors, 4 Siemens PIR, Smappee, Solaredge, ESP8266
TapNL
Posts: 30
Joined: Monday 24 April 2017 21:52
Target OS: -
Domoticz version:
Contact:

Re: PiHole Script

Post by TapNL »

@simonrg: Thx for lua script - also a possibility, not a LUA jedi - not even a bash jedi.
Nice to see, that it is interesting for people.
jjnj

Re: PiHole Script

Post by jjnj »

The script is running, however nothing changes in Domoticz:

Code: Select all

pi@raspberrypi:~ $ sudo bash ~/Scripts/pihole.sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   204    0   204    0     0   5020      0 --:--:-- --:--:-- --:--:--  5100
: invalid number/pihole.sh: line 21: printf: 110311
: invalid number/pihole.sh: line 22: printf: 29201
: invalid number/pihole.sh: line 23: printf: 6832
: invalid number/pihole.sh: line 24: printf: 1563
: invalid number/pihole.sh: line 25: printf: 14593
My script is:

Code: Select all

#!/bin/bash

# Settings
PIHOLE_IP="192.168.178.97"  # PiHole IP
DOMO_IP="192.168.xx.xx"    # Domoticz IP
DOMO_PORT="xx" 	  # Domo port
DOMAINSBLOCKED_IDX='1278'
DNSQUERIESTODAY_IDX='1279'
ADSBLOCKEDTODAY_IDX='1280'
ADSPERCENTTODAY_IDX='1283'
UNIQUEDOMAINS_IDX='1281'
QUERIESFORWARDED_IDX='1282'

# Get data from Pi_Hole API
INPUT=$(curl "http://$PIHOLE_IP/admin/api.php")
DOMAINSBLOCKED=$(echo "$INPUT" | awk -v FS="(:|,)" '{print $2}')
DNSQUERIESTODAY=$(echo "$INPUT" | awk -v FS="(:|,)" '{print $4}')
ADSBLOCKEDTODAY=$(echo "$INPUT" | awk -v FS="(:|,)" '{print $6}')
ADSPERCENTTODAY=$(echo "$INPUT" | awk -v FS="(:|,)" '{print $8}')
UNIQUEDOMAINS=$(echo "$INPUT" | awk -v FS="(:|,)" '{print $10}')
QUERIESFORWARDED=$(echo "$INPUT" | awk -v FS="(:|,)" '{print $12}')

#Make data more readable
DOMAINSBLOCKED=$(printf "%'d" "$DOMAINSBLOCKED")
DNSQUERIESTODAY=$(printf "%'d" "$DNSQUERIESTODAY")
ADSBLOCKEDTODAY=$(printf "%'d" "$ADSBLOCKEDTODAY")
UNIQUEDOMAINS=$(printf "%'d" "$UNIQUEDOMAINS")
QUERIESFORWARDED=$(printf "%'d" "$QUERIESFORWARDED")

# Load data in domoticz
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$DOMAINSBLOCKED_IDX&nvalue=0&svalue=$DOMAINSBLOCKED"
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$DNSQUERIESTODAY_IDX&nvalue=0&svalue=$DNSQUERIESTODAY"
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$ADSBLOCKEDTODAY_IDX&nvalue=0&svalue=$ADSBLOCKEDTODAY"
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$ADSPERCENTTODAY_IDX&nvalue=0&svalue=$ADSPERCENTTODAY"
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$UNIQUEDOMAINS_IDX&nvalue=0&svalue=$UNIQUEDOMAINS"
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$QUERIESFORWARDED_IDX&nvalue=0&svalue=$QUERIESFORWARDED"
This is the output of the pihole api call

Code: Select all

{"domains_being_blocked":110311,"dns_queries_today":29339,"ads_blocked_today":6871,"ads_percentage_today":23.41934,"unique_domains":1564,"queries_forwarded":14673,"queries_cached":7795,"unique_clients":5}
What is going wrong?
Just did an update to the latest pihole version 3.1, maybe that has some effect?
simonrg
Posts: 329
Joined: Tuesday 16 July 2013 22:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8807
Location: North East England
Contact:

Re: PiHole Script

Post by simonrg »

jjnj wrote:What is going wrong?
Just did an update to the latest pihole version 3.1, maybe that has some effect?
Did you find what your problem was?
There appears to be nothing wrong with the script it runs fine on my machine.
However, I would suggest removing the printf statements and changing your Domoticz devices to Custom Sensors, so that Domoticz will do the formatting for you.
So script would be simply:

Code: Select all

#!/bin/bash

# Settings
PIHOLE_IP="192.168.89.251"  # PiHole IP
#DOMO_IP="192.168.xx.xx"    # Domoticz IP
#DOMO_PORT="xx"      # Domo port
DOMAINSBLOCKED_IDX='1278'
DNSQUERIESTODAY_IDX='1279'
ADSBLOCKEDTODAY_IDX='1280'
ADSPERCENTTODAY_IDX='1283'
UNIQUEDOMAINS_IDX='1281'
QUERIESFORWARDED_IDX='1282'

# Get data from Pi_Hole API
INPUT=$(curl "http://$PIHOLE_IP/admin/api.php")
INPUT='{"domains_being_blocked":110311,"dns_queries_today":29339,"ads_blocked_today":6871,"ads_percentage_today":23.41934,"unique_domains":1564,"queries_forwarded":14673,"queries_cached":7795,"unique_clients":5}'
DOMAINSBLOCKED=$(echo "$INPUT" | awk -v FS="(:|,)" '{print $2}')
DNSQUERIESTODAY=$(echo "$INPUT" | awk -v FS="(:|,)" '{print $4}')
ADSBLOCKEDTODAY=$(echo "$INPUT" | awk -v FS="(:|,)" '{print $6}')
ADSPERCENTTODAY=$(echo "$INPUT" | awk -v FS="(:|,)" '{print $8}')
UNIQUEDOMAINS=$(echo "$INPUT" | awk -v FS="(:|,)" '{print $10}')
QUERIESFORWARDED=$(echo "$INPUT" | awk -v FS="(:|,)" '{print $12}')

#Make data more readable
DOMAINSBLOCKED=$(printf "%'d" "$DOMAINSBLOCKED")
DNSQUERIESTODAY=$(printf "%'d" "$DNSQUERIESTODAY")
ADSBLOCKEDTODAY=$(printf "%'d" "$ADSBLOCKEDTODAY")
UNIQUEDOMAINS=$(printf "%'d" "$UNIQUEDOMAINS")
QUERIESFORWARDED=$(printf "%'d" "$QUERIESFORWARDED")

# Load data in domoticz
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$DOMAINSBLOCKED_IDX&nvalue=0&svalue=$DOMAINSBLOCKED"
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$DNSQUERIESTODAY_IDX&nvalue=0&svalue=$DNSQUERIESTODAY"
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$ADSBLOCKEDTODAY_IDX&nvalue=0&svalue=$ADSBLOCKEDTODAY"
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$ADSPERCENTTODAY_IDX&nvalue=0&svalue=$ADSPERCENTTODAY"
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$UNIQUEDOMAINS_IDX&nvalue=0&svalue=$UNIQUEDOMAINS"
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$QUERIESFORWARDED_IDX&nvalue=0&svalue=$QUERIESFORWARDED"

Raspberry Pi 2 B - 2A@5V PSU - Raspbian + Domoticz + RFXtrx(89), LightwaveRF House(dimmers, sockets, wireless/mood switches), Owl CM113, 4 LaCross Temp / Humidity Sensors, 4 Siemens PIR, Smappee, Solaredge, ESP8266
jjnj

Re: PiHole Script

Post by jjnj »

simonrg wrote:
jjnj wrote:What is going wrong?
Just did an update to the latest pihole version 3.1, maybe that has some effect?
Did you find what your problem was?
There appears to be nothing wrong with the script it runs fine on my machine.
However, I would suggest removing the printf statements and changing your Domoticz devices to Custom Sensors, so that Domoticz will do the formatting for you.
So script would be simply:

Code: Select all

#!/bin/bash

# Settings
PIHOLE_IP="192.168.89.251"  # PiHole IP
#DOMO_IP="192.168.xx.xx"    # Domoticz IP
#DOMO_PORT="xx"      # Domo port
DOMAINSBLOCKED_IDX='1278'
DNSQUERIESTODAY_IDX='1279'
ADSBLOCKEDTODAY_IDX='1280'
ADSPERCENTTODAY_IDX='1283'
UNIQUEDOMAINS_IDX='1281'
QUERIESFORWARDED_IDX='1282'

# Get data from Pi_Hole API
INPUT=$(curl "http://$PIHOLE_IP/admin/api.php")
INPUT='{"domains_being_blocked":110311,"dns_queries_today":29339,"ads_blocked_today":6871,"ads_percentage_today":23.41934,"unique_domains":1564,"queries_forwarded":14673,"queries_cached":7795,"unique_clients":5}'
DOMAINSBLOCKED=$(echo "$INPUT" | awk -v FS="(:|,)" '{print $2}')
DNSQUERIESTODAY=$(echo "$INPUT" | awk -v FS="(:|,)" '{print $4}')
ADSBLOCKEDTODAY=$(echo "$INPUT" | awk -v FS="(:|,)" '{print $6}')
ADSPERCENTTODAY=$(echo "$INPUT" | awk -v FS="(:|,)" '{print $8}')
UNIQUEDOMAINS=$(echo "$INPUT" | awk -v FS="(:|,)" '{print $10}')
QUERIESFORWARDED=$(echo "$INPUT" | awk -v FS="(:|,)" '{print $12}')

#Make data more readable
DOMAINSBLOCKED=$(printf "%'d" "$DOMAINSBLOCKED")
DNSQUERIESTODAY=$(printf "%'d" "$DNSQUERIESTODAY")
ADSBLOCKEDTODAY=$(printf "%'d" "$ADSBLOCKEDTODAY")
UNIQUEDOMAINS=$(printf "%'d" "$UNIQUEDOMAINS")
QUERIESFORWARDED=$(printf "%'d" "$QUERIESFORWARDED")

# Load data in domoticz
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$DOMAINSBLOCKED_IDX&nvalue=0&svalue=$DOMAINSBLOCKED"
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$DNSQUERIESTODAY_IDX&nvalue=0&svalue=$DNSQUERIESTODAY"
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$ADSBLOCKEDTODAY_IDX&nvalue=0&svalue=$ADSBLOCKEDTODAY"
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$ADSPERCENTTODAY_IDX&nvalue=0&svalue=$ADSPERCENTTODAY"
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$UNIQUEDOMAINS_IDX&nvalue=0&svalue=$UNIQUEDOMAINS"
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$QUERIESFORWARDED_IDX&nvalue=0&svalue=$QUERIESFORWARDED"

Thanks, i will try when back home

Verstuurd vanaf mijn LG-H870 met Tapatalk
jjnj

Re: PiHole Script

Post by jjnj »

Sorry for the late reply, the updated script worked for me!
Chris12
Posts: 238
Joined: Tuesday 18 August 2020 8:41
Target OS: NAS (Synology & others)
Domoticz version: 2021.1
Location: NL
Contact:

Re: PiHole Script

Post by Chris12 »

I updated the script so it works with the latest Pi-Hole version (incl API Token), I thaught maybe somebody else needs it.
Below the script with some example data (fake API token).

I added the script into my synology, so it can run every 5min.

Code: Select all

#!/bin/bash

# Settings
PIHOLE_IP="192.168.1.xx"  # PiHole IP
DOMO_IP="192.168.1.xx"    # Domoticz IP
DOMO_PORT="80xx"          # Domo port
API_TOKEN="e0922ed316ff63fa00304e6aa8547d43e2d1ff55ab7a07caa2662f34b6222f0e"  # PiHole API Token, found here: pihole->settings->API->show token
DOMAINSBLOCKED_IDX='1444'
DNSQUERIESTODAY_IDX='1445'
ADSBLOCKEDTODAY_IDX='1446'
ADSPERCENTTODAY_IDX='1447'
UNIQUEDOMAINS_IDX='1449'
QUERIESFORWARDED_IDX='1450'
QUERIESCACHED_IDX='1451'
CLIENTSEVERSEEN_IDX='1452'
UNIQUECLIENTS_IDX='1453'

# Get data from Pi_Hole API
INPUT=$(curl "http://$PIHOLE_IP/admin/api.php?summaryRaw&auth=$API_TOKEN")
domains_being_blocked=$(echo "$INPUT" | awk -v FS="(:|,)" '{print $2}')
dns_queries_today=$(echo "$INPUT" | awk -v FS="(:|,)" '{print $4}')
ads_blocked_today=$(echo "$INPUT" | awk -v FS="(:|,)" '{print $6}')
ads_percentage_today=$(echo "$INPUT" | awk -v FS="(:|,)" '{print $8}')
unique_domains=$(echo "$INPUT" | awk -v FS="(:|,)" '{print $10}')
queries_forwarded=$(echo "$INPUT" | awk -v FS="(:|,)" '{print $12}')
queries_cached=$(echo "$INPUT" | awk -v FS="(:|,)" '{print $14}')
clients_ever_seen=$(echo "$INPUT" | awk -v FS="(:|,)" '{print $16}')
unique_clients=$(echo "$INPUT" | awk -v FS="(:|,)" '{print $18}')
dns_queries_all_types=$(echo "$INPUT" | awk -v FS="(:|,)" '{print $20}')


#Make data more readable
domains_being_blocked=$(printf "%'d" "$domains_being_blocked")
dns_queries_today=$(printf "%'d" "$dns_queries_today")
ads_blocked_today=$(printf "%'d" "$ads_blocked_today")
ads_percentage_today$(printf "%'d" "$ads_percentage_today")
unique_domains=$(printf "%'d" "$unique_domains")
queries_forwarded=$(printf "%'d" "$queries_forwarded")
queries_cached=$(printf "%'d" "$queries_cached")
clients_ever_seen=$(printf "%'d" "$clients_ever_seen")
unique_clients=$(printf "%'d" "$unique_clients")
dns_queries_all_types=$(printf "%'d" "$dns_queries_all_types")


# Load data in domoticz
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$DOMAINSBLOCKED_IDX&nvalue=0&svalue=$domains_being_blocked"
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$DNSQUERIESTODAY_IDX&nvalue=0&svalue=$dns_queries_today"
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$ADSBLOCKEDTODAY_IDX&nvalue=0&svalue=$ads_blocked_today"
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$ADSPERCENTTODAY_IDX&nvalue=0&svalue=$ads_percentage_today"
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$UNIQUEDOMAINS_IDX&nvalue=0&svalue=$unique_domains"
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$QUERIESFORWARDED_IDX&nvalue=0&svalue=$queries_forwarded"
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$QUERIESCACHED_IDX&nvalue=0&svalue=$queries_cached"
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$CLIENTSEVERSEEN_IDX&nvalue=0&svalue=$clients_ever_seen"
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$UNIQUECLIENTS_IDX&nvalue=0&svalue=$unique_clients"
Domoticz beta | Dashticz beta | Synology DS415+ | Wall tablet Teclast 11.6inch (Android) | TADO v3 controlled heating
User avatar
sincze
Posts: 1300
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: PiHole Script

Post by sincze »

Tnx Chris, just noticed your post on the Pi-Hole plugin not working anymore.
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
Chris12
Posts: 238
Joined: Tuesday 18 August 2020 8:41
Target OS: NAS (Synology & others)
Domoticz version: 2021.1
Location: NL
Contact:

Re: PiHole Script

Post by Chris12 »

sincze wrote: Wednesday 27 September 2023 19:39 Tnx Chris, just noticed your post on the Pi-Hole plugin not working anymore.
Yeah, I let it wait for a while hoping some-one would fix it, not sure bc it's been a while. Then I found this post, and worked on that to get it working!
Domoticz beta | Dashticz beta | Synology DS415+ | Wall tablet Teclast 11.6inch (Android) | TADO v3 controlled heating
User avatar
sincze
Posts: 1300
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: PiHole Script

Post by sincze »

Need to check but it could be this Plugin faces the same issues I experienced before with a different version of Domoticz with the onConnect issue as the URL used is the same as you are using..
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
tarmacalastair
Posts: 95
Joined: Wednesday 30 October 2019 14:11
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Great Britain
Contact:

Re: PiHole Script

Post by tarmacalastair »

Thanks for this.

The wiki is still dated 2017 with the old script. Chris12's script above works nicely, thanks.

I thought I would log in and change it but my forum login doesn't work for the wiki and I can't see anywhere to create a new user.

Anyone know what to do?
Running Domoticz and Dashticz beta on Raspberry Pi OS 32 bit - has anyone had success with 64 bit?

Desktop access from Ubuntu Linux
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests