Hi,
Yesterday I installed Pi-hole (pi-hole.net) on my raspberry pi. This software is to block advertisements and it's working great!
When I enter the following URL I get the current values for the number of Ads being blocked today and some other values.
http://<raspberrypi IP/admin/api.php
{"domains_being_blocked":"51,409","dns_queries_today":"3,311","ads_blocked_today":"193","ads_percentage_today":"5.8"}
Now I would like to put this values into Domoticz but I have no idea how?
Anyone know an easy way to accomplish this?
Thanks in advance!
How to get Pi-Hole value into Domoticz Topic is solved
Moderators: leecollings, remb0
- Westcott
- Posts: 423
- Joined: Tuesday 09 December 2014 17:04
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: UK - Glos
- Contact:
Re: How to get Pi-Hole value into Domoticz
That looks like JSON encoding.
Perhaps this topic will give some clues -
http://www.domoticz.com/forum/viewtopic.php?t=11450
Perhaps this topic will give some clues -
http://www.domoticz.com/forum/viewtopic.php?t=11450
Zwave - Sigma Z+ stick, Fibaro, Horstmann, Neo Coolcam, EUROtronic
RFlink - IR detectors and temperatures
Wifi - YeeLights, ESP32s, Anoop sockets
Zigbee - lots with zigbee2mqtt and ZbBridge
RFlink - IR detectors and temperatures
Wifi - YeeLights, ESP32s, Anoop sockets
Zigbee - lots with zigbee2mqtt and ZbBridge
-
- Posts: 6
- Joined: Sunday 16 August 2015 16:32
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Netherlands, Dordrecht
- Contact:
Re: How to get Pi-Hole value into Domoticz
Thank you for your quick reply Westcott! I will look at that topic and try to make it work. I will post the result in this topic for other people who might want to try this.Westcott wrote:That looks like JSON encoding.
Perhaps this topic will give some clues -
http://www.domoticz.com/forum/viewtopic.php?t=11450
- Westcott
- Posts: 423
- Joined: Tuesday 09 December 2014 17:04
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: UK - Glos
- Contact:
Re: How to get Pi-Hole value into Domoticz
This is how to read and decode to a table.
Just pass it your URL.
You'll need to get JSON.lus, see the Wiki.
Just pass it your URL.
You'll need to get JSON.lus, see the Wiki.
Code: Select all
function GetJSONdata(url)
if not JSON then
JSON = (loadfile "/home/pi/domoticz/scripts/lua/JSON.lua")()
end
local jsondata = assert(io.popen(url))
local data = jsondata:read('*all')
jsondata:close()
return JSON:decode(data)
end
Zwave - Sigma Z+ stick, Fibaro, Horstmann, Neo Coolcam, EUROtronic
RFlink - IR detectors and temperatures
Wifi - YeeLights, ESP32s, Anoop sockets
Zigbee - lots with zigbee2mqtt and ZbBridge
RFlink - IR detectors and temperatures
Wifi - YeeLights, ESP32s, Anoop sockets
Zigbee - lots with zigbee2mqtt and ZbBridge
-
- Posts: 80
- Joined: Saturday 19 March 2016 21:12
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: How to get Pi-Hole value into Domoticz
Did you get it working?drenergy wrote:Thank you for your quick reply Westcott! I will look at that topic and try to make it work. I will post the result in this topic for other people who might want to try this.Westcott wrote:That looks like JSON encoding.
Perhaps this topic will give some clues -
viewtopic.php?t=11450
Who is online
Users browsing this forum: Google [Bot] and 1 guest