Freebox os dashboard - DHCP / IP
This flow is only a part from Freebox os dashboard, please go to the collection
Freebox os dashboard
Node-RED flows to manage your Freebox with a Raspberry Pi
Language
French only
Install
Node RED installation :
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)
Palette needed :
node-red-contrib-crypto-js-dynamic
node-red-dashboard
Command line installation :
cd ~/.nodered
npm install node-red-contrib-crypto-js-dynamic
npm install node-red-dashboard
#Features
- Reboot button
- Uplink and Downlink gauge speed
- Upload and Download chart
- xDSL gain chart
- xDSL protocol and modulation
- Uptime
- Synchronisation and connection state
- IPv4 and IPv6 display
- Temperatures and fan speed
- DHCP main informations
- Static and dynamic IP - Host tables
[{"id":"64de7ca89bd91501","type":"tab","label":"DHCP","disabled":false,"info":""},{"id":"40f45474ca0e358f","type":"http request","z":"64de7ca89bd91501","name":"","method":"GET","ret":"obj","paytoqs":"ignore","url":"http://mafreebox.freebox.fr/api/v8/dhcp/config/","tls":"","persist":false,"proxy":"","authType":"","x":490,"y":40,"wires":[["a7d4dd459ab48bcd","eba2dfe62050874f"]]},{"id":"3e398b0feb102e55","type":"inject","z":"64de7ca89bd91501","name":"DHCP","props":[{"p":"payload"}],"repeat":"5","crontab":"","once":true,"onceDelay":"5","topic":"","payloadType":"date","x":100,"y":40,"wires":[["3d3d863d7ae79313"]]},{"id":"a7d4dd459ab48bcd","type":"debug","z":"64de7ca89bd91501","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":650,"y":40,"wires":[]},{"id":"3d3d863d7ae79313","type":"function","z":"64de7ca89bd91501","name":"set body","func":"msg = {};\nmsg.headers = {\n};\nmsg.headers['X-Fbx-App-Auth'] = global.get(\"session_token\");\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"msg.headers = {\n 'Content-Type':'application/json'\n \n};\nmsg.headers['X-Fbx-App-Auth'] = global.get(\"session_token\");\nmsg.payload = {\n};\nreturn msg;","libs":[],"x":300,"y":40,"wires":[["40f45474ca0e358f"]]},{"id":"eba2dfe62050874f","type":"switch","z":"64de7ca89bd91501","name":"","property":"payload.success","propertyType":"msg","rules":[{"t":"else"},{"t":"true"}],"checkall":"true","repair":false,"outputs":2,"x":650,"y":80,"wires":[["378cf04502f140f7"],["dfec3f8682802d0f","786cc51b8cf934da","f51101dd84edefa6","292bef292d3b1e5b","940c40e77a200367"]]},{"id":"378cf04502f140f7","type":"link out","z":"64de7ca89bd91501","name":"success false","links":["37179428002096c8"],"x":795,"y":60,"wires":[]},{"id":"dfec3f8682802d0f","type":"debug","z":"64de7ca89bd91501","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload.result","targetType":"msg","statusVal":"","statusType":"auto","x":930,"y":100,"wires":[]},{"id":"4ec4149105244a06","type":"ui_text","z":"64de7ca89bd91501","group":"3fd0c35cc4fa7663","order":3,"width":0,"height":0,"name":"","label":"DHCP","format":"{{msg.payload}}","layout":"row-spread","x":1070,"y":160,"wires":[]},{"id":"a57aca54ccb2c38e","type":"change","z":"64de7ca89bd91501","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"activé","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":920,"y":140,"wires":[["4ec4149105244a06"]]},{"id":"786cc51b8cf934da","type":"switch","z":"64de7ca89bd91501","name":"","property":"msg.payload.result.enabled","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":770,"y":160,"wires":[["a57aca54ccb2c38e"],["b446707c95e14f17"]]},{"id":"b446707c95e14f17","type":"change","z":"64de7ca89bd91501","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"désactivé","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":920,"y":180,"wires":[["4ec4149105244a06"]]},{"id":"f51101dd84edefa6","type":"ui_text","z":"64de7ca89bd91501","group":"3fd0c35cc4fa7663","order":3,"width":0,"height":0,"name":"","label":"Passerelle","format":"{{msg.payload.result.gateway}}","layout":"row-spread","x":770,"y":220,"wires":[]},{"id":"292bef292d3b1e5b","type":"ui_text","z":"64de7ca89bd91501","group":"3fd0c35cc4fa7663","order":3,"width":0,"height":0,"name":"","label":"plage d'IPs","format":"{{msg.payload.result.ip_range_start}} - {{msg.payload.result.ip_range_end}}","layout":"row-spread","x":750,"y":260,"wires":[]},{"id":"940c40e77a200367","type":"ui_text","z":"64de7ca89bd91501","group":"3fd0c35cc4fa7663","order":3,"width":0,"height":0,"name":"","label":"Masque de sous-réseau","format":"{{msg.payload.result.netmask}}","layout":"row-spread","x":770,"y":300,"wires":[]},{"id":"3fee888faf90b7c2","type":"http request","z":"64de7ca89bd91501","name":"","method":"GET","ret":"obj","paytoqs":"ignore","url":"http://mafreebox.freebox.fr/api/v8/dhcp/static_lease/","tls":"","persist":false,"proxy":"","authType":"","x":490,"y":400,"wires":[["ade9ee19861828d6","382260f82384fa72"]]},{"id":"c3eaca84094e4cfb","type":"inject","z":"64de7ca89bd91501","name":"IPs Statiques","props":[{"p":"payload"}],"repeat":"60","crontab":"","once":true,"onceDelay":"5","topic":"","payloadType":"date","x":120,"y":400,"wires":[["e2689bdfba9fc076"]]},{"id":"ade9ee19861828d6","type":"debug","z":"64de7ca89bd91501","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":650,"y":400,"wires":[]},{"id":"e2689bdfba9fc076","type":"function","z":"64de7ca89bd91501","name":"set body","func":"msg = {};\nmsg.headers = {\n};\nmsg.headers['X-Fbx-App-Auth'] = global.get(\"session_token\");\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"msg.headers = {\n 'Content-Type':'application/json'\n \n};\nmsg.headers['X-Fbx-App-Auth'] = global.get(\"session_token\");\nmsg.payload = {\n};\nreturn msg;","libs":[],"x":300,"y":400,"wires":[["3fee888faf90b7c2"]]},{"id":"382260f82384fa72","type":"switch","z":"64de7ca89bd91501","name":"","property":"payload.success","propertyType":"msg","rules":[{"t":"else"},{"t":"true"}],"checkall":"true","repair":false,"outputs":2,"x":650,"y":440,"wires":[["9c058d3835be1ce4"],["07b46896084dca44","e0c0b08169bc122a","9d79627bb39d4ecc"]]},{"id":"9c058d3835be1ce4","type":"link out","z":"64de7ca89bd91501","name":"success false","links":["37179428002096c8"],"x":795,"y":420,"wires":[]},{"id":"07b46896084dca44","type":"debug","z":"64de7ca89bd91501","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload.result","targetType":"msg","statusVal":"","statusType":"auto","x":930,"y":460,"wires":[]},{"id":"19c92a361fd6761c","type":"ui_template","z":"64de7ca89bd91501","group":"d146a53a4305fa82","name":"IPs Statiques","order":3,"width":"0","height":"0","format":"<div style=\"width:100%; min-height: {{msg.size}}rem;\">\n <table style=\"width:100%;\">\n <thead>\n <tr>\n <th>Hôte</th>\n <th>IP</th>\n <th>Adresse mac</th>\n <th>Commentaire</th>\n </tr>\n </thead>\n <tr ng-repeat = \"host in msg.payload.result\">\n <td>{{host.hostname}}</td>\n <td>{{host.ip}}</td>\n <td>{{host.mac}}</td>\n <td>{{host.comment}}</td>\n </tr>\n </table>\n</div>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":1050,"y":500,"wires":[[]]},{"id":"e0c0b08169bc122a","type":"debug","z":"64de7ca89bd91501","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload.result.length","targetType":"msg","statusVal":"","statusType":"auto","x":950,"y":540,"wires":[]},{"id":"9d79627bb39d4ecc","type":"function","z":"64de7ca89bd91501","name":"","func":"msg.size = msg.payload.result.length + 1\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":900,"y":500,"wires":[["19c92a361fd6761c"]]},{"id":"22f47076fbdd683f","type":"http request","z":"64de7ca89bd91501","name":"","method":"GET","ret":"obj","paytoqs":"ignore","url":"http://mafreebox.freebox.fr/api/v8/dhcp/dynamic_lease/","tls":"","persist":false,"proxy":"","authType":"","x":490,"y":600,"wires":[["334465a5112528ea","5d03bfa3b069f867"]]},{"id":"ee1371daa721b994","type":"inject","z":"64de7ca89bd91501","name":"IPs Dynamiques","props":[{"p":"payload"}],"repeat":"5","crontab":"","once":true,"onceDelay":"5","topic":"","payloadType":"date","x":130,"y":600,"wires":[["e7cd6ba1b635e674"]]},{"id":"334465a5112528ea","type":"debug","z":"64de7ca89bd91501","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":650,"y":600,"wires":[]},{"id":"e7cd6ba1b635e674","type":"function","z":"64de7ca89bd91501","name":"set body","func":"msg = {};\nmsg.headers = {\n};\nmsg.headers['X-Fbx-App-Auth'] = global.get(\"session_token\");\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"msg.headers = {\n 'Content-Type':'application/json'\n \n};\nmsg.headers['X-Fbx-App-Auth'] = global.get(\"session_token\");\nmsg.payload = {\n};\nreturn msg;","libs":[],"x":300,"y":600,"wires":[["22f47076fbdd683f"]]},{"id":"5d03bfa3b069f867","type":"switch","z":"64de7ca89bd91501","name":"","property":"payload.success","propertyType":"msg","rules":[{"t":"else"},{"t":"true"}],"checkall":"true","repair":false,"outputs":2,"x":650,"y":640,"wires":[["348f1fd0133eef3c"],["6c9f5d319888399b","99cba7811bcfa4ed","5d7633d27cb12b87"]]},{"id":"348f1fd0133eef3c","type":"link out","z":"64de7ca89bd91501","name":"success false","links":["37179428002096c8"],"x":795,"y":620,"wires":[]},{"id":"6c9f5d319888399b","type":"debug","z":"64de7ca89bd91501","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload.result","targetType":"msg","statusVal":"","statusType":"auto","x":930,"y":660,"wires":[]},{"id":"6eacbe2b1ff2b316","type":"ui_template","z":"64de7ca89bd91501","group":"d146a53a4305fa82","name":"IPs Dynamiques","order":3,"width":"0","height":"0","format":"<div style=\"width:100%; min-height: {{msg.size}}rem;\">\n <table style=\"width:100%;\">\n <thead>\n <tr>\n <th>Hôte</th>\n <th>IP</th>\n <th>Adresse mac</th>\n <th>Commentaire</th>\n </tr>\n </thead>\n <tr ng-repeat = \"host in msg.payload.result\">\n <td>{{host.hostname}}</td>\n <td>{{host.ip}}</td>\n <td>{{host.mac}}</td>\n <td>{{host.comment}}</td>\n </tr>\n </table>\n</div>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":1060,"y":700,"wires":[[]]},{"id":"99cba7811bcfa4ed","type":"debug","z":"64de7ca89bd91501","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload.result.length","targetType":"msg","statusVal":"","statusType":"auto","x":950,"y":740,"wires":[]},{"id":"5d7633d27cb12b87","type":"function","z":"64de7ca89bd91501","name":"","func":"msg.size = msg.payload.result.length + 1\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":900,"y":700,"wires":[["6eacbe2b1ff2b316"]]},{"id":"3fd0c35cc4fa7663","type":"ui_group","name":"DHCP","tab":"20610ad215e7173d","order":1,"disp":true,"width":"7","collapse":false},{"id":"d146a53a4305fa82","type":"ui_group","name":"IPs","tab":"20610ad215e7173d","order":6,"disp":true,"width":"12","collapse":false},{"id":"20610ad215e7173d","type":"ui_tab","name":"IP","icon":"router","order":2,"disabled":false,"hidden":false}]