Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Benzinpreis Info mit clever-tanken.de
[{"id":"de7f592f.426b4","type":"tab","label":"benzinpreise","disabled":false,"info":""},{"id":"17602fbb.76d9e","type":"html","z":"de7f592f.426b4","name":"","property":"payload","tag":"span","ret":"text","as":"single","x":610,"y":220,"wires":[["d073b7f3.18f4e","60def84f.1b22d"]]},{"id":"90a570f5.03e88","type":"inject","z":"de7f592f.426b4","name":"","topic":"tank1","payload":"","payloadType":"date","repeat":"","crontab":"00 12 * * *","once":false,"onceDelay":0.1,"x":150,"y":220,"wires":[["b2894f43.dcb4e8"]]},{"id":"b2894f43.dcb4e8","type":"http request","z":"de7f592f.426b4","name":"Bavaria Petrol - Munich","method":"GET","ret":"txt","url":"https://www.clever-tanken.de/tankstelle_details/33072","tls":"","x":390,"y":220,"wires":[["17602fbb.76d9e"]]},{"id":"d073b7f3.18f4e","type":"function","z":"de7f592f.426b4","name":"Parse Value","func":"msg.payload = msg.payload[38];\nreturn msg;","outputs":1,"noerr":0,"x":790,"y":220,"wires":[["9c0741c7.a33d58","8874821d.3c10b8"]]},{"id":"c1b8c77f.44295","type":"googlehome-notify","z":"de7f592f.426b4","server":"d167bef4.ae8af8","name":"","x":1180,"y":220,"wires":[]},{"id":"9c0741c7.a33d58","type":"function","z":"de7f592f.426b4","name":"Speak Text","func":"var now = Date();\n// JSON Antwort parsen\nvar price=JSON.parse(msg.payload);\n \n// Neue Nachricht mit Payload erstellen\nvar newMsg = { payload: \"Der aktuelle Superplus Preis beträgt \" +price + \" Euro\"};\n \n// Zurückgeben der Nachricht\nreturn [newMsg];","outputs":1,"noerr":0,"x":970,"y":220,"wires":[["c1b8c77f.44295"]]},{"id":"f3adfea3.c25b08","type":"inject","z":"de7f592f.426b4","name":"","topic":"tank2","payload":"","payloadType":"date","repeat":"","crontab":"10 12 * * *","once":false,"onceDelay":0.1,"x":150,"y":300,"wires":[["a9e51cb2.ad2068"]]},{"id":"a9e51cb2.ad2068","type":"http request","z":"de7f592f.426b4","name":"Jet Gasoline Station Munich ","method":"GET","ret":"txt","url":"https://www.clever-tanken.de/tankstelle_details/3525","tls":"","x":400,"y":300,"wires":[["17602fbb.76d9e"]]},{"id":"60def84f.1b22d","type":"debug","z":"de7f592f.426b4","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":790,"y":180,"wires":[]},{"id":"1d9966e.7a80f99","type":"comment","z":"de7f592f.426b4","name":"Benzinpreise für clever-tanken.de","info":"Clever Tanken [Benzinpreise](https://clever-tanken.de/).\nAußerdem hat clever-tanken.de auf Benzipriese für Super Plus, \nwas andere Anbieter nicht haben. ","x":600,"y":120,"wires":[]},{"id":"9773096a.e5ca38","type":"function","z":"de7f592f.426b4","name":"","func":"return {\n payload: '\"AK=hSf2O3&AT=SomeToken&C=<Token>&M=12345678_1-1_Benzinpreis: Super Plus \"' + msg.payload\n};","outputs":1,"noerr":0,"x":870,"y":380,"wires":[["edafcb42.9f9b6","a0518daa.9af9"]]},{"id":"edafcb42.9f9b6","type":"debug","z":"de7f592f.426b4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1090,"y":360,"wires":[]},{"id":"a0518daa.9af9","type":"exec","z":"de7f592f.426b4","command":"/usr/bin/curl http://ortc-developers-useast1-s0001.realtime.co/send -d ","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"Caller","x":1070,"y":420,"wires":[[],[],[]]},{"id":"8874821d.3c10b8","type":"switch","z":"de7f592f.426b4","name":"","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"1.52","vt":"str"},{"t":"lt","v":"1.50","vt":"str"},{"t":"btwn","v":"1.40","vt":"num","v2":"1.60","v2t":"num"}],"checkall":"true","repair":false,"outputs":3,"x":710,"y":420,"wires":[["9773096a.e5ca38"],["2ee8440d.5788b4"],["77aefa2d.1372ec"]]},{"id":"2ee8440d.5788b4","type":"function","z":"de7f592f.426b4","name":"","func":"return {\n payload: '\"AK=hSf2O3&AT=SomeToken&C=<Token>&M=12345678_1-1_Benzintiefpreis: Super Plus \"' + msg.payload\n};","outputs":1,"noerr":0,"x":870,"y":420,"wires":[["a0518daa.9af9"]]},{"id":"77aefa2d.1372ec","type":"function","z":"de7f592f.426b4","name":"","func":"return {\n payload: '\"AK=hSf2O3&AT=SomeToken&C=<Token>&M=12345678_1-1_Benzinpreis: Super Plus \"' + msg.payload\n};","outputs":1,"noerr":0,"x":870,"y":460,"wires":[["a0518daa.9af9"]]},{"id":"3b54b223.960eee","type":"inject","z":"de7f592f.426b4","name":"","topic":"","payload":"1.49","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":490,"y":420,"wires":[["8874821d.3c10b8"]]},{"id":"d167bef4.ae8af8","type":"googlehome-config-node","z":"","ipaddress":"192.168.10.30","language":"de"}]
@unixweb

This comment has been minimized.

Copy link
Owner Author

@unixweb unixweb commented Sep 3, 2018

Dieser Flow nutzt die Webseite clever-tanken.de um die aktuellen Benzinpreise auszulesen.
Als Beispiel habe ich https://www.clever-tanken.de/tankstelle_details/33072 eingetragen.

Folgender Node muss installiert sein:
node-red-contrib-google-home-notify

Mit Google Home werden die Benzinpreise aktuell um 12:00 Uhr per Sprachausgabe angesagt.

bildschirmfoto 2018-09-03 um 16 48 44

@unixweb

This comment has been minimized.

Copy link
Owner Author

@unixweb unixweb commented Sep 3, 2018

Zusätzlich besteht die Möglichkeit die Benzinpreise aktuell und in Echtzeit an ein Smartphone zu senden per Push Notification.
Funktioniert mit Android und iPhone.

20180903_170214

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment