NEWS
Erste Schritte
-
Ziel ist es Werte aus einem E-Mail in IOBROKER JavaScript variable zu schreiben.
In meinem Beispiel bekomme ich jede Stunde eine E-Mail des aktuellen Stromzählers.
Ich bekomme den Text als ganzes vom E-Mail in den Debugging Kasten.
Text ist wie folgt:
Ablesedatum: 11.11.2015 23:05 1 Zaehler: Bezug Tarif 0: 4786,60 KWh Tarif 1: 4786,60 KWh Tarif 2: 0,00 KWh 2 Zaehler: Ruecklieferung Tarif 0: 4527,20 KWh Tarif 1: 4527,20 KWh Tarif 2: 0,00 KWh __________________________________________ MeterHomeServer: v004d Grund: unknown (0x00) WD-v1.1.0
Mein bisher geschriebenes Node red Modul ist wie folgt
[{"id":"2babe3fd.d4541c","type":"e-mail in","name":"arcor","server":"imap.arcor.de","port":"993","box":"INBOX","repeat":"10","x":188,"y":254,"z":"e236ea66.1dc918","wires":[["99b3dfa3.664c2","2407fce8.dbf804","3ae90de0.c516f2","23b10a71.dc4ef6"]]},{"id":"78bc2a3f.8743d4","type":"debug","name":"","active":true,"console":"false","complete":"false","x":862,"y":272,"z":"e236ea66.1dc918","wires":[]},{"id":"99b3dfa3.664c2","type":"function","name":"Werte aufteilen","func":"var str = msg.payload;\nvar parts = str.split(':');\nif (str[0] == \"Tarif\") {\n // Analyse it.\n}","outputs":1,"noerr":0,"x":454,"y":260,"z":"e236ea66.1dc918","wires":[["78bc2a3f.8743d4"]]},{"id":"2407fce8.dbf804","type":"html","name":"HTML -> Text","tag":"","ret":"text","as":"single","x":488,"y":323,"z":"e236ea66.1dc918","wires":[["6b809ec6.947f6"]]},{"id":"6b809ec6.947f6","type":"debug","name":"","active":true,"console":"false","complete":"false","x":807,"y":330,"z":"e236ea66.1dc918","wires":[]},{"id":"3ae90de0.c516f2","type":"debug","name":"","active":true,"console":"false","complete":"false","x":470,"y":166,"z":"e236ea66.1dc918","wires":[]},{"id":"23b10a71.dc4ef6","type":"ioBroker out","name":"","topic":"","ack":"false","autoCreate":"false","x":849,"y":186,"z":"e236ea66.1dc918","wires":[]}]
Ich möchte aber folgende Werte in je einer variablen haben.
1. Das Ablesedatum als 11.11.2015 23:05
2. Den Wert hinter "Bezug Tarif 0:" also 4786,60
3. Den Wert hinter "Ruecklieferung Tarif 0:" also 4527,20
Kann mir da jemand helfen? Ich bin zu blöde
212_e-mail.jpg