Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [{"id":"e70c5f2a.c9908","type":"http request","z":"65505814.c27b98","name":"AdGuard-1 Stats","method":"GET","ret":"obj","paytoqs":false,"url":"http://adguard-1/control/stats","tls":"","persist":false,"proxy":"","authType":"basic","x":310,"y":2530,"wires":[["513db977.ccc8d8"]]},{"id":"f3866cba.6afaf","type":"inject","z":"65505814.c27b98","name":"","topic":"","payload":"","payloadType":"date","repeat":"60","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":2590,"wires":[["3506179c.ff5c58","e70c5f2a.c9908","246467e3.4d87f8","8b89aa5e.18aa58","7eb80454.b771dc","8e9bb0d2.dc194"]]},{"id":"872bf8c3.780818","type":"mqtt out","z":"65505814.c27b98","name":"AdGuard Stats","topic":"","qos":"","retain":"true","broker":"a0c390fa.b822a","x":1310,"y":2570,"wires":[]},{"id":"500bee49.38317","type":"change","z":"65505814.c27b98","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"'adguard/' & $split($.responseUrl,\"/\")[2] & '/stats'","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":870,"y":2570,"wires":[["872bf8c3.780818","43aaaeae.e2a7b"]]},{"id":"7eb80454.b771dc","type":"http request","z":"65505814.c27b98","name":"AdGuard-2 Stats","method":"GET","ret":"obj","paytoqs":false,"url":"http://adguard-2/control/stats","tls":"","persist":false,"proxy":"","authType":"basic","x":310,"y":2650,"wires":[["4da11444.89269c"]]},{"id":"43aaaeae.e2a7b","type":"join","z":"65505814.c27b98","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":690,"y":2610,"wires":[["fc829fea.81bd1"]]},{"id":"fc829fea.81bd1","type":"change","z":"65505814.c27b98","name":"","rules":[{"t":"set","p":"num_blocked_filtering","pt":"msg","to":"$.payload[0][1].num_blocked_filtering + $.payload[1][1].num_blocked_filtering","tot":"jsonata"},{"t":"set","p":"num_dns_queries","pt":"msg","to":"$.payload[0][1].num_dns_queries + $.payload[1][1].num_dns_queries","tot":"jsonata"},{"t":"set","p":"blocklist_difference","pt":"msg","to":"$.payload[0][1].domains_being_blocked - $.payload[1][1].domains_being_blocked","tot":"jsonata"},{"t":"set","p":"num_replaced_safesearch","pt":"msg","to":"$.payload[0][1].num_replaced_safesearch + $.payload[1][1].num_replaced_safesearch","tot":"jsonata"},{"t":"set","p":"ads_percentage_today","pt":"msg","to":"(100 / $.num_dns_queries) * num_blocked_filtering","tot":"jsonata"},{"t":"set","p":"payload","pt":"msg","to":"'{\"num_blocked_filtering\":' & $.num_blocked_filtering & ',\"num_dns_queries\":' &\t $.num_dns_queries & ',\"ads_percentage_today\":' & $.ads_percentage_today &\t ',\"num_replaced_safesearch\":' & $.num_replaced_safesearch &\t '}'","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"adguard/combined/stats","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":880,"y":2610,"wires":[["b525efc5.6f097"]]},{"id":"b525efc5.6f097","type":"json","z":"65505814.c27b98","name":"","property":"payload","action":"","pretty":true,"x":1090,"y":2610,"wires":[["872bf8c3.780818"]]},{"id":"3506179c.ff5c58","type":"http request","z":"65505814.c27b98","name":"AdGuard-1 Status","method":"GET","ret":"obj","paytoqs":false,"url":"http://adguard-1/control/status","tls":"","persist":false,"proxy":"","authType":"basic","x":310,"y":2490,"wires":[["e067882e.d6ece8"]]},{"id":"8b89aa5e.18aa58","type":"http request","z":"65505814.c27b98","name":"AdGuard-2 Status","method":"GET","ret":"obj","paytoqs":false,"url":"http://adguard-2/control/status","tls":"","persist":false,"proxy":"","authType":"basic","x":310,"y":2610,"wires":[["27a4b1c2.9e0b8e"]]},{"id":"c5788980.df0398","type":"http request","z":"65505814.c27b98","name":"Update Custom List","method":"POST","ret":"txt","paytoqs":false,"url":"http://{{{topic}}}/control/filtering/set_rules","tls":"","persist":false,"proxy":"","authType":"basic","x":1250,"y":2770,"wires":[[]]},{"id":"246467e3.4d87f8","type":"http request","z":"65505814.c27b98","name":"AdGuard-1 Filter Stats","method":"GET","ret":"obj","paytoqs":false,"url":"http://adguard-1/control/filtering/status","tls":"","persist":false,"proxy":"","authType":"basic","x":320,"y":2570,"wires":[["a05cf0cb.c47f6"]]},{"id":"7bfd8618.237178","type":"join","z":"65505814.c27b98","name":"","mode":"auto","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":690,"y":2570,"wires":[["500bee49.38317"]]},{"id":"e067882e.d6ece8","type":"change","z":"65505814.c27b98","name":"join meta","rules":[{"t":"set","p":"parts.id","pt":"msg","to":"adguard-1","tot":"str"},{"t":"set","p":"parts.type","pt":"msg","to":"array","tot":"str"},{"t":"set","p":"parts.count","pt":"msg","to":"3","tot":"num"},{"t":"set","p":"parts.index","pt":"msg","to":"0","tot":"num"},{"t":"set","p":"parts.len","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":2490,"wires":[["7bfd8618.237178"]]},{"id":"513db977.ccc8d8","type":"change","z":"65505814.c27b98","name":"join meta","rules":[{"t":"set","p":"parts.id","pt":"msg","to":"adguard-1","tot":"str"},{"t":"set","p":"parts.type","pt":"msg","to":"array","tot":"str"},{"t":"set","p":"parts.count","pt":"msg","to":"3","tot":"num"},{"t":"set","p":"parts.index","pt":"msg","to":"1","tot":"num"},{"t":"set","p":"parts.len","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":2530,"wires":[["7bfd8618.237178"]]},{"id":"a05cf0cb.c47f6","type":"change","z":"65505814.c27b98","name":"join meta","rules":[{"t":"set","p":"parts.id","pt":"msg","to":"adguard-1","tot":"str"},{"t":"set","p":"parts.type","pt":"msg","to":"array","tot":"str"},{"t":"set","p":"parts.count","pt":"msg","to":"3","tot":"num"},{"t":"set","p":"parts.index","pt":"msg","to":"2","tot":"num"},{"t":"set","p":"parts.len","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":2570,"wires":[["7bfd8618.237178"]]},{"id":"c9198cb2.c15ef","type":"mqtt in","z":"65505814.c27b98","name":"AdGuard 1","topic":"adguard/adguard-1/stats","qos":"2","datatype":"json","broker":"a0c390fa.b822a","x":100,"y":2750,"wires":[["eeeeb618.17f808"]]},{"id":"107ebc8c.dafbf3","type":"change","z":"65505814.c27b98","name":"set payload","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.2.user_rules","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":530,"y":2770,"wires":[["ae60690a.d397b8"]]},{"id":"ae60690a.d397b8","type":"split","z":"65505814.c27b98","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":690,"y":2770,"wires":[["432d75a5.8b44fc"]]},{"id":"432d75a5.8b44fc","type":"join","z":"65505814.c27b98","name":"","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":830,"y":2770,"wires":[["712d4dc4.5e7cd4"]]},{"id":"712d4dc4.5e7cd4","type":"rbe","z":"65505814.c27b98","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":980,"y":2770,"wires":[["c5788980.df0398"]]},{"id":"63fe910.7c4d97","type":"mqtt in","z":"65505814.c27b98","name":"AdGuard 2","topic":"adguard/adguard-2/stats","qos":"2","datatype":"json","broker":"a0c390fa.b822a","x":100,"y":2800,"wires":[["5c742fc.a9a0dd"]]},{"id":"8e9bb0d2.dc194","type":"http request","z":"65505814.c27b98","name":"AdGuard-2 Filter Stats","method":"GET","ret":"obj","paytoqs":false,"url":"http://adguard-2/control/filtering/status","tls":"","persist":false,"proxy":"","authType":"basic","x":320,"y":2690,"wires":[["ecd42d0d.b6a7"]]},{"id":"27a4b1c2.9e0b8e","type":"change","z":"65505814.c27b98","name":"join meta","rules":[{"t":"set","p":"parts.id","pt":"msg","to":"adguard-2","tot":"str"},{"t":"set","p":"parts.type","pt":"msg","to":"array","tot":"str"},{"t":"set","p":"parts.count","pt":"msg","to":"3","tot":"num"},{"t":"set","p":"parts.index","pt":"msg","to":"0","tot":"num"},{"t":"set","p":"parts.len","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":2610,"wires":[["7bfd8618.237178"]]},{"id":"4da11444.89269c","type":"change","z":"65505814.c27b98","name":"join meta","rules":[{"t":"set","p":"parts.id","pt":"msg","to":"adguard-2","tot":"str"},{"t":"set","p":"parts.type","pt":"msg","to":"array","tot":"str"},{"t":"set","p":"parts.count","pt":"msg","to":"3","tot":"num"},{"t":"set","p":"parts.index","pt":"msg","to":"1","tot":"num"},{"t":"set","p":"parts.len","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":2650,"wires":[["7bfd8618.237178"]]},{"id":"ecd42d0d.b6a7","type":"change","z":"65505814.c27b98","name":"join meta","rules":[{"t":"set","p":"parts.id","pt":"msg","to":"adguard-2","tot":"str"},{"t":"set","p":"parts.type","pt":"msg","to":"array","tot":"str"},{"t":"set","p":"parts.count","pt":"msg","to":"3","tot":"num"},{"t":"set","p":"parts.index","pt":"msg","to":"2","tot":"num"},{"t":"set","p":"parts.len","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":2690,"wires":[["7bfd8618.237178"]]},{"id":"eeeeb618.17f808","type":"change","z":"65505814.c27b98","name":"set topic","rules":[{"t":"set","p":"topic","pt":"msg","to":"adguard-2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":2750,"wires":[["107ebc8c.dafbf3"]]},{"id":"5c742fc.a9a0dd","type":"change","z":"65505814.c27b98","name":"set topic","rules":[{"t":"set","p":"topic","pt":"msg","to":"adguard-1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":2800,"wires":[["107ebc8c.dafbf3"]]},{"id":"a0c390fa.b822a","type":"mqtt-broker","z":"","name":"MQTT","broker":"192.168.4.50","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"30","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
Advertisement
Add Comment
Please, Sign In to add comment