NEWS
Skripten des E-Control Spritpreisrechners
-
läuft bei mir auch nicht
irgendwas machen wir falsch! -
@SmarthomeMF sagte in Skripten des E-Control Spritpreisrechners:
läuft bei mir auch nicht
hast du die DP unter javascript.0 händisch angelegt?
Geht das über den Expertenmodus und dann auf das "+"?
Wenn ja, was gehört bei Datenpunkttyp ausgewählt?
-
-
@metaxa sagte in Skripten des E-Control Spritpreisrechners:
Danke
Was gehört bei Datenpunkttyp ausgewählt?
-
@SmarthomeMF sagte in Skripten des E-Control Spritpreisrechners:
irgendwas machen wir falsch!
Glaube ich nicht, ich denke der ParserDP hat sich nicht geändert. Ihr müßt eine Änderung erzwingen!
-
@metaxa sagte in Skripten des E-Control Spritpreisrechners:
ich denke der ParserDP hat sich nicht geändert. Ihr müßt eine Änderung erzwingen!
wie
-
@Negalein sagte in Skripten des E-Control Spritpreisrechners:
Was gehört bei Datenpunkttyp ausgewählt?
-
@SmarthomeMF sagte in Skripten des E-Control Spritpreisrechners:
@metaxa sagte in Skripten des E-Control Spritpreisrechners:
ich denke der ParserDP hat sich nicht geändert. Ihr müßt eine Änderung erzwingen!
wie
Die Profis werden mich erschlagen ..... ich habe immer den Datentyp auf boolen umgeändert (so wie du es urspünglich falsch hattest) speichern, dann wurde der DP geändert, der String wieder weg. Dann wieder richtig auf JSON geändert und gespeichert, dann aktualisert er wieder. Darauf sollte dein Script reagieren.
Hm?
LG -
@metaxa sagte in Skripten des E-Control Spritpreisrechners:
Die Profis werden mich erschlagen ..... ich habe immer den Datentyp auf boolen umgeändert (so wie du es urspünglich falsch hattest) speichern, dann wurde der DP geändert, der String wieder weg. Dann wieder richtig auf JSON geändert und gespeichert, dann aktualisert er wieder. Darauf sollte dein Script reagieren.
DANKE, es funktioniert
-
@metaxa sagte in Skripten des E-Control Spritpreisrechners:
Darauf sollte dein Script reagieren.
PS: bitte melde dich, wenn du es geschafft hast, die Adresse anzeigen zu lassen.
Leider gibt es bei mir zB 2 Tankstellen, die gleich heißen, aber doch 30km auseinander sind.
Da wäre die Adresse (zumindest der Ort) sehr vorteilhaft. -
@Negalein fein!
Dann tue noch dem Kollegen "steinejo_io" ein positives Voting geben, er hat den Megaanteil daran!
LG, mxa -
@metaxa sagte in Skripten des E-Control Spritpreisrechners:
Dann tue noch dem Kollegen "steinejo_io" ein positives Voting geben, er hat den Megaanteil daran!
Logo
-
@Negalein wegen Adresse ...
hock dich mal hin und probier herum, eventuell bist schneller als ich
Hab auch nur herumgedoktert bis jetzt und mich durchgebissen
Schönen Abend von Wien nach OÖ!
LG, mxa -
@metaxa sagte in Skripten des E-Control Spritpreisrechners:
@Negalein wegen Adresse ...
hock dich mal hin und probier herumwenn ich https://api.e-control.at/sprit/1.0/search/gas-stations/by-address?latitude=XX.XXXXXX&longitude=XX.XXXXXX&fuelType=DIE&includeClosed=false im Browser öffne, bekomm ich eine Liste mit Adresse usw.!
Aber wie ich die auch in ioBroker bekomme?[{"id":1172639,"name":"SB-Tankstelle Zauner","location":{"address":"Jagern 18","postalCode":"4761","city":"Enzenkirchen","latitude":48.37648,"longitude":13.63102},"contact":{"mail":"office@auto-zauner.at","website":"http://www.auto-zauner.at"},"openingHours":[{"day":"MO","label":"Montag","order":1,"from":"06:30","to":"24:00"},{"day":"DI","label":"Dienstag","order":2,"from":"06:30","to":"24:00"},{"day":"MI","label":"Mittwoch","order":3,"from":"06:30","to":"24:00"},{"day":"DO","label":"Donnerstag","order":4,"from":"06:30","to":"24:00"},{"day":"FR","label":"Freitag","order":5,"from":"06:30","to":"24:00"},{"day":"SA","label":"Samstag","order":6,"from":"06:30","to":"24:00"},{"day":"SO","label":"Sonntag","order":7,"from":"07:00","to":"24:00"},{"day":"FE","label":"Feiertag","order":8,"from":"07:00","to":"24:00"}],"offerInformation":{"service":false,"selfService":true,"unattended":true},"paymentMethods":{"cash":true,"debitCard":true,"creditCard":false},"paymentArrangements":{"cooperative":false,"clubCard":false},"position":1,"open":true,"distance":19.410600073755752,"prices":[{"fuelType":"DIE","amount":1.147,"label":"Diesel"}]},{"id":237857,"name":"freie Tankstelle","location":{"address":"Gschaid 8","postalCode":"4723","city":"Natternbach","latitude":48.4039189,"longitude":13.6922177},"contact":{"telephone":"4972788226","mail":"office@edtmaier.com"},"openingHours":[{"day":"MO","label":"Montag","order":1,"from":"05:00","to":"24:00"},{"day":"DI","label":"Dienstag","order":2,"from":"05:00","to":"24:00"},{"day":"MI","label":"Mittwoch","order":3,"from":"05:00","to":"24:00"},{"day":"DO","label":"Donnerstag","order":4,"from":"05:00","to":"24:00"},{"day":"FR","label":"Freitag","order":5,"from":"05:00","to":"24:00"},{"day":"SA","label":"Samstag","order":6,"from":"05:00","to":"24:00"},{"day":"SO","label":"Sonntag","order":7,"from":"05:00","to":"24:00"},{"day":"FE","label":"Feiertag","order":8,"from":"05:00","to":"24:00"}],"offerInformation":{"service":false,"selfService":true,"unattended":true},"paymentMethods":{"cash":true,"debitCard":false,"creditCard":false},"paymentArrangements":{"cooperative":false,"clubCard":false},"position":2,"open":true,"distance":20.493637541852294,"prices":[{"fuelType":"DIE","amount":1.168,"label":"Diesel"}]},{"id":1446426,"name":"Turmöl Quick","location":{"address":"Hauptstraße 86","postalCode":"4092","city":"Esternberg","latitude":48.542477,"longitude":13.5834969},"contact":{"mail":"Steinkellner@doppler.at"},"openingHours":[{"day":"MO","label":"Montag","order":1,"from":"00:00","to":"24:00"},{"day":"DI","label":"Dienstag","order":2,"from":"00:00","to":"24:00"},{"day":"MI","label":"Mittwoch","order":3,"from":"00:00","to":"24:00"},{"day":"DO","label":"Donnerstag","order":4,"from":"00:00","to":"24:00"},{"day":"FR","label":"Freitag","order":5,"from":"00:00","to":"24:00"},{"day":"SA","label":"Samstag","order":6,"from":"00:00","to":"24:00"},{"day":"SO","label":"Sonntag","order":7,"from":"00:00","to":"24:00"},{"day":"FE","label":"Feiertag","order":8,"from":"00:00","to":"24:00"}],"offerInformation":{"service":false,"selfService":false,"unattended":true},"paymentMethods":{"cash":true,"debitCard":true,"creditCard":true},"paymentArrangements":{"cooperative":false,"clubCard":false},"position":3,"open":true,"distance":8.922574842048649,"prices":[{"fuelType":"DIE","amount":1.179,"label":"Diesel"}]},{"id":43946,"name":"SB-Tankstelle Zauner","location":{"address":"Ludwig-Paglstr. 1","postalCode":"4780","city":"Schärding","latitude":48.447209,"longitude":13.439305},"contact":{"website":"http://www.auto-zauner.at"},"openingHours":[{"day":"MO","label":"Montag","order":1,"from":"00:00","to":"24:00"},{"day":"DI","label":"Dienstag","order":2,"from":"00:00","to":"24:00"},{"day":"MI","label":"Mittwoch","order":3,"from":"00:00","to":"24:00"},{"day":"DO","label":"Donnerstag","order":4,"from":"00:00","to":"24:00"},{"day":"FR","label":"Freitag","order":5,"from":"00:00","to":"24:00"},{"day":"SA","label":"Samstag","order":6,"from":"00:00","to":"24:00"},{"day":"SO","label":"Sonntag","order":7,"from":"00:00","to":"24:00"},{"day":"FE","label":"Feiertag","order":8,"from":"00:00","to":"24:00"}],"offerInformation":{"service":false,"selfService":true,"unattended":true},"paymentMethods":{"cash":true,"debitCard":true,"creditCard":false},"paymentArrangements":{"cooperative":false,"clubCard":false},"position":4,"open":true,"distance":7.816478583286358,"prices":[{"fuelType":"DIE","amount":1.187,"label":"Diesel"}]},{"id":227,"name":"avanti - Sankt Florian/Inn Bundesstraße 129","location":{"address":"Bundesstrasse 129","postalCode":"4780","city":"Sankt Florian/Inn","latitude":48.43865,"longitude":13.44392},"contact":{"telephone":"800202055","fax":"800","website":"www.omv.com"},"openingHours":[{"day":"MO","label":"Montag","order":1,"from":"00:00","to":"24:00"},{"day":"DI","label":"Dienstag","order":2,"from":"00:00","to":"24:00"},{"day":"MI","label":"Mittwoch","order":3,"from":"00:00","to":"24:00"},{"day":"DO","label":"Donnerstag","order":4,"from":"00:00","to":"24:00"},{"day":"FR","label":"Freitag","order":5,"from":"00:00","to":"24:00"},{"day":"SA","label":"Samstag","order":6,"from":"00:00","to":"24:00"},{"day":"SO","label":"Sonntag","order":7,"from":"00:00","to":"24:00"},{"day":"FE","label":"Feiertag","order":8,"from":"00:00","to":"24:00"}],"offerInformation":{"service":false,"selfService":true,"unattended":true},"paymentMethods":{"cash":false,"debitCard":true,"creditCard":true,"others":"OMV STATIONSKARTE, MASTERCARD, MAESTRO, VISA"},"paymentArrangements":{"cooperative":false,"clubCard":false},"position":5,"open":true,"distance":8.64983543713606,"prices":[{"fuelType":"DIE","amount":1.187,"label":"Diesel"}]},{"id":34459,"name":"Lagerhaus Genol","location":{"address":"Otterbacherstrasse 2","postalCode":"4786","city":"Brunnenthal","latitude":48.4584665,"longitude":13.4449326},"contact":{"telephone":"4377123135","mail":"rlh_schaerding@schaerding.rlh.at"},"openingHours":[{"day":"MO","label":"Montag","order":1,"from":"00:00","to":"24:00"},{"day":"DI","label":"Dienstag","order":2,"from":"00:00","to":"24:00"},{"day":"MI","label":"Mittwoch","order":3,"from":"00:00","to":"24:00"},{"day":"DO","label":"Donnerstag","order":4,"from":"00:00","to":"24:00"},{"day":"FR","label":"Freitag","order":5,"from":"00:00","to":"24:00"},{"day":"SA","label":"Samstag","order":6,"from":"00:00","to":"24:00"},{"day":"SO","label":"Sonntag","order":7,"from":"00:00","to":"24:00"},{"day":"FE","label":"Feiertag","order":8,"from":"00:00","to":"24:00"}],"offerInformation":{"service":false,"selfService":false,"unattended":true},"paymentMethods":{"cash":false,"debitCard":false,"creditCard":false},"paymentArrangements":{"cooperative":false,"clubCard":false},"position":6,"open":true,"distance":6.496922872446322,"prices":[]},{"id":43069,"name":"IQ Tankstelle","location":{"address":"Rannariedlerstrasse 10","postalCode":"4143","city":"Neustift","latitude":48.503373,"longitude":13.755291},"contact":{"telephone":"72848116","fax":"728481164"},"openingHours":[{"day":"MO","label":"Montag","order":1,"from":"00:00","to":"24:00"},{"day":"DI","label":"Dienstag","order":2,"from":"00:00","to":"24:00"},{"day":"MI","label":"Mittwoch","order":3,"from":"00:00","to":"24:00"},{"day":"DO","label":"Donnerstag","order":4,"from":"00:00","to":"24:00"},{"day":"FR","label":"Freitag","order":5,"from":"00:00","to":"24:00"},{"day":"SA","label":"Samstag","order":6,"from":"00:00","to":"24:00"},{"day":"SO","label":"Sonntag","order":7,"from":"00:00","to":"24:00"},{"day":"FE","label":"Feiertag","order":8,"from":"00:00","to":"24:00"}],"offerInformation":{"service":false,"selfService":true,"unattended":true},"paymentMethods":{"cash":true,"debitCard":true,"creditCard":true,"others":"IQ Card"},"paymentArrangements":{"cooperative":false,"clubCard":false},"otherServiceOffers":"Diesel HL Zapfsule","position":7,"open":true,"distance":21.066170364638694,"prices":[]},{"id":247993,"name":"eni","location":{"address":"Andiesen 15","postalCode":"4774","city":"St. Marienkirchen / Schärding","latitude":48.394378,"longitude":13.427743},"contact":{"telephone":"0771133045","fax":"07711330454"},"openingHours":[{"day":"MO","label":"Montag","order":1,"from":"00:00","to":"24:00"},{"day":"DI","label":"Dienstag","order":2,"from":"00:00","to":"24:00"},{"day":"MI","label":"Mittwoch","order":3,"from":"00:00","to":"24:00"},{"day":"DO","label":"Donnerstag","order":4,"from":"00:00","to":"24:00"},{"day":"FR","label":"Freitag","order":5,"from":"00:00","to":"24:00"},{"day":"SA","label":"Samstag","order":6,"from":"00:00","to":"24:00"},{"day":"SO","label":"Sonntag","order":7,"from":"00:00","to":"24:00"},{"day":"FE","label":"Feiertag","order":8,"from":"00:00","to":"24:00"}],"offerInformation":{"service":false,"selfService":true,"unattended":false},"paymentMethods":{"cash":true,"debitCard":true,"creditCard":true,"others":"AMEX,Maestro,Diners Club,DKV,GUTS,MasterCard,Routex,UTA,VISA"},"paymentArrangements":{"cooperative":false,"clubCard":false},"position":8,"open":true,"distance":13.719939198994112,"prices":[]},{"id":448798,"name":"Shell Austria","location":{"address":"ANDIESEN 8","postalCode":"4774","city":"ST. MARIENKIRCHEN","latitude":48.39134,"longitude":13.42525},"contact":{"telephone":"077112811"},"openingHours":[{"day":"MO","label":"Montag","order":1,"from":"00:00","to":"24:00"},{"day":"DI","label":"Dienstag","order":2,"from":"00:00","to":"24:00"},{"day":"MI","label":"Mittwoch","order":3,"from":"00:00","to":"24:00"},{"day":"DO","label":"Donnerstag","order":4,"from":"00:00","to":"24:00"},{"day":"FR","label":"Freitag","order":5,"from":"00:00","to":"24:00"},{"day":"SA","label":"Samstag","order":6,"from":"00:00","to":"24:00"},{"day":"SO","label":"Sonntag","order":7,"from":"00:00","to":"24:00"},{"day":"FE","label":"Feiertag","order":8,"from":"00:00","to":"24:00"}],"offerInformation":{"service":false,"selfService":false,"unattended":false},"paymentMethods":{"cash":true,"debitCard":true,"creditCard":true},"paymentArrangements":{"cooperative":false,"clubCard":false},"position":9,"open":true,"distance":14.091531761182328,"prices":[]},{"id":448796,"name":"Shell Austria","location":{"address":"ETZELSHOFEN 125","postalCode":"4975","city":"SUBEN","latitude":48.40061,"longitude":13.42603},"contact":{"telephone":"0771131620"},"openingHours":[{"day":"MO","label":"Montag","order":1,"from":"00:00","to":"24:00"},{"day":"DI","label":"Dienstag","order":2,"from":"00:00","to":"24:00"},{"day":"MI","label":"Mittwoch","order":3,"from":"00:00","to":"24:00"},{"day":"DO","label":"Donnerstag","order":4,"from":"00:00","to":"24:00"},{"day":"FR","label":"Freitag","order":5,"from":"00:00","to":"24:00"},{"day":"SA","label":"Samstag","order":6,"from":"00:00","to":"24:00"},{"day":"SO","label":"Sonntag","order":7,"from":"00:00","to":"24:00"},{"day":"FE","label":"Feiertag","order":8,"from":"00:00","to":"24:00"}],"offerInformation":{"service":false,"selfService":false,"unattended":false},"paymentMethods":{"cash":true,"debitCard":true,"creditCard":true},"paymentArrangements":{"cooperative":false,"clubCard":false},"position":10,"open":true,"distance":13.076430377020321,"prices":[]}]
Oder meinst du was anderes?
-
@Negalein ???
Dein Parser holt die Ausgabe deiner API-URL in den ioBroker.
Das Script vom Kollegen - wurde von mir nur angepaßt - holt aus dem DP des Parsers die Namen und Preise.
Jetzt muss man das Script nur noch um die Adresse erweitern.
Glaube es mir, wenn der Erfolg mal kommt, dann machts auch Spass. Ich habe jetzt 14 Tage immer wieder daran herumgebastelt, eben weil keine Ahnung von JS. Hab die HTML Ausgabe in XLS und mit Notpade++ zerlegt um hinter die Überlegungen von "steinejo_io" zu kommen.Also, die Adresse kommt über das Script
LG, mxa
-
Schau dir das mal an was der paser auswirft.
Da steht ja alles drin!!
Das brauchst du ja nur einmal auswerten und das ändert sich nicht.
Von Adresse bis Email Telefonnummer steht da alles drin.
Mittlerweile sind bei mir nun auch die Daten der einzelnen Tankstellen da.
Perfekt Danke -
@SmarthomeMF
Gerne!
Hier gehts zum Voting für den Kollegen "steinejo_io"!
LG, mxa -
Hallo
Weil das ganze so gut geklappt habe wollte ich gleich mal weiter machen.
Da mir nur 4 Tankstellen zu wenig sind habe ich das ganze erweitert.
Im Parser String habe ich 10 Tankstellen drin stehen.
Also wollte ich sie nützen.
Im Skript erweiterton({id:'parser.0.Sprit'/*Sprit*/, change: 'any'}, function(obj) { var pricehit_01 = "undefiniert"; var pricehit_02 = "undefiniert"; var pricehit_03 = "undefiniert"; var pricehit_04 = "undefiniert"; var pricehit_05 = "undefiniert"; var pricehit_06 = "undefiniert"; var pricehit_07 = "undefiniert"; var pricehit_08 = "undefiniert"; var pricehit_09 = "undefiniert"; var pricehit_10 = "undefiniert"; var pricehit_11 = "undefiniert"; var pricehit_12 = "undefiniert"; var pricehit_13 = "undefiniert"; var pricehit_14 = "undefiniert"; var index = 0; var gasStation = JSON.parse(obj.state.val); if (gasStation.length === 0) return; for (index = 0; index < gasStation.length; ++index) { pricehit_01 = gasStation[0].name + " " + (gasStation[0].prices[0].amount).toString().replace(".",",") + " €"; pricehit_02 = gasStation[1].name + " " + (gasStation[1].prices[0].amount).toString().replace(".",",") + " €"; pricehit_03 = gasStation[2].name + " " + (gasStation[2].prices[0].amount).toString().replace(".",",") + " €"; pricehit_04 = gasStation[3].name + " " + (gasStation[3].prices[0].amount).toString().replace(".",",") + " €"; pricehit_05 = gasStation[4].name + " " + (gasStation[4].prices[0].amount).toString().replace(".",",") + " €"; pricehit_06 = gasStation[4].name + " " + (gasStation[4].prices[0].amount).toString().replace(".",",") + " €"; pricehit_07 = gasStation[4].name + " " + (gasStation[4].prices[0].amount).toString().replace(".",",") + " €"; pricehit_08 = gasStation[4].name + " " + (gasStation[4].prices[0].amount).toString().replace(".",",") + " €"; pricehit_09 = gasStation[4].name + " " + (gasStation[4].prices[0].amount).toString().replace(".",",") + " €"; pricehit_10 = gasStation[4].name + " " + (gasStation[4].prices[0].amount).toString().replace(".",",") + " €"; pricehit_11 = gasStation[4].name + " " + (gasStation[4].prices[0].amount).toString().replace(".",",") + " €"; pricehit_12 = gasStation[4].name + " " + (gasStation[4].prices[0].amount).toString().replace(".",",") + " €"; pricehit_13 = gasStation[4].name + " " + (gasStation[4].prices[0].amount).toString().replace(".",",") + " €"; pricehit_14 = gasStation[4].name + " " + (gasStation[4].prices[0].amount).toString().replace(".",",") + " €"; } setState('javascript.0.Sprit.Tankstelle_1'/*Tankstelle 1*/, pricehit_01); setState('javascript.0.Sprit.Tankstelle_2'/*Tankstelle 2*/, pricehit_02); setState('javascript.0.Sprit.Tankstelle_3'/*Tankstelle 3*/, pricehit_03); setState('javascript.0.Sprit.Tankstelle_4'/*Tankstelle 4*/, pricehit_04); setState('javascript.0.Sprit.Tankstelle_5'/*Tankstelle 5*/, pricehit_05); setState('javascript.0.Sprit.Tankstelle_6'/*Tankstelle 6*/, pricehit_06); setState('javascript.0.Sprit.Tankstelle_7'/*Tankstelle 7*/, pricehit_07); setState('javascript.0.Sprit.Tankstelle_8'/*Tankstelle 8*/, pricehit_08); setState('javascript.0.Sprit.Tankstelle_9'/*Tankstelle 9*/, pricehit_09); setState('javascript.0.Sprit.Tankstelle_10'/*Tankstelle 10*/, pricehit_10); setState('javascript.0.Sprit.Tankstelle_11'/*Tankstelle 11*/, pricehit_11); setState('javascript.0.Sprit.Tankstelle_12'/*Tankstelle 12*/, pricehit_12); setState('javascript.0.Sprit.Tankstelle_13'/*Tankstelle 13*/, pricehit_13); setState('javascript.0.Sprit.Tankstelle_14'/*Tankstelle 14*/, pricehit_14); });
Datenpunkte angelegt
Es werden aber nur die Angezeigt was schon waren!
und im Log eine menge warnjavascript.0 2019-03-31 09:29:42.153 warn at TCP.onread (net.js:601:20) javascript.0 2019-03-31 09:29:42.153 warn at Socket.Readable.push (_stream_readable.js:208:10) javascript.0 2019-03-31 09:29:42.153 warn at readableAddChunk (_stream_readable.js:250:11) javascript.0 2019-03-31 09:29:42.153 warn at addChunk (_stream_readable.js:263:12) javascript.0 2019-03-31 09:29:42.153 warn at Socket.emit (events.js:211:7) javascript.0 2019-03-31 09:29:42.153 warn at emitOne (events.js:116:13) javascript.0 2019-03-31 09:29:42.153 warn at Socket.realHandler (/opt/iobroker/node_modules/ws/lib/WebSocket.js:825:20) javascript.0 2019-03-31 09:29:42.153 warn at Receiver.add (/opt/iobroker/node_modules/ws/lib/Receiver.js:103:24) javascript.0 2019-03-31 09:29:42.153 warn at Receiver.expectHandler (/opt/iobroker/node_modules/ws/lib/Receiver.js:499:31) javascript.0 2019-03-31 09:29:42.153 warn at Receiver.finish (/opt/iobroker/node_modules/ws/lib/Receiver.js:541:12) javascript.0 2019-03-31 09:29:42.153 warn at Receiver.flush (/opt/iobroker/node_modules/ws/lib/Receiver.js:347:3) javascript.0 2019-03-31 09:29:42.153 warn at /opt/iobroker/node_modules/ws/lib/Receiver.js:508:14 javascript.0 2019-03-31 09:29:42.153 warn at Receiver.applyExtensions (/opt/iobroker/node_modules/ws/lib/Receiver.js:371:5) javascript.0 2019-03-31 09:29:42.153 warn at /opt/iobroker/node_modules/ws/lib/Receiver.js:536:18 javascript.0 2019-03-31 09:29:42.153 warn at Receiver.ontext (/opt/iobroker/node_modules/ws/lib/WebSocket.js:841:10) javascript.0 2019-03-31 09:29:42.153 warn at WebSocket.emit (events.js:214:7) javascript.0 2019-03-31 09:29:42.153 warn at emitTwo (events.js:126:13) javascript.0 2019-03-31 09:29:42.153 warn at WebSocket.onMessage (/opt/iobroker/node_modules/ws/lib/WebSocket.js:442:14) javascript.0 2019-03-31 09:29:42.153 warn at WebSocket.ws.onmessage (/opt/iobroker/node_modules/engine.io-client/lib/transports/websocket.js:146:10) javascript.0 2019-03-31 09:29:42.153 warn at WS.Transport.onData (/opt/iobroker/node_modules/engine.io-client/lib/transport.js:137:8) javascript.0 2019-03-31 09:29:42.153 warn at WS.Transport.onPacket (/opt/iobroker/node_modules/engine.io-client/lib/transport.js:145:8) javascript.0 2019-03-31 09:29:42.153 warn at WS.Emitter.emit (/opt/iobroker/node_modules/engine.io-client/node_modules/component-emitter/index.js:133:20) javascript.0 2019-03-31 09:29:42.153 warn at WS.<anonymous> (/opt/iobroker/node_modules/engine.io-client/lib/socket.js:268:10) javascript.0 2019-03-31 09:29:42.153 warn at Socket.onPacket (/opt/iobroker/node_modules/engine.io-client/lib/socket.js:451:14) javascript.0 2019-03-31 09:29:42.153 warn at Socket.Emitter.emit (/opt/iobroker/node_modules/engine.io-client/node_modules/component-emitter/index.js:133:20) javascript.0 2019-03-31 09:29:42.153 warn at Socket.<anonymous> (/opt/iobroker/node_modules/component-bind/index.js:21:15) javascript.0 2019-03-31 09:29:42.153 warn at Manager.ondata (/opt/iobroker/node_modules/socket.io-client/lib/manager.js:322:16) javascript.0 2019-03-31 09:29:42.153 warn at Decoder.add (/opt/iobroker/node_modules/socket.io-parser/index.js:246:12) javascript.0 2019-03-31 09:29:42.153 warn at Decoder.Emitter.emit (/opt/iobroker/node_modules/component-emitter/index.js:134:20) javascript.0 2019-03-31 09:29:42.153 warn at Decoder.<anonymous> (/opt/iobroker/node_modules/component-bind/index.js:21:15) javascript.0 2019-03-31 09:29:42.153 warn at Manager.ondecoded (/opt/iobroker/node_modules/socket.io-client/lib/manager.js:332:8) javascript.0 2019-03-31 09:29:42.153 warn at Manager.Emitter.emit (/opt/iobroker/node_modules/socket.io-client/node_modules/component-emitter/index.js:133:20) javascript.0 2019-03-31 09:29:42.153 warn at Manager.<anonymous> (/opt/iobroker/node_modules/component-bind/index.js:21:15) javascript.0 2019-03-31 09:29:42.152 warn at Socket.onpacket (/opt/iobroker/node_modules/socket.io-client/lib/socket.js:228:12) javascript.0 2019-03-31 09:29:42.152 warn at Socket.onevent (/opt/iobroker/node_modules/socket.io-client/lib/socket.js:270:10) javascript.0 2019-03-31 09:29:42.152 warn at Socket.Emitter.emit (/opt/iobroker/node_modules/socket.io-client/node_modules/component-emitter/index.js:133:20) javascript.0 2019-03-31 09:29:42.152 warn at Socket.<anonymous> (/opt/iobroker/node_modules/iobroker.js-controller/lib/states/statesInMemClient.js:52:30) javascript.0 2019-03-31 09:29:42.152 warn at Object.change (/opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:3705:37) javascript.0 2019-03-31 09:29:42.152 warn at Object.stateChange (/opt/iobroker/node_modules/iobroker.javascript/main.js:364:25) javascript.0 2019-03-31 09:29:42.152 warn at Object.callback (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:963:38) javascript.0 2019-03-31 09:29:42.152 warn at Object.<anonymous> (script.js.common.003_Stromverbrauch.PV_Überschuss_vers_2_1:57:57) javascript.0 2019-03-31 09:29:42.152 warn getState "javascript.0.Datenpunkte.Pool.Pumpe AN / AUS" not found (3) javascript.0 2019-03-31 09:29:42.152 warn at TCP.onread (net.js:601:20) javascript.0 2019-03-31 09:29:42.152 warn at Socket.Readable.push (_stream_readable.js:208:10) javascript.0 2019-03-31 09:29:42.152 warn at readableAddChunk (_stream_readable.js:250:11) javascript.0 2019-03-31 09:29:42.152 warn at addChunk (_stream_readable.js:263:12) javascript.0 2019-03-31 09:29:42.152 warn at Socket.emit (events.js:211:7) javascript.0 2019-03-31 09:29:42.152 warn at emitOne (events.js:116:13) javascript.0 2019-03-31 09:29:42.152 warn at Socket.realHandler (/opt/iobroker/node_modules/ws/lib/WebSocket.js:825:20) javascript.0 2019-03-31 09:29:42.152 warn at Receiver.add (/opt/iobroker/node_modules/ws/lib/Receiver.js:103:24) javascript.0 2019-03-31 09:29:42.152 warn at Receiver.expectHandler (/opt/iobroker/node_modules/ws/lib/Receiver.js:499:31) javascript.0 2019-03-31 09:29:42.152 warn at Receiver.finish (/opt/iobroker/node_modules/ws/lib/Receiver.js:541:12) javascript.0 2019-03-31 09:29:42.152 warn at Receiver.flush (/opt/iobroker/node_modules/ws/lib/Receiver.js:347:3) javascript.0 2019-03-31 09:29:42.152 warn at /opt/iobroker/node_modules/ws/lib/Receiver.js:508:14 javascript.0 2019-03-31 09:29:42.152 warn at Receiver.applyExtensions (/opt/iobroker/node_modules/ws/lib/Receiver.js:371:5) javascript.0 2019-03-31 09:29:42.152 warn at /opt/iobroker/node_modules/ws/lib/Receiver.js:536:18 javascript.0 2019-03-31 09:29:42.152 warn at Receiver.ontext (/opt/iobroker/node_modules/ws/lib/WebSocket.js:841:10) javascript.0 2019-03-31 09:29:42.152 warn at WebSocket.emit (events.js:214:7) javascript.0 2019-03-31 09:29:42.152 warn at emitTwo (events.js:126:13) javascript.0 2019-03-31 09:29:42.152 warn at WebSocket.onMessage (/opt/iobroker/node_modules/ws/lib/WebSocket.js:442:14) javascript.0 2019-03-31 09:29:42.152 warn at WebSocket.ws.onmessage (/opt/iobroker/node_modules/engine.io-client/lib/transports/websocket.js:146:10) javascript.0 2019-03-31 09:29:42.152 warn at WS.Transport.onData (/opt/iobroker/node_modules/engine.io-client/lib/transport.js:137:8) javascript.0 2019-03-31 09:29:42.152 warn at WS.Transport.onPacket (/opt/iobroker/node_modules/engine.io-client/lib/transport.js:145:8) javascript.0 2019-03-31 09:29:42.152 warn at WS.Emitter.emit (/opt/iobroker/node_modules/engine.io-client/node_modules/component-emitter/index.js:133:20) javascript.0 2019-03-31 09:29:42.152 warn at WS.<anonymous> (/opt/iobroker/node_modules/engine.io-client/lib/socket.js:268:10) javascript.0 2019-03-31 09:29:42.152 warn at Socket.onPacket (/opt/iobroker/node_modules/engine.io-client/lib/socket.js:451:14) javascript.0 2019-03-31 09:29:42.152 warn at Socket.Emitter.emit (/opt/iobroker/node_modules/engine.io-client/node_modules/component-emitter/index.js:133:20) javascript.0 2019-03-31 09:29:42.152 warn at Socket.<anonymous> (/opt/iobroker/node_modules/component-bind/index.js:21:15) javascript.0 2019-03-31 09:29:42.152 warn at Manager.ondata (/opt/iobroker/node_modules/socket.io-client/lib/manager.js:322:16) javascript.0 2019-03-31 09:29:42.152 warn at Decoder.add (/opt/iobroker/node_modules/socket.io-parser/index.js:246:12) javascript.0 2019-03-31 09:29:42.152 warn at Decoder.Emitter.emit (/opt/iobroker/node_modules/component-emitter/index.js:134:20) javascript.0 2019-03-31 09:29:42.152 warn at Decoder.<anonymous> (/opt/iobroker/node_modules/component-bind/index.js:21:15) javascript.0 2019-03-31 09:29:42.152 warn at Manager.ondecoded (/opt/iobroker/node_modules/socket.io-client/lib/manager.js:332:8) javascript.0 2019-03-31 09:29:42.152 warn at Manager.Emitter.emit (/opt/iobroker/node_modules/socket.io-client/node_modules/component-emitter/index.js:133:20) javascript.0 2019-03-31 09:29:42.152 warn at Manager.<anonymous> (/opt/iobroker/node_modules/component-bind/index.js:21:15) javascript.0 2019-03-31 09:29:42.152 warn at Socket.onpacket (/opt/iobroker/node_modules/socket.io-client/lib/socket.js:228:12) javascript.0 2019-03-31 09:29:42.152 warn at Socket.onevent (/opt/iobroker/node_modules/socket.io-client/lib/socket.js:270:10) javascript.0 2019-03-31 09:29:42.152 warn at Socket.Emitter.emit (/opt/iobroker/node_modules/socket.io-client/node_modules/component-emitter/index.js:133:20) javascript.0 2019-03-31 09:29:42.152 warn at Socket.<anonymous> (/opt/iobroker/node_modules/iobroker.js-controller/lib/states/statesInMemClient.js:52:30) javascript.0 2019-03-31 09:29:42.152 warn at Object.change (/opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:3705:37) javascript.0 2019-03-31 09:29:42.152 warn at Object.stateChange (/opt/iobroker/node_modules/iobroker.javascript/main.js:364:25) javascript.0 2019-03-31 09:29:42.152 warn at Object.callback (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:963:38) javascript.0 2019-03-31 09:29:42.152 warn at Object.<anonymous> (script.js.common.003_Stromverbrauch.PV_Überschuss_vers_2_1:11:580) javascript.0 2019-03-31 09:29:42.152 warn getState "javascript.0.Datenpunkte.Pool.Pumpe AN / AUS" not found (3) javascript.0 2019-03-31 09:29:42.152 warn at TCP.onread (net.js:601:20) javascript.0 2019-03-31 09:29:42.152 warn at Socket.Readable.push (_stream_readable.js:208:10) javascript.0 2019-03-31 09:29:42.152 warn at readableAddChunk (_stream_readable.js:250:11) javascript.0 2019-03-31 09:29:42.152 warn at addChunk (_stream_readable.js:263:12) javascript.0 2019-03-31 09:29:42.152 warn at Socket.emit (events.js:211:7) javascript.0 2019-03-31 09:29:42.152 warn at emitOne (events.js:116:13) javascript.0 2019-03-31 09:29:42.152 warn at Socket.realHandler (/opt/iobroker/node_modules/ws/lib/WebSocket.js:825:20) javascript.0 2019-03-31 09:29:42.152 warn at Receiver.add (/opt/iobroker/node_modules/ws/lib/Receiver.js:103:24) javascript.0 2019-03-31 09:29:42.152 warn at Receiver.expectHandler (/opt/iobroker/node_modules/ws/lib/Receiver.js:499:31) javascript.0 2019-03-31 09:29:42.152 warn at Receiver.finish (/opt/iobroker/node_modules/ws/lib/Receiver.js:541:12) javascript.0 2019-03-31 09:29:42.152 warn at Receiver.flush (/opt/iobroker/node_modules/ws/lib/Receiver.js:347:3) javascript.0 2019-03-31 09:29:42.152 warn at /opt/iobroker/node_modules/ws/lib/Receiver.js:508:14 javascript.0 2019-03-31 09:29:42.152 warn at Receiver.applyExtensions (/opt/iobroker/node_modules/ws/lib/Receiver.js:371:5) javascript.0 2019-03-31 09:29:42.152 warn at /opt/iobroker/node_modules/ws/lib/Receiver.js:536:18 javascript.0 2019-03-31 09:29:42.152 warn at Receiver.ontext (/opt/iobroker/node_modules/ws/lib/WebSocket.js:841:10) javascript.0 2019-03-31 09:29:42.152 warn at WebSocket.emit (events.js:214:7) javascript.0 2019-03-31 09:29:42.152 warn at emitTwo (events.js:126:13) javascript.0 2019-03-31 09:29:42.152 warn at WebSocket.onMessage (/opt/iobroker/node_modules/ws/lib/WebSocket.js:442:14) javascript.0 2019-03-31 09:29:42.151 warn at WebSocket.ws.onmessage (/opt/iobroker/node_modules/engine.io-client/lib/transports/websocket.js:146:10) javascript.0 2019-03-31 09:29:42.151 warn at WS.Transport.onData (/opt/iobroker/node_modules/engine.io-client/lib/transport.js:137:8) javascript.0 2019-03-31 09:29:42.151 warn at WS.Transport.onPacket (/opt/iobroker/node_modules/engine.io-client/lib/transport.js:145:8) javascript.0 2019-03-31 09:29:42.151 warn at WS.Emitter.emit (/opt/iobroker/node_modules/engine.io-client/node_modules/component-emitter/index.js:133:20) javascript.0 2019-03-31 09:29:42.151 warn at WS.<anonymous> (/opt/iobroker/node_modules/engine.io-client/lib/socket.js:268:10) javascript.0 2019-03-31 09:29:42.151 warn at Socket.onPacket (/opt/iobroker/node_modules/engine.io-client/lib/socket.js:451:14) javascript.0 2019-03-31 09:29:42.151 warn at Socket.Emitter.emit (/opt/iobroker/node_modules/engine.io-client/node_modules/component-emitter/index.js:133:20) javascript.0 2019-03-31 09:29:42.151 warn at Socket.<anonymous> (/opt/iobroker/node_modules/component-bind/index.js:21:15) javascript.0 2019-03-31 09:29:42.151 warn at Manager.ondata (/opt/iobroker/node_modules/socket.io-client/lib/manager.js:322:16) javascript.0 2019-03-31 09:29:42.151 warn at Decoder.add (/opt/iobroker/node_modules/socket.io-parser/index.js:246:12) javascript.0 2019-03-31 09:29:42.151 warn at Decoder.Emitter.emit (/opt/iobroker/node_modules/component-emitter/index.js:134:20) javascript.0 2019-03-31 09:29:42.151 warn at Decoder.<anonymous> (/opt/iobroker/node_modules/component-bind/index.js:21:15) javascript.0 2019-03-31 09:29:42.151 warn at Manager.ondecoded (/opt/iobroker/node_modules/socket.io-client/lib/manager.js:332:8) javascript.0 2019-03-31 09:29:42.151 warn at Manager.Emitter.emit (/opt/iobroker/node_modules/socket.io-client/node_modules/component-emitter/index.js:133:20) javascript.0 2019-03-31 09:29:42.151 warn at Manager.<anonymous> (/opt/iobroker/node_modules/component-bind/index.js:21:15) javascript.0 2019-03-31 09:29:42.151 warn at Socket.onpacket (/opt/iobroker/node_modules/socket.io-client/lib/socket.js:228:12) javascript.0 2019-03-31 09:29:42.151 warn at Socket.onevent (/opt/iobroker/node_modules/socket.io-client/lib/socket.js:270:10) javascript.0 2019-03-31 09:29:42.151 warn at Socket.Emitter.emit (/opt/iobroker/node_modules/socket.io-client/node_modules/component-emitter/index.js:133:20) javascript.0 2019-03-31 09:29:42.151 warn at Socket.<anonymous> (/opt/iobroker/node_modules/iobroker.js-controller/lib/states/statesInMemClient.js:52:30) javascript.0 2019-03-31 09:29:42.151 warn at Object.change (/opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:3705:37) javascript.0 2019-03-31 09:29:42.151 warn at Object.stateChange (/opt/iobroker/node_modules/iobroker.javascript/main.js:364:25) javascript.0 2019-03-31 09:29:42.151 warn at Object.callback (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:963:38) javascript.0 2019-03-31 09:29:42.150 warn at Object.<anonymous> (script.js.common.003_Stromverbrauch.PV_Überschuss_vers_2_1:11:317) javascript.0 2019-03-31 09:29:42.150 warn getState "javascript.0.Datenpunkte.Pool.Pumpe AN / AUS" not found (3) javascript.0 2019-03-31 09:29:42.150 warn at TCP.onread (net.js:601:20) javascript.0 2019-03-31 09:29:42.150 warn at Socket.Readable.push (_stream_readable.js:208:10) javascript.0 2019-03-31 09:29:42.150 warn at readableAddChunk (_stream_readable.js:250:11) javascript.0 2019-03-31 09:29:42.150 warn at addChunk (_stream_readable.js:263:12) javascript.0 2019-03-31 09:29:42.150 warn at Socket.emit (events.js:211:7) javascript.0 2019-03-31 09:29:42.150 warn at emitOne (events.js:116:13) javascript.0 2019-03-31 09:29:42.150 warn at Socket.realHandler (/opt/iobroker/node_modules/ws/lib/WebSocket.js:825:20) javascript.0 2019-03-31 09:29:42.150 warn at Receiver.add (/opt/iobroker/node_modules/ws/lib/Receiver.js:103:24) javascript.0 2019-03-31 09:29:42.150 warn at Receiver.expectHandler (/opt/iobroker/node_modules/ws/lib/Receiver.js:499:31) javascript.0 2019-03-31 09:29:42.150 warn at Receiver.finish (/opt/iobroker/node_modules/ws/lib/Receiver.js:541:12) javascript.0 2019-03-31 09:29:42.150 warn at Receiver.flush (/opt/iobroker/node_modules/ws/lib/Receiver.js:347:3) javascript.0 2019-03-31 09:29:42.150 warn at /opt/iobroker/node_modules/ws/lib/Receiver.js:508:14 javascript.0 2019-03-31 09:29:42.150 warn at Receiver.applyExtensions (/opt/iobroker/node_modules/ws/lib/Receiver.js:371:5) javascript.0 2019-03-31 09:29:42.150 warn at /opt/iobroker/node_modules/ws/lib/Receiver.js:536:18 javascript.0 2019-03-31 09:29:42.150 warn at Receiver.ontext (/opt/iobroker/node_modules/ws/lib/WebSocket.js:841:10) javascript.0 2019-03-31 09:29:42.150 warn at WebSocket.emit (events.js:214:7) javascript.0 2019-03-31 09:29:42.150 warn at emitTwo (events.js:126:13) javascript.0 2019-03-31 09:29:42.150 warn at WebSocket.onMessage (/opt/iobroker/node_modules/ws/lib/WebSocket.js:442:14) javascript.0 2019-03-31 09:29:42.150 warn at WebSocket.ws.onmessage (/opt/iobroker/node_modules/engine.io-client/lib/transports/websocket.js:146:10) javascript.0 2019-03-31 09:29:42.150 warn at WS.Transport.onData (/opt/iobroker/node_modules/engine.io-client/lib/transport.js:137:8) javascript.0 2019-03-31 09:29:42.150 warn at WS.Transport.onPacket (/opt/iobroker/node_modules/engine.io-client/lib/transport.js:145:8) javascript.0 2019-03-31 09:29:42.150 warn at WS.Emitter.emit (/opt/iobroker/node_modules/engine.io-client/node_modules/component-emitter/index.js:133:20) javascript.0 2019-03-31 09:29:42.150 warn at WS.<anonymous> (/opt/iobroker/node_modules/engine.io-client/lib/socket.js:268:10) javascript.0 2019-03-31 09:29:42.150 warn at Socket.onPacket (/opt/iobroker/node_modules/engine.io-client/lib/socket.js:451:14) javascript.0 2019-03-31 09:29:42.150 warn at Socket.Emitter.emit (/opt/iobroker/node_modules/engine.io-client/node_modules/component-emitter/index.js:133:20) javascript.0 2019-03-31 09:29:42.150 warn at Socket.<anonymous> (/opt/iobroker/node_modules/component-bind/index.js:21:15) javascript.0 2019-03-31 09:29:42.150 warn at Manager.ondata (/opt/iobroker/node_modules/socket.io-client/lib/manager.js:322:16) javascript.0 2019-03-31 09:29:42.150 warn at Decoder.add (/opt/iobroker/node_modules/socket.io-parser/index.js:246:12) javascript.0 2019-03-31 09:29:42.150 warn at Decoder.Emitter.emit (/opt/iobroker/node_modules/component-emitter/index.js:134:20) javascript.0 2019-03-31 09:29:42.150 warn at Decoder.<anonymous> (/opt/iobroker/node_modules/component-bind/index.js:21:15) javascript.0 2019-03-31 09:29:42.150 warn at Manager.ondecoded (/opt/iobroker/node_modules/socket.io-client/lib/manager.js:332:8) javascript.0 2019-03-31 09:29:42.150 warn at Manager.Emitter.emit (/opt/iobroker/node_modules/socket.io-client/node_modules/component-emitter/index.js:133:20) javascript.0 2019-03-31 09:29:42.150 warn at Manager.<anonymous> (/opt/iobroker/node_modules/component-bind/index.js:21:15) javascript.0 2019-03-31 09:29:42.150 warn at Socket.onpacket (/opt/iobroker/node_modules/socket.io-client/lib/socket.js:228:12) javascript.0 2019-03-31 09:29:42.150 warn at Socket.onevent (/opt/iobroker/node_modules/socket.io-client/lib/socket.js:270:10) javascript.0 2019-03-31 09:29:42.150 warn at Socket.Emitter.emit (/opt/iobroker/node_modules/socket.io-client/node_modules/component-emitter/index.js:133:20) javascript.0 2019-03-31 09:29:42.150 warn at Socket.<anonymous> (/opt/iobroker/node_modules/iobroker.js-controller/lib/states/statesInMemClient.js:52:30) javascript.0 2019-03-31 09:29:42.150 warn at Object.change (/opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:3705:37) javascript.0 2019-03-31 09:29:42.150 warn at Object.stateChange (/opt/iobroker/node_modules/iobroker.javascript/main.js:364:25) javascript.0 2019-03-31 09:29:42.150 warn at Object.callback (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:963:38) javascript.0 2019-03-31 09:29:42.150 warn at Object.<anonymous> (script.js.common.003_Stromverbrauch.PV_Überschuss_vers_2_1:11:52) javascript.0 2019-03-31 09:29:42.150 warn getState "javascript.0.Datenpunkte.Pool.Pumpe AN / AUS" not found (3)
Was heist das?
-
@SmarthomeMF sagte in Skripten des E-Control Spritpreisrechners:
Im Parser String habe ich 10 Tankstellen drin stehen.
Morgääähn!
Warum machst du dann 14 Felder, im Script und als Datenpunkte?
Vergleiche mal die Scriptzeilenlogik 23-27 mit deinen neuen Zeilen 28-36!
Sowie gestern Abend, Script dazu veranlaßt dass es neu ausliest?@SmarthomeMF sagte in Skripten des E-Control Spritpreisrechners:
Was heist das?
Keine Ahnung, aber da steht in der ältersten Zeile etwas von einer Pool.Pumpe.
LG, mxa
P.S.: Haben alle Tankstellen offen? Ich weiß nicht was passiert wenn die Tankstellen geschlossen haben und du in deiner URL die geschlossenen Stellen nicht angezeigt haben willst. Aber irgendwelche 10 Stk. werden wohl schon offen haben.
-
Sodala, hier nun mit jeweiliger Adresse, vielleicht kanns jemand brauchen:
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // START SETUP: // finaler Inhalt der Datenpunkte: // 1 = name_preis | 2 = name_preis_plz_ort_strasse | 3 = (id_Preis_xx) name_preis & (id_Adresse_xx) PLZ_Ort_Strasse var InhaltDP = 2; // Datenpunktadressen vollständig eintragen (z.B."javascript.0.Aktueller_Spritpreis_01"), müssen manuell erstellt werden var id_Preis_01 = ""; var id_Preis_02 = ""; var id_Preis_03 = ""; var id_Preis_04 = ""; var id_Preis_05 = ""; // Achtung, wurde oben bei "InhaltDP" 3 ausgewählt (Daten in 2 Felder gesplittet), dann müssen folgende Felder befüllt werden! // Datenpunktadressen vollständig eintragen (z.B."javascript.0.Aktueller_Spritpreis_Adresse_01"), müssen manuell erstellt werden var id_Adresse_01 = ""; var id_Adresse_02 = ""; var id_Adresse_03 = ""; var id_Adresse_04 = ""; var id_Adresse_05 = ""; // Ende Setup ////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////// // Eigentliches Script, ab hier nichts mehr ändern on({id: "parser.0.Spritpreisrechner"/*Spritpreisrechner*/, change: 'any'}, function(obj) { // Variablen werden mit "" als objekt(string) deklariert, ohne "" als number: var pricehit_01 = "undefiniert"; var pricehit_address_01 = "undefiniert"; var pricehit_02 = "undefiniert"; var pricehit_address_02 = "undefiniert"; var pricehit_03 = "undefiniert"; var pricehit_address_03 = "undefiniert"; var pricehit_04 = "undefiniert"; var pricehit_address_04 = "undefiniert"; var pricehit_05 = "undefiniert"; var pricehit_address_05 = "undefiniert"; var index = 0; var gasStation = JSON.parse(obj.state.val); if (gasStation.length === 0) return; for (index = 0; index < gasStation.length; ++index) { // Variablen werden befüllt: pricehit_01 = gasStation[0].name + " € " + (gasStation[0].prices[0].amount).toString().replace(".",","); pricehit_address_01 = (gasStation[0].location.postalCode) + " " + (gasStation[0].location.city) + ", " + (gasStation[0].location.address); pricehit_02 = gasStation[1].name + " € " + (gasStation[1].prices[0].amount).toString().replace(".",","); pricehit_address_02 = (gasStation[1].location.postalCode) + " " + (gasStation[1].location.city) + ", " + (gasStation[1].location.address); pricehit_03 = gasStation[2].name + " € " + (gasStation[2].prices[0].amount).toString().replace(".",","); pricehit_address_03 = (gasStation[2].location.postalCode) + " " + (gasStation[2].location.city) + ", " + (gasStation[2].location.address); pricehit_04 = gasStation[3].name + " € " + (gasStation[3].prices[0].amount).toString().replace(".",","); pricehit_address_04 = (gasStation[3].location.postalCode) + " " + (gasStation[3].location.city) + ", " + (gasStation[3].location.address); pricehit_05 = gasStation[4].name + " € " + (gasStation[4].prices[0].amount).toString().replace(".",","); pricehit_address_05 = (gasStation[4].location.postalCode) + " " + (gasStation[4].location.city) + ", " + (gasStation[4].location.address); } if (InhaltDP == 1) { //Name und Preis setState(id_Preis_01, pricehit_01); setState(id_Preis_02, pricehit_02); setState(id_Preis_03, pricehit_03); setState(id_Preis_04, pricehit_04); setState(id_Preis_05, pricehit_05); } if (InhaltDP == 2) { //Name, Preis und Adresse setState(id_Preis_01, pricehit_01 + " - " + pricehit_address_01); setState(id_Preis_02, pricehit_02 + " - " + pricehit_address_02); setState(id_Preis_03, pricehit_03 + " - " + pricehit_address_03); setState(id_Preis_04, pricehit_04 + " - " + pricehit_address_04); setState(id_Preis_05, pricehit_05 + " - " + pricehit_address_05); } if (InhaltDP == 3) { //1.Feld: Name, Preis 2.Feld: Adresse setState(id_Preis_01, pricehit_01); setState(id_Preis_02, pricehit_02); setState(id_Preis_03, pricehit_03); setState(id_Preis_04, pricehit_04); setState(id_Preis_05, pricehit_05); setState(id_Adresse_01, pricehit_address_01); setState(id_Adresse_02, pricehit_address_02); setState(id_Adresse_03, pricehit_address_03); setState(id_Adresse_04, pricehit_address_04); setState(id_Adresse_05, pricehit_address_05); } log('Ende Spritvergleich'); });
Schönen Restsonntag noch!
LG, mxaEdit_01: Optische Korrekturen durchgeführt