Bonjour
Un petit flow en partage qui affiche des infos du NRX800 et permet de controler les IO, lancer un backup des flows, et effectuer un reboot ou un arrêt du NRX800
Il faut importer le flow
Coller le flow json et importer
Et déployer
Le dashboard est accessible http://IP du NRX800:1880/ui
Il faut installer via la palette le node « @terranlabs/email-nodes »
Code du flow
[{"id":"9cf3a6d.1104258","type":"tab","label":"NRX800","disabled":false,"info":""},{"id":"538510015ef875bb","type":"group","z":"9cf3a6d.1104258","name":"Système","style":{"fill":"#e3f3d3","label":true,"color":"#001f60"},"nodes":["d4feb199.b898b","c0682e5c.a4fc","95ae4c48.9f606","4bae8072.e81c2","92285ea6.f97a7","404f06.1e77b0fc","b2e972ab7f704f9d","345c5fb5d2d3dde7","87c070af5ea7bc19","c95eeba434e27c53","2be04c82.d0af74","5e6e69bb.0e1d38","ad4498e0.e7c278","a8dc2f34.5e32b","a508a5b7.89a128"],"x":54,"y":39,"w":992,"h":289.5},{"id":"9155cb6dade1b14a","type":"group","z":"9cf3a6d.1104258","name":"Shell","style":{"fill":"#e3f3d3","label":true,"color":"#001f60"},"nodes":["f4592b30.2f0528","4b4a0861.092b28","6c63dd0ccd89e489","8691b172816d200d","f7da32e9909166a9","8c59eea02ffacbaa","413c01ffb39242e1","4093b7caf12944c2"],"x":54,"y":531.5,"w":832,"h":157},{"id":"40e33d0d38114572","type":"group","z":"9cf3a6d.1104258","name":"OS","style":{"fill":"#e3f3d3","label":true,"color":"#001f60"},"nodes":["19fadb42.3d0c25","9cce8e0f.766f7","31113ee5af599411","2f2d6236c424abc9","b1f64e1b1601f2ea","53046e807ae74d43","2834bbfe0126397b","11cceabbb6365f6b"],"x":54,"y":351.5,"w":992,"h":157},{"id":"edbabdee2e378844","type":"group","z":"9cf3a6d.1104258","name":"Backup flows Node-red + IP du NRX800","style":{"fill":"#e3f3d3","label":true,"color":"#000000"},"nodes":["d891b81710a2a3f5","101bd152921ffcf3","7fdb606658b5f6be","e9d49bfbe488d474","cccc4c91b72d8134","70cb342abb017d11","698a29e215b57edb","a03e8d2dc156d39b"],"x":54,"y":719,"w":992,"h":149.5,"info":"## "},{"id":"a94030bac4b45dd3","type":"group","z":"9cf3a6d.1104258","name":"","style":{"fill":"#e3f3d3","label":true,"color":"#001f60"},"nodes":["1d018eafd8bf1522","6a5f18a5026c49df","341eb8890ae2f075","73d446ebd39f3adf","8e37025cfbbdd215","4da4b4d2cd323168","911254c9361dcc85","6278b8c855a234ec","5f250cb357f3a7ca"],"x":1068,"y":33,"w":904,"h":894},{"id":"1d018eafd8bf1522","type":"group","z":"9cf3a6d.1104258","g":"a94030bac4b45dd3","name":"INPUT 1 to Relay 1","style":{"label":true,"color":"#001f60"},"nodes":["1e0d57267a689967","425964c119581534","2a6c1901f8f0f23d","e8adc2041f58d458","8f1fb49bcf1865c3","a782add2800bddd7"],"x":1094,"y":59,"w":412,"h":162},{"id":"6a5f18a5026c49df","type":"group","z":"9cf3a6d.1104258","g":"a94030bac4b45dd3","name":"INPUT 1 to Relay 2","style":{"label":true,"color":"#001f60"},"nodes":["0e08f995b9e53600","c32a21f2f1238ae8","869c3cdf10dec313","1df3923788314f2d","e7f11e9cf742d51a","94ba44f4d8d2ee33"],"x":1534,"y":59,"w":412,"h":162},{"id":"341eb8890ae2f075","type":"group","z":"9cf3a6d.1104258","g":"a94030bac4b45dd3","name":"INPUT 1 to Relay 3","style":{"label":true,"color":"#001f60"},"nodes":["afc35bf01a1b5ccc","3937c11b3040a52a","69b57d017e0bcca1","c30e694cece03844","6dc0bf7d36c2ec05","311b550de599234b"],"x":1094,"y":239,"w":412,"h":162},{"id":"73d446ebd39f3adf","type":"group","z":"9cf3a6d.1104258","g":"a94030bac4b45dd3","name":"INPUT 1 to Relay 4","style":{"label":true,"color":"#001f60"},"nodes":["0f418d2ec7f17eb0","5c194144f8b62a75","8c3d4c6410f535db","8eaed897cf40b94c","35b29966db053985","8d464ffecac89b4a"],"x":1534,"y":239,"w":412,"h":162},{"id":"8e37025cfbbdd215","type":"group","z":"9cf3a6d.1104258","g":"a94030bac4b45dd3","name":"INPUT 1 to Relay 5","style":{"label":true,"color":"#001f60"},"nodes":["0531e8951ede7ae8","1f5bf931c2bd9242","e5fcac628fb52e29","cde3a838c2fe2c10","f9b1fec0578d4e03","942f4669a65de4cb"],"x":1094,"y":419,"w":412,"h":162},{"id":"4da4b4d2cd323168","type":"group","z":"9cf3a6d.1104258","g":"a94030bac4b45dd3","name":"INPUT 1 to Relay 6","style":{"label":true,"color":"#001f60"},"nodes":["5897a9b9775b68f8","9d59bb358821b9f9","7ae552edbcab9253","cf4469c22ba26ccd","b1b88bf0a4776502","a664b44fe7286d9f"],"x":1534,"y":419,"w":412,"h":162},{"id":"911254c9361dcc85","type":"group","z":"9cf3a6d.1104258","g":"a94030bac4b45dd3","name":"INPUT 1 to Relay 7","style":{"label":true,"color":"#001f60"},"nodes":["bd728d2f360248db","fa6caf70b80dec7c","ba5b70942dcc67b5","36dd6fa3a3a9bbef","1ad18492762c0a57","51ecfff83c3c42fe"],"x":1094,"y":599,"w":412,"h":162},{"id":"6278b8c855a234ec","type":"group","z":"9cf3a6d.1104258","g":"a94030bac4b45dd3","name":"INPUT 1 to Relay 8","style":{"label":true,"color":"#001f60"},"nodes":["6d79acf60528c5af","fa9e9ce5b429f483","6ec9bb8528a1a33c","dd77fe9f7545627d","70b0a5b3e527436b","bd9fcad032c28eec"],"x":1534,"y":599,"w":412,"h":162},{"id":"5f250cb357f3a7ca","type":"group","z":"9cf3a6d.1104258","g":"a94030bac4b45dd3","name":"User Led","style":{"label":true,"color":"#001f60"},"nodes":["59d206ab2e2f162f","51f980f9b97a7db7","0639371b74b6bd57","b68165cf6eb30256","7f4467274ef29c4f"],"x":1094,"y":779,"w":572,"h":122},{"id":"d4feb199.b898b","type":"ui_gauge","z":"9cf3a6d.1104258","g":"538510015ef875bb","name":"","group":"9cb4bc4d.96552","order":2,"width":3,"height":3,"gtype":"gage","title":"CPU Temperature","label":"C","format":"{{value}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"35","seg2":"60","diff":false,"className":"","x":930,"y":120,"wires":[]},{"id":"c0682e5c.a4fc","type":"exec","z":"9cf3a6d.1104258","g":"538510015ef875bb","command":"vcgencmd measure_temp","addpay":false,"append":"","useSpawn":"","timer":"","name":"RPi Temp.","x":580,"y":100,"wires":[["95ae4c48.9f606"],[],[]]},{"id":"95ae4c48.9f606","type":"function","z":"9cf3a6d.1104258","g":"538510015ef875bb","name":"","func":"var str = msg.payload\nmsg.payload = str.substring(5,9);\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":740,"y":100,"wires":[["d4feb199.b898b","4bae8072.e81c2"]]},{"id":"f4592b30.2f0528","type":"ui_button","z":"9cf3a6d.1104258","g":"9155cb6dade1b14a","name":"","group":"75ffb55f4d9cf5a5","order":3,"width":0,"height":0,"passthru":false,"label":"Reboot","tooltip":"Rebooter le NRX800","color":"","bgcolor":"","className":"","icon":"","payload":"Voulez-vous vraiment rebooter le NRX800 ?","payloadType":"str","topic":"","topicType":"str","x":130,"y":580,"wires":[["6c63dd0ccd89e489"]]},{"id":"4b4a0861.092b28","type":"ui_button","z":"9cf3a6d.1104258","g":"9155cb6dade1b14a","name":"","group":"75ffb55f4d9cf5a5","order":4,"width":0,"height":0,"passthru":false,"label":"Shutdown","tooltip":"","color":"","bgcolor":"red","className":"","icon":"","payload":"","payloadType":"str","topic":"","topicType":"str","x":140,"y":640,"wires":[["8691b172816d200d"]]},{"id":"4bae8072.e81c2","type":"ui_chart","z":"9cf3a6d.1104258","g":"538510015ef875bb","name":"","group":"9cb4bc4d.96552","order":5,"width":6,"height":6,"label":"CPU Temperature","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"24","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":930,"y":80,"wires":[[]]},{"id":"92285ea6.f97a7","type":"exec","z":"9cf3a6d.1104258","g":"538510015ef875bb","command":"top -d 0.5 -b -n2 | grep \"Cpu(s)\"|tail -n 1 | awk '{print $2 + $4}'","addpay":false,"append":"","useSpawn":"","timer":"","winHide":false,"name":"CPU Load","x":580,"y":160,"wires":[["404f06.1e77b0fc"],[],[]]},{"id":"404f06.1e77b0fc","type":"ui_gauge","z":"9cf3a6d.1104258","g":"538510015ef875bb","name":"","group":"9cb4bc4d.96552","order":1,"width":3,"height":3,"gtype":"gage","title":"CPU","label":"CPU","format":"{{value}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","diff":false,"className":"","x":970,"y":160,"wires":[]},{"id":"a508a5b7.89a128","type":"exec","z":"9cf3a6d.1104258","g":"538510015ef875bb","command":"df -h","addpay":false,"append":"","useSpawn":"","timer":"","winHide":false,"name":"Disk Usage","x":590,"y":280,"wires":[["a8dc2f34.5e32b"],[],[]]},{"id":"ad4498e0.e7c278","type":"ui_gauge","z":"9cf3a6d.1104258","g":"538510015ef875bb","name":"","group":"9cb4bc4d.96552","order":4,"width":3,"height":3,"gtype":"gage","title":"Disk","label":"%","format":"{{value}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","diff":false,"className":"","x":970,"y":280,"wires":[]},{"id":"a8dc2f34.5e32b","type":"function","z":"9cf3a6d.1104258","g":"538510015ef875bb","name":"","func":"var re = /([0-9]{2})%/\nvar idx = msg.payload.search(re);\nvar str = msg.payload;\nif (idx >=0) {\n str = msg.payload.substring(idx, idx + 2);\n}\nmsg.payload = str;\nreturn msg;","outputs":1,"noerr":0,"x":760,"y":280,"wires":[["ad4498e0.e7c278"]]},{"id":"5e6e69bb.0e1d38","type":"inject","z":"9cf3a6d.1104258","g":"538510015ef875bb","name":"","props":[{"p":"payload"}],"repeat":"60","crontab":"","once":true,"onceDelay":"","topic":"","payload":"","payloadType":"date","x":170,"y":280,"wires":[["a508a5b7.89a128"]]},{"id":"19fadb42.3d0c25","type":"inject","z":"9cf3a6d.1104258","g":"40e33d0d38114572","name":"","props":[{"p":"payload"}],"repeat":"60","crontab":"","once":true,"onceDelay":"","topic":"","payload":"","payloadType":"date","x":170,"y":400,"wires":[["9cce8e0f.766f7"]]},{"id":"9cce8e0f.766f7","type":"exec","z":"9cf3a6d.1104258","g":"40e33d0d38114572","command":"hostname","addpay":false,"append":"-I","useSpawn":"","timer":"","winHide":false,"name":"Affiche Adresse IP","x":470,"y":400,"wires":[["31113ee5af599411"],[],[]]},{"id":"b2e972ab7f704f9d","type":"exec","z":"9cf3a6d.1104258","g":"538510015ef875bb","command":"free | grep Mem | awk '{print 100*($3/$2)}'","addpay":false,"append":"","useSpawn":"","timer":"","winHide":false,"name":"Used Memory","x":590,"y":220,"wires":[["345c5fb5d2d3dde7"],[],[]]},{"id":"345c5fb5d2d3dde7","type":"ui_gauge","z":"9cf3a6d.1104258","g":"538510015ef875bb","name":"","group":"9cb4bc4d.96552","order":3,"width":3,"height":3,"gtype":"gage","title":"Memoire","label":"%","format":"{{parseInt(value)}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","diff":false,"className":"","x":960,"y":220,"wires":[]},{"id":"31113ee5af599411","type":"function","z":"9cf3a6d.1104258","g":"40e33d0d38114572","name":"Extrait adresse ipv4","func":"// Regular expression to match an IPv4 address\nvar ipv4Regex = /\\b(?:\\d{1,3}\\.){3}\\d{1,3}\\b/;\n\n// Extract the IPv4 address using the regex\nvar ipv4Match = msg.payload.match(ipv4Regex);\n\n// If an IPv4 address is found, set it as the new payload\nif (ipv4Match) {\n msg.payload = ipv4Match[0];\n} else {\n msg.payload = \"Pas d'adresse IPv4 trouvée\";\n}\n\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":750,"y":400,"wires":[["2f2d6236c424abc9"]]},{"id":"2f2d6236c424abc9","type":"ui_text","z":"9cf3a6d.1104258","g":"40e33d0d38114572","group":"dd70abe0.14cb38","order":1,"width":6,"height":2,"name":"","label":"Adresse IP","format":"{{msg.payload}}","layout":"col-center","className":"","style":false,"font":"","fontSize":"","color":"#000000","x":950,"y":400,"wires":[]},{"id":"87c070af5ea7bc19","type":"ui_switch","z":"9cf3a6d.1104258","g":"538510015ef875bb","name":"","label":"Cpu Temp Mémoire","tooltip":"","group":"9cb4bc4d.96552","order":6,"width":0,"height":0,"passthru":false,"decouple":"false","topic":"control","topicType":"str","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":true,"className":"","x":190,"y":160,"wires":[["c95eeba434e27c53"]]},{"id":"c95eeba434e27c53","type":"switch","z":"9cf3a6d.1104258","g":"538510015ef875bb","name":"Vérifie état switch","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":390,"y":160,"wires":[["c0682e5c.a4fc","92285ea6.f97a7","b2e972ab7f704f9d"],[]]},{"id":"2be04c82.d0af74","type":"inject","z":"9cf3a6d.1104258","g":"538510015ef875bb","name":"","props":[{"p":"payload"}],"repeat":"3","crontab":"","once":true,"onceDelay":"","topic":"","payload":"","payloadType":"date","x":170,"y":100,"wires":[["87c070af5ea7bc19"]]},{"id":"6c63dd0ccd89e489","type":"ui_toast","z":"9cf3a6d.1104258","g":"9155cb6dade1b14a","position":"dialog","displayTime":"3","highlight":"","sendall":true,"outputs":1,"ok":"OK","cancel":"Cancel","raw":true,"className":"","topic":"","name":"Confirmer Reboot","x":330,"y":580,"wires":[["f7da32e9909166a9"]]},{"id":"8691b172816d200d","type":"ui_toast","z":"9cf3a6d.1104258","g":"9155cb6dade1b14a","position":"dialog","displayTime":"3","highlight":"","sendall":true,"outputs":1,"ok":"OK","cancel":"","raw":false,"className":"","topic":"","name":"Confirmer l'arrêt","x":320,"y":640,"wires":[["413c01ffb39242e1"]]},{"id":"f7da32e9909166a9","type":"switch","z":"9cf3a6d.1104258","g":"9155cb6dade1b14a","name":"Teste la réponse","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"OK","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":540,"y":580,"wires":[["8c59eea02ffacbaa"]]},{"id":"8c59eea02ffacbaa","type":"exec","z":"9cf3a6d.1104258","g":"9155cb6dade1b14a","command":"sudo reboot","addpay":false,"append":"","useSpawn":"false","timer":"","winHide":false,"oldrc":false,"name":"Execute Reboot","x":780,"y":580,"wires":[[],[],[]]},{"id":"413c01ffb39242e1","type":"switch","z":"9cf3a6d.1104258","g":"9155cb6dade1b14a","name":"Teste la réponse","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"OK","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":540,"y":640,"wires":[["4093b7caf12944c2"]]},{"id":"4093b7caf12944c2","type":"exec","z":"9cf3a6d.1104258","g":"9155cb6dade1b14a","command":"sudo halt","addpay":false,"append":"","useSpawn":"false","timer":"","winHide":false,"oldrc":false,"name":"Execute halt","x":770,"y":640,"wires":[[],[],[]]},{"id":"b1f64e1b1601f2ea","type":"inject","z":"9cf3a6d.1104258","g":"40e33d0d38114572","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":"","topic":"","payload":"","payloadType":"date","x":170,"y":460,"wires":[["53046e807ae74d43"]]},{"id":"53046e807ae74d43","type":"exec","z":"9cf3a6d.1104258","g":"40e33d0d38114572","command":"sudo cat /etc/os-release","addpay":false,"append":"","useSpawn":"","timer":"","winHide":false,"name":"Affiche Version Linux","x":480,"y":460,"wires":[["11cceabbb6365f6b"],[],[]]},{"id":"2834bbfe0126397b","type":"ui_text","z":"9cf3a6d.1104258","g":"40e33d0d38114572","group":"dd70abe0.14cb38","order":2,"width":6,"height":2,"name":"","label":"Version Linux","format":"{{msg.payload}}","layout":"col-center","className":"","style":false,"font":"","fontSize":"","color":"#000000","x":950,"y":460,"wires":[]},{"id":"11cceabbb6365f6b","type":"function","z":"9cf3a6d.1104258","g":"40e33d0d38114572","name":"Extrait pretty_name","func":"// Le message contient le texte multi-ligne dans msg.payload\nvar text = msg.payload;\n\n// Utiliser une expression régulière pour trouver la ligne contenant PRETTY_NAME\nvar match = text.match(/^PRETTY_NAME=\"(.+)\"$/m);\n\nif (match) {\n // Si une correspondance est trouvée, extraire la valeur\n msg.payload = match[1];\n} else {\n // Si aucune correspondance n'est trouvée, renvoyer un message d'erreur\n msg.payload = \"PRETTY_NAME not found\";\n}\n\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":750,"y":460,"wires":[["2834bbfe0126397b"]]},{"id":"d891b81710a2a3f5","type":"inject","z":"9cf3a6d.1104258","g":"edbabdee2e378844","name":"Backup Node-red","props":[],"repeat":"","crontab":"00 00 * * *","once":false,"onceDelay":0.1,"topic":"","x":190,"y":820,"wires":[["e9d49bfbe488d474"]]},{"id":"101bd152921ffcf3","type":"function","z":"9cf3a6d.1104258","g":"edbabdee2e378844","name":"Construction de l'email","func":"const date = new Date()\nconst ip = msg.payload\n\nmsg.topic = `Backup-Node-red - ${date} - ${ip}`\n\nmsg.payload = `<h1>Backup des flows Node-red NRX800</h1>`\nmsg.attachments = [\n { \n filename: `flows.json`,\n path: \"/home/nrx800/.node-red/flows.json\"\n },\n { \n filename: `flows_cred.json`,\n path: \"/home/nrx800/.node-red/flows_cred.json\"\n },\n { \n filename: `package.json`,\n path: \"/home/nrx800/.node-red/package.json\"\n },\n { \n filename: `package-lock.json`,\n path: \"/home/nrx800/.node-red/package-lock.json\"\n }\n ]\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":800,"y":820,"wires":[["7fdb606658b5f6be"]]},{"id":"7fdb606658b5f6be","type":"e-mail","z":"9cf3a6d.1104258","g":"edbabdee2e378844","server":"smtp.orange.fr","port":"465","authtype":"BASIC","saslformat":false,"token":"oauth2Response.access_token","secure":true,"tls":true,"name":"xxxxxx@orange.fr","dname":"email","x":970,"y":820,"wires":[]},{"id":"e9d49bfbe488d474","type":"exec","z":"9cf3a6d.1104258","g":"edbabdee2e378844","command":"hostname","addpay":false,"append":"-I","useSpawn":"","timer":"","winHide":false,"name":"Récupére IP","x":390,"y":820,"wires":[["cccc4c91b72d8134"],[],[]]},{"id":"cccc4c91b72d8134","type":"function","z":"9cf3a6d.1104258","g":"edbabdee2e378844","name":"Extrait adresse ipv4","func":"// Regular expression to match an IPv4 address\nvar ipv4Regex = /\\b(?:\\d{1,3}\\.){3}\\d{1,3}\\b/;\n\n// Extract the IPv4 address using the regex\nvar ipv4Match = msg.payload.match(ipv4Regex);\n\n// If an IPv4 address is found, set it as the new payload\nif (ipv4Match) {\n msg.payload = ipv4Match[0];\n} else {\n msg.payload = \"No IPv4 address found\";\n}\n\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":590,"y":820,"wires":[["101bd152921ffcf3"]]},{"id":"70cb342abb017d11","type":"ui_button","z":"9cf3a6d.1104258","g":"edbabdee2e378844","name":"","group":"75ffb55f4d9cf5a5","order":1,"width":0,"height":0,"passthru":false,"label":"Backup flows","tooltip":"Envoyer par email le flows.json du NRX800","color":"","bgcolor":"","className":"","icon":"","payload":"Voulez-vous vraiment envoyer par email les flows.json du NRX800 ?","payloadType":"str","topic":"","topicType":"str","x":180,"y":760,"wires":[["698a29e215b57edb"]]},{"id":"698a29e215b57edb","type":"ui_toast","z":"9cf3a6d.1104258","g":"edbabdee2e378844","position":"dialog","displayTime":"3","highlight":"","sendall":true,"outputs":1,"ok":"OK","cancel":"Cancel","raw":true,"className":"","topic":"","name":"Confirmer Backup","x":410,"y":760,"wires":[["a03e8d2dc156d39b"]]},{"id":"a03e8d2dc156d39b","type":"switch","z":"9cf3a6d.1104258","g":"edbabdee2e378844","name":"Vérifie la réponse","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"OK","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":630,"y":760,"wires":[["e9d49bfbe488d474"]]},{"id":"1e0d57267a689967","type":"rpi-gpio out","z":"9cf3a6d.1104258","g":"1d018eafd8bf1522","name":"RLY 1","pin":"4","set":true,"level":"0","freq":"","out":"out","bcm":true,"x":1430,"y":140,"wires":[]},{"id":"425964c119581534","type":"rpi-gpio in","z":"9cf3a6d.1104258","g":"1d018eafd8bf1522","name":"INPUT 1","pin":"20","intype":"tri","debounce":"25","read":true,"bcm":true,"x":1170,"y":180,"wires":[["2a6c1901f8f0f23d"]]},{"id":"2a6c1901f8f0f23d","type":"function","z":"9cf3a6d.1104258","g":"1d018eafd8bf1522","name":"Not","func":"// GCE\n// simple inverter function\n\nif(msg.payload == 1)\n{\n msg.payload = 0; \n}\nelse{\n msg.payload = 1;\n}\nnode.warn(\"relay 1 = \" + msg.payload);\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1310,"y":180,"wires":[["1e0d57267a689967"]]},{"id":"e8adc2041f58d458","type":"ui_switch","z":"9cf3a6d.1104258","g":"1d018eafd8bf1522","name":"","label":"Relais 1","tooltip":"","group":"80594882fcd06ad2","order":1,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"topic","topicType":"msg","style":"","onvalue":"1","onvalueType":"num","onicon":"","oncolor":"","offvalue":"0","offvalueType":"num","officon":"","offcolor":"","animate":false,"className":"","x":1180,"y":140,"wires":[["1e0d57267a689967"]]},{"id":"8f1fb49bcf1865c3","type":"inject","z":"9cf3a6d.1104258","g":"1d018eafd8bf1522","name":"0","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","payload":"0","payloadType":"num","x":1190,"y":100,"wires":[["1e0d57267a689967"]],"icon":"font-awesome/fa-toggle-off"},
Voila c’est un premier jet, j’ajouterais des fonctions au fur et à mesure au flow et partagerais bien sur !
@GCE Pas de souci pour intégrer dans l’image du NRX800
Par contre j’ai du couper le flow en deux à cause du message suivant :
« Une erreur est survenue : Corps is limited to 32000 characters; you entered 65979. »