C'est les " " qui coincent apparemment, parce que si je met
Code : Tout sélectionner
os.execute('curl http://192.168.0.239/control?cmd=NEXTION,dim=0')
Code : Tout sélectionner
os.execute('curl http://192.168.0.239/control?cmd=NEXTION,dim=0')
Code : Tout sélectionner
[{"id":"14f70b4b.e94195","type":"inject","z":"2f771b7c.94cf14","name":"Timer 1 hour","topic":"","payload":"","payloadType":"date","repeat":"3600","crontab":"","once":false,"x":160,"y":100,"wires":[["12bd3c29.f55994"]]},{"id":"12bd3c29.f55994","type":"wunderground","z":"2f771b7c.94cf14","name":"Meteo Rennes","lon":"","lat":"","city":"Rennes","country":"FRANCE","x":400,"y":100,"wires":[["848d6cac.1fde7","a1689ec3.6d77b","b1990637.b27798","89bbe858.633928"]]},{"id":"e7d3cb62.2b2d88","type":"debug","z":"2f771b7c.94cf14","name":"","active":true,"console":"false","complete":"true","x":830,"y":420,"wires":[]},{"id":"a1689ec3.6d77b","type":"function","z":"2f771b7c.94cf14","name":"Wind","func":"msg.payload = msg.payload.windspeed;\n\nvar url = \"192.168.1.103/control?cmd=NEXTION,wind.txt=\"+\"\\\"\"+msg.payload+\" km/h\"+\"\\\"\"; \n\nmsg.url = url;\n\nreturn msg;\n\n \n \n","outputs":1,"noerr":0,"x":590,"y":200,"wires":[["3636ad4b.0e0502"]]},{"id":"df568350.84e45","type":"http request","z":"2f771b7c.94cf14","name":"Weather","method":"GET","ret":"txt","url":"","tls":"","x":740,"y":140,"wires":[["220130fd.de49a"]]},{"id":"89da86bc.890078","type":"mqtt in","z":"2f771b7c.94cf14","name":"/Weather/Boot","topic":"/Weather/Boot","qos":"2","broker":"ee5c6b61.551468","x":160,"y":160,"wires":[["12bd3c29.f55994","1c1b9e51.07aed2"]]},{"id":"f2ccec2a.8d233","type":"moment","z":"2f771b7c.94cf14","name":"Date","topic":"","input":"","inputType":"date","inTz":"Europe/Paris","adjAmount":"0","adjType":"hours","adjDir":"add","format":"DD/MM","locale":"fr_FR","output":"","outputType":"msg","outTz":"Europe/Paris","x":350,"y":440,"wires":[["24d68c95.9ceb54"]]},{"id":"1f1498ba.019c67","type":"inject","z":"2f771b7c.94cf14","name":"Time 1 min","topic":"","payload":"","payloadType":"date","repeat":"60","crontab":"","once":false,"x":170,"y":420,"wires":[["76d4afe7.f69b9","f2ccec2a.8d233"]]},{"id":"74cd1a50.43b774","type":"http request","z":"2f771b7c.94cf14","name":"Date","method":"GET","ret":"txt","url":"","tls":"","x":650,"y":440,"wires":[["e7d3cb62.2b2d88"]]},{"id":"24d68c95.9ceb54","type":"function","z":"2f771b7c.94cf14","name":"Url Date","func":"var url = \"192.168.1.103/control?cmd=NEXTION,date.txt=\"+\"\\\"\"+msg.payload+\"\\\"\"; \n\nmsg.url = url;\n\nreturn msg;\n","outputs":1,"noerr":0,"x":500,"y":440,"wires":[["74cd1a50.43b774"]]},{"id":"3636ad4b.0e0502","type":"http request","z":"2f771b7c.94cf14","name":"Wind","method":"GET","ret":"txt","url":"","tls":"","x":730,"y":200,"wires":[["183208f4.5f5437"]]},{"id":"183208f4.5f5437","type":"debug","z":"2f771b7c.94cf14","name":"Wind","active":true,"console":"false","complete":"true","x":870,"y":200,"wires":[]},{"id":"220130fd.de49a","type":"debug","z":"2f771b7c.94cf14","name":"Weather","active":true,"console":"false","complete":"true","x":880,"y":140,"wires":[]},{"id":"848d6cac.1fde7","type":"debug","z":"2f771b7c.94cf14","name":"Weather","active":true,"console":"true","complete":"payload","x":890,"y":100,"wires":[]},{"id":"76d4afe7.f69b9","type":"moment","z":"2f771b7c.94cf14","name":"Time","topic":"","input":"","inputType":"date","inTz":"Europe/Paris","adjAmount":"0","adjType":"hours","adjDir":"add","format":"HH:mm","locale":"en","output":"payload","outputType":"msg","outTz":"Europe/Paris","x":350,"y":400,"wires":[["5f6d277b.6bc488"]]},{"id":"92dd62f5.22afb","type":"http request","z":"2f771b7c.94cf14","name":"Time","method":"POST","ret":"txt","url":"","tls":"","x":650,"y":396,"wires":[["e7d3cb62.2b2d88"]]},{"id":"5f6d277b.6bc488","type":"function","z":"2f771b7c.94cf14","name":"Url Time","func":"var url = \"192.168.1.103/control?cmd=NEXTION,time.txt=\"+\"\\\"\"+msg.payload+\"\\\"\"; \n\nmsg.url = url;\n\nreturn msg;\n","outputs":1,"noerr":0,"x":500,"y":400,"wires":[["92dd62f5.22afb"]]},{"id":"1c1b9e51.07aed2","type":"http request","z":"2f771b7c.94cf14","name":"Exterieure","method":"GET","ret":"txt","url":"192.168.1.200:8080/json.htm?type=devices&rid=39","tls":"","x":416,"y":298,"wires":[["5647e320.2d28fc"]]},{"id":"adec7e3.174738","type":"inject","z":"2f771b7c.94cf14","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":226,"y":298,"wires":[["1c1b9e51.07aed2"]]},{"id":"f3a8e1b0.4cbc5","type":"debug","z":"2f771b7c.94cf14","name":"","active":true,"console":"true","complete":"payload","x":886,"y":298,"wires":[]},{"id":"5647e320.2d28fc","type":"json","z":"2f771b7c.94cf14","name":"","x":576,"y":298,"wires":[["d95664f1.d285c8"]]},{"id":"d95664f1.d285c8","type":"function","z":"2f771b7c.94cf14","name":"Url Data","func":"msg.payload = msg.payload.result[0].Data\n\nvar url = \"192.168.1.103/control?cmd=NEXTION,ext.txt=\"+\"\\\"\"+msg.payload+\" C\"+\"\\\"\"; \n\nmsg.url = url;\n\nreturn msg;\n\n","outputs":1,"noerr":0,"x":726,"y":298,"wires":[["f3a8e1b0.4cbc5"]]},{"id":"aa5530f5.1881e","type":"comment","z":"2f771b7c.94cf14","name":"Diffusion date et heure","info":"","x":180,"y":360,"wires":[]},{"id":"d0c7d23a.708c7","type":"comment","z":"2f771b7c.94cf14","name":"Diffusion Icone temp et vent","info":"","x":180,"y":40,"wires":[]},{"id":"948d07a1.4fefe8","type":"comment","z":"2f771b7c.94cf14","name":"Rediffusion temp ext boot","info":"","x":148,"y":240,"wires":[]},{"id":"815c7b1f.f20978","type":"mqtt in","z":"2f771b7c.94cf14","name":"","topic":"domoticz/out","qos":"2","broker":"9cfd8918.1fdad8","x":170,"y":580,"wires":[["1b536365.aabdad"]]},{"id":"2d9807f5.bf6428","type":"debug","z":"2f771b7c.94cf14","name":"","active":true,"console":"false","complete":"payload","x":907,"y":574,"wires":[]},{"id":"1b536365.aabdad","type":"json","z":"2f771b7c.94cf14","name":"","x":350,"y":580,"wires":[["fa846967.7f85a8","de0b8f44.c3517"]]},{"id":"d77c8a13.014598","type":"mqtt out","z":"2f771b7c.94cf14","name":"","topic":"","qos":"","retain":"","broker":"9cfd8918.1fdad8","x":689,"y":573,"wires":[]},{"id":"fa846967.7f85a8","type":"function","z":"2f771b7c.94cf14","name":"Temperature","func":"msg.topic = \"domoticz/out/\"+msg.payload.name+\"/Temperature\";\n\nif (msg.payload.dtype === \"Temp + Humidity\") \n{\nmsg.payload = msg.payload.svalue1\nreturn msg;\n}\nelse if (msg.payload.dtype === \"Temp\")\n{\nmsg.payload = msg.payload.svalue1\nreturn msg;\n}\n\n\n","outputs":1,"noerr":0,"x":530,"y":520,"wires":[["d77c8a13.014598","2d9807f5.bf6428"]]},{"id":"ad4cb8c6.32aca8","type":"comment","z":"2f771b7c.94cf14","name":"Temperature et humidity","info":"In this example the IDX in the switch node is \nrepublished to a topic named domoticz/out/[devicename]\nthe repub function translate value 1 to ON","x":219,"y":514,"wires":[]},{"id":"de0b8f44.c3517","type":"function","z":"2f771b7c.94cf14","name":"Humidity","func":"msg.topic = \"domoticz/out/\"+msg.payload.name+\"/Humidity\";\n\nif (msg.payload.dtype === \"Temp + Humidity\") \n{\nmsg.payload = msg.payload.svalue2\nreturn msg;\n}\n\n","outputs":1,"noerr":0,"x":520,"y":640,"wires":[["d77c8a13.014598","2d9807f5.bf6428"]]},{"id":"b1990637.b27798","type":"function","z":"2f771b7c.94cf14","name":"Send txt Dz","func":"//var pwJSON = JSON.parse(msg.payload.weather);\nmsg.url = \"http://192.168.1.200:8080/json.htm?type=command¶m=udevice&idx=177&nvalue=0&svalue=\"+msg.payload.weather;\nreturn msg;","outputs":1,"noerr":0,"x":590,"y":40,"wires":[["8960e300.56bae"]]},{"id":"8960e300.56bae","type":"http request","z":"2f771b7c.94cf14","name":"Http","method":"GET","ret":"txt","url":"","tls":"","x":730,"y":40,"wires":[["848d6cac.1fde7"]]},{"id":"89bbe858.633928","type":"function","z":"2f771b7c.94cf14","name":"Weather","func":"//msg.payload = msg.payload.weather;\n\nvar str = String(msg.payload.weather);\n\n// retourne -1 quand trouve pas, > -1 si il contient le mot, 0 si c'est exact\nif ((msg.payload = str.indexOf(\"Clear\") === 0) || (msg.payload = str.indexOf(\"Sunny\") === 0))\n{\nvar url= \"http://192.168.1.103/control?cmd=NEXTION,q0.picc=1\";\n}\n\nelse if ((msg.payload = str.indexOf(\"Overcast\") === 0) || (msg.payload = str.indexOf(\"Cloudy\") === 0))\n{\nvar url= \"http://192.168.1.103/control?cmd=NEXTION,q0.picc=2\";\n}\nelse if ((msg.payload = str.indexOf(\"Sunny\") > 1) || (msg.payload = str.indexOf(\"Cloud\") > 1))\n{\nvar url= \"http://192.168.1.103/control?cmd=NEXTION,q0.picc=3\";\n}\nelse if ((msg.payload = str.indexOf(\"Rain\") > -1) || (msg.payload = str.indexOf(\"Drizzle\") > -1))\n{\nvar url= \"http://192.168.1.103/control?cmd=NEXTION,q0.picc=5\";\n}\nelse if ((msg.payload = str.indexOf(\"Fog\") > -1))\n{\nvar url= \"http://192.168.1.103/control?cmd=NEXTION,q0.picc=6\";\n}\nelse\n{\nvar url= \"http://192.168.1.103/control?cmd=NEXTION,q0.picc=4\" ;\n}\n\nmsg.url = url;\n\nreturn msg;\n","outputs":"1","noerr":0,"x":580,"y":140,"wires":[["df568350.84e45"]]},{"id":"ee5c6b61.551468","type":"mqtt-broker","z":"","broker":"192.168.1.200","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"15","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""},{"id":"9cfd8918.1fdad8","type":"mqtt-broker","z":"","broker":"192.168.1.200","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"15","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""}]En fait il faut copier le charabia, import => clipboard et la c'est du node-reddokho a écrit :Merci.
Je vais essayer de voir ce que je peux faire de ça ... car là c'est du chinois pour moi
Oui bien sur, si tu testes cela, ca marche :J'ai vu dans l'editeur NEXTION qu'il était possible de créer plusieurs page: sais si ESP Easy gère les multiples pages ?
Code : Tout sélectionner
http://192.168.1.103/control?cmd=NEXTION,page0.ext.txt="Oui"Ok ça j'avais trouvé, mais par exemple: comment afficher la page 1 via une requête http ?Jeff a écrit :Oui bien sur, si tu testes cela, ca marche :Code : Tout sélectionner
http://192.168.1.103/control?cmd=NEXTION,page0.ext.txt="Oui"
Code : Tout sélectionner
http://192.168.0.239/control?cmd=NEXTION,page1.txtpage1.txt="page1"Passer le vscope de local à global.dokho a écrit :[EDIT]
Je viens de tester en ajoutant des boutons pour passer d'une page à l'heure.
Ca fonctionne, par contre le texte affiché ne reste pas en mémoire ... ex: si j'affiche (via une requête http) "hello world" sur la page 0 et que je vais sur la page 1, quand je reviens sur la page 0 "hello world" n’apparaît plus
Code : Tout sélectionner
txtpage1.txt=page1
click tonbuttonquivapage1,1