thank you, I found this solution
[{"id":"d7825a7.be8c4a8","type":"inject","z":"386a07c8.b31678","name":"","props":[{"p":"payload"}],"repeat":"1","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1000","payloadType":"num","x":180,"y":520,"wires":[["6fd0fc36.1f6cc4"]]},{"id":"1483b2e3.824cad","type":"function","z":"386a07c8.b31678","name":"","func":"var inputVal = msg.payload;\n \nvar d = new Date();\nvar datetime =(\"0\" + d.getDate()).slice(-2) + \"-\" + (\"0\"+(d.getMonth()+1)).slice(-2) + \"-\" +\n d.getFullYear() + \" \" + (\"0\" + d.getHours()).slice(-2) + \":\" + (\"0\" + d.getMinutes()).slice(-2)+ \":\" + (\"0\" + d.getSeconds()).slice(-2);\n\t\n\tvar minutes=(\"0\" + d.getMinutes()).slice(-2);\n \n context.etat=context.etat || 5;\n \n\tif(minutes=='10' && context.etat=='5'){\n\t var savedVal = flow.get('energyVal')||0;\n\t flow.set(\"energyVal\",0); \n\t msg.topic=\"save\";\n\t msg.payload = savedVal;\n\t //etat=false;\n\t \n\t context.etat='1';\nreturn msg;\n\t}\n\telse{\n\t if(minutes!='10'){\n\t //etat=true;\n\t // flow.set(\"etatVal\",true); \n\t context.etat='5';\n\t }\n\t \n\t msg.topic=\"calcul\";\n\t var savedVal = flow.get('energyVal')||0;\nsavedVal += inputVal;\nflow.set(\"energyVal\",savedVal);\nmsg.payload = savedVal;\ncontext.etat=context.etat;\nreturn msg;\n\t}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":540,"y":580,"wires":[["8f9625c7.1f7d08"]]},{"id":"8f9625c7.1f7d08","type":"switch","z":"386a07c8.b31678","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"save","vt":"str"},{"t":"eq","v":"calcul","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":690,"y":520,"wires":[["3ec8fb92.fa51b4"],["a4417010.4633"]]},{"id":"3ec8fb92.fa51b4","type":"debug","z":"386a07c8.b31678","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":850,"y":440,"wires":[]},{"id":"a4417010.4633","type":"debug","z":"386a07c8.b31678","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":890,"y":560,"wires":[]},{"id":"6fd0fc36.1f6cc4","type":"watt2kwh","z":"386a07c8.b31678","format":"kwh","maximum":"60","maximumunit":"mins","name":"","x":380,"y":460,"wires":[["1483b2e3.824cad"]]}]