HGlab01 / ioBroker.fuelpricemonitor

Fuel Price Monitor Austria
MIT License
8 stars 6 forks source link

Falsche Daten über API (--> include the choice for opened or closed once) #407

Closed jack-blackson closed 2 years ago

jack-blackson commented 2 years ago

Ich erhalte aktuell falsche Daten über den Adapter - es wird mir ein Preis (zu niedrig) angezeigt, der nicht mehr gültig ist. Adapter hab ich schon neu gestartet, und auch über Debug laufen lassen, er aktualisiert auch, aber es scheint ein Problem im JSON zu geben - vermute also das Problem liegt beim Anbieter der Daten.

So sehen die Daten auf spritpreisrechner.at aus:

image

Und so mein Objekt: image

Wenn ich den Debug Mode laufen lasse und das JSON des daraus entstehenden LInks im Browser () exportiere schaut es so aus:

[{"id":1474169,"name":"eni","location":{"address":"Rheinstrasse 4","postalCode":"6900","city":"Bregenz","latitude":47.4985,"longitude":9.73258},"contact":{"telephone":"0557443760","fax":"05574437604"},"openingHours":[{"day":"MO","label":"Montag","order":1,"from":"00:00","to":"00:00"},{"day":"DI","label":"Dienstag","order":2,"from":"00:00","to":"00:00"},{"day":"MI","label":"Mittwoch","order":3,"from":"00:00","to":"00:00"},{"day":"DO","label":"Donnerstag","order":4,"from":"00:00","to":"00:00"},{"day":"FR","label":"Freitag","order":5,"from":"00:00","to":"00:00"},{"day":"SA","label":"Samstag","order":6,"from":"00:00","to":"00:00"},{"day":"SO","label":"Sonntag","order":7,"from":"00:00","to":"00:00"},{"day":"FE","label":"Feiertag","order":8,"from":"00:00","to":"00:00"}],"offerInformation":{"service":false,"selfService":true,"unattended":false},"paymentMethods":{"cash":true,"debitCard":true,"creditCard":true,"others":"AMEX,Maestro,Diners Club,DKV,GUTS,LOGP,MasterCard,Routex,euroShell Card,UTA,VISA"},"paymentArrangements":{"cooperative":false,"clubCard":false},"position":1,"open":false,"distance":2.068175657512824,"prices":[{"fuelType":"SUP","amount":1.719,"label":"Super 95"}]},{"id":1469666,"name":"BayWa Tankstelle","location":{"address":"Scheibenstraße 2","postalCode":"6923","city":"Lauterach","latitude":47.46296,"longitude":9.72747},"contact":{"telephone":"05574 / 70060-611","fax":"05574 / 70060-104","mail":"gerd.nussbaumer@baywa.at","website":"http://www.baywa.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":false,"debitCard":true,"creditCard":true,"others":"DKV, UTA, AP-Card"},"paymentArrangements":{"cooperative":false,"clubCard":false,"accessMod":"BAYWA SERVICEKARTE PLUS, Lagerhaus Card, Genol Card,"},"position":2,"open":true,"distance":1.9060828803924545,"prices":[{"fuelType":"SUP","amount":1.773,"label":"Super 95"}]},{"id":4171,"name":"Disk","location":{"address":"Bundesstraße 97","postalCode":"6923","city":"Lauterach","latitude":47.4702303,"longitude":9.7287983},"contact":{"telephone":"435022776923","fax":"435022774923","mail":"info@gutmann.cc","website":"https://www.gutmann.cc/mobilitaet/tankstellen/?utm_source=spr&utm_medium=referral&utm_campaign=spr-standorte&utm_id=spr-standorte&utm_content=spr-standorte-diverse"},"openingHours":[{"day":"MO","label":"Montag","order":1,"from":"06:00","to":"22:00"},{"day":"DI","label":"Dienstag","order":2,"from":"06:00","to":"22:00"},{"day":"MI","label":"Mittwoch","order":3,"from":"06:00","to":"22:00"},{"day":"DO","label":"Donnerstag","order":4,"from":"06:00","to":"22:00"},{"day":"FR","label":"Freitag","order":5,"from":"06:00","to":"22:00"},{"day":"SA","label":"Samstag","order":6,"from":"06:00","to":"22:00"},{"day":"SO","label":"Sonntag","order":7,"from":"07:00","to":"21:00"},{"day":"FE","label":"Feiertag","order":8,"from":"07:00","to":"21:00"}],"offerInformation":{"service":false,"selfService":true,"unattended":false},"paymentMethods":{"cash":true,"debitCard":true,"creditCard":true,"others":"Gutmann-Card"},"paymentArrangements":{"cooperative":false,"clubCard":false},"otherServiceOffers":"Shop","position":3,"open":true,"distance":1.091120393417817,"prices":[{"fuelType":"SUP","amount":1.809,"label":"Super 95"}]},{"id":1129869,"name":"Diskont Tankstelle","location":{"address":"Rauhholzstraße 29 (\"Hofer Parkplatz\")","postalCode":"6971","city":"Hard","latitude":47.487896,"longitude":9.702448},"contact":{"mail":"info@gutmann.cc","website":"http://gutmann.cc"},"openingHours":[{"day":"MO","label":"Montag","order":1,"from":"06:00","to":"22:00"},{"day":"DI","label":"Dienstag","order":2,"from":"06:00","to":"22:00"},{"day":"MI","label":"Mittwoch","order":3,"from":"06:00","to":"22:00"},{"day":"DO","label":"Donnerstag","order":4,"from":"06:00","to":"22:00"},{"day":"FR","label":"Freitag","order":5,"from":"06:00","to":"22:00"},{"day":"SA","label":"Samstag","order":6,"from":"06:00","to":"22:00"},{"day":"SO","label":"Sonntag","order":7,"from":"06:00","to":"22:00"},{"day":"FE","label":"Feiertag","order":8,"from":"06:00","to":"22:00"}],"offerInformation":{"service":false,"selfService":true,"unattended":true},"paymentMethods":{"cash":false,"debitCard":true,"creditCard":true,"others":"AP Karte"},"paymentArrangements":{"cooperative":false,"clubCard":false},"position":4,"open":true,"distance":2.2513235064999013,"prices":[{"fuelType":"SUP","amount":1.809,"label":"Super 95"}]},{"id":449657,"name":"Shell Austria","location":{"address":"RHEINSTRASSE 88","postalCode":"6900","city":"BREGENZ","latitude":47.49363,"longitude":9.71095},"contact":{"telephone":"0557471770"},"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":5,"open":true,"distance":2.0868478561033355,"prices":[{"fuelType":"SUP","amount":1.819,"label":"Super 95"}]},{"id":1474165,"name":"eni","location":{"address":"Bundesstrasse 18","postalCode":"6923","city":"Lauterach","latitude":47.4821512,"longitude":9.73155},"contact":{"telephone":"0557471829","fax":"05574718294"},"openingHours":[{"day":"MO","label":"Montag","order":1,"from":"06:30","to":"21:00"},{"day":"DI","label":"Dienstag","order":2,"from":"06:30","to":"21:00"},{"day":"MI","label":"Mittwoch","order":3,"from":"06:30","to":"21:00"},{"day":"DO","label":"Donnerstag","order":4,"from":"06:30","to":"21:00"},{"day":"FR","label":"Freitag","order":5,"from":"06:30","to":"21:00"},{"day":"SA","label":"Samstag","order":6,"from":"07:00","to":"21:00"},{"day":"SO","label":"Sonntag","order":7,"from":"08:00","to":"21:00"},{"day":"FE","label":"Feiertag","order":8,"from":"08:00","to":"21:00"}],"offerInformation":{"service":false,"selfService":true,"unattended":false},"paymentMethods":{"cash":true,"debitCard":true,"creditCard":true,"others":"AMEX,Maestro,Diners Club,DKV,GUTS,LOGP,MasterCard,Routex,euroShell Card,UTA,VISA"},"paymentArrangements":{"cooperative":false,"clubCard":false},"position":6,"open":true,"distance":0.26631604638965894,"prices":[]},{"id":1354863,"name":"OMV - Bregenz Arlbergstraße 135","location":{"address":"Arlbergstrasse 135","postalCode":"6900","city":"Bregenz","latitude":47.48778,"longitude":9.73324},"contact":{"telephone":"557471115","fax":"55747111513","mail":"retail.at.6521@omv.com","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":true,"selfService":true,"unattended":false},"paymentMethods":{"cash":true,"debitCard":true,"creditCard":true,"others":"UTA, DKV, OMV ROUTEX, EUROTRAFIC, MASTERCARD, MAESTRO, ROUTEX, DINERS, VISA, AMEX, OMV STATIONSKARTE"},"paymentArrangements":{"cooperative":false,"clubCard":false},"position":7,"open":true,"distance":0.899565079643569,"prices":[]},{"id":1474173,"name":"eni","location":{"address":"Achstrasse 39","postalCode":"6922","city":"Wolfurt","latitude":47.48154,"longitude":9.74613},"contact":{"telephone":"0557472154","fax":"05574721544"},"openingHours":[{"day":"MO","label":"Montag","order":1,"from":"06:00","to":"22:00"},{"day":"DI","label":"Dienstag","order":2,"from":"06:00","to":"22:00"},{"day":"MI","label":"Mittwoch","order":3,"from":"06:00","to":"22:00"},{"day":"DO","label":"Donnerstag","order":4,"from":"06:00","to":"22:00"},{"day":"FR","label":"Freitag","order":5,"from":"06:00","to":"22:00"},{"day":"SA","label":"Samstag","order":6,"from":"06:00","to":"22:00"},{"day":"SO","label":"Sonntag","order":7,"from":"07:00","to":"22:00"},{"day":"FE","label":"Feiertag","order":8,"from":"07:00","to":"22:00"}],"offerInformation":{"service":false,"selfService":true,"unattended":false},"paymentMethods":{"cash":true,"debitCard":true,"creditCard":true,"others":"AMEX,Maestro,Diners Club,DKV,GUTS,LOGP,MasterCard,Routex,euroShell Card,UTA,VISA"},"paymentArrangements":{"cooperative":false,"clubCard":false},"position":8,"open":true,"distance":1.225562144445952,"prices":[]},{"id":1474106,"name":"eni","location":{"address":"Arlbergstrasse 56","postalCode":"6900","city":"Bregenz-Rieden","latitude":47.495268,"longitude":9.733599},"contact":{"telephone":"0557444231","fax":"0557444231"},"openingHours":[{"day":"MO","label":"Montag","order":1,"from":"06:00","to":"22:00"},{"day":"DI","label":"Dienstag","order":2,"from":"06:00","to":"22:00"},{"day":"MI","label":"Mittwoch","order":3,"from":"06:00","to":"22:00"},{"day":"DO","label":"Donnerstag","order":4,"from":"06:00","to":"22:00"},{"day":"FR","label":"Freitag","order":5,"from":"06:00","to":"22:00"},{"day":"SA","label":"Samstag","order":6,"from":"06:00","to":"22:00"},{"day":"SO","label":"Sonntag","order":7,"from":"06:00","to":"22:00"},{"day":"FE","label":"Feiertag","order":8,"from":"06:00","to":"22:00"}],"offerInformation":{"service":false,"selfService":true,"unattended":false},"paymentMethods":{"cash":true,"debitCard":true,"creditCard":true,"others":"AMEX,Maestro,Diners Club,DKV,GUTS,LOGP,MasterCard,Routex,euroShell Card,UTA,VISA"},"paymentArrangements":{"cooperative":false,"clubCard":false},"position":9,"open":true,"distance":1.7207590901148748,"prices":[]},{"id":1474108,"name":"eni","location":{"address":"Rheinstrasse 20","postalCode":"6971","city":"Bregenz-Hard","latitude":47.488611,"longitude":9.702186},"contact":{"telephone":"0557472424","fax":"05574724244"},"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,LOGP,MasterCard,Routex,euroShell Card,UTA,VISA"},"paymentArrangements":{"cooperative":false,"clubCard":false},"position":10,"open":true,"distance":2.3014557191511678,"prices":[]}]

Versions: 0.3.0

HGlab01 commented 2 years ago

Hi, thanks for all the details and work you did so far to raise the issue! I tried to reproduce today and testet 3 different locations and compared to spritpreisrechner.at All of the have the same result. So, my assumption is, that the underlying service did not work but works today again. Can you please double check? Thanx!

jack-blackson commented 2 years ago

@HGlab01 Thanks for checking. I just had a look at the adapter results again, and still receive the wrong pricing - or am I seeing something wrong? What is your result if you check the prices for super95 for Lauterach in Vorarlberg? When I check it online, the cheapest one now is 1.798, the adapter still shows me 1.719

HGlab01 commented 2 years ago

This is was I got image by using the coordinates 47.471943, 9.726995

Update: https://api.e-control.at/sprit/1.0/search/gas-stations/by-address?latitude=47.47194&longitude=9.727&fuelType=SUP&includeClosed=true

jack-blackson commented 2 years ago

Hm...confusing. Please try Bregenz. With coordinates 47.5025779, 9.7472924.

image image
HGlab01 commented 2 years ago

The 1.719 is for "Eni" wich is currently closed (at least this is what the API says) image I have to trust to the data that e-control is providing.

I guess the Eni is closed for ever, but the API is still delivering the data.

jack-blackson commented 2 years ago

Thanks for checking that - you are totally right, so it is a local problem with this one gas station, that is closed for some time but still shows up with a price. Well..I think they are doing a renovation of this gas station. Excluding closed ones will also not makes sense, as it would confuse the price checks at night, when all are closed. At the moment, you have hardcoded that includeclosed=true - probably this could be an option to choose for the users, that they just see open ones - especially if you are not using it just for history but to decide where to drive to.

HGlab01 commented 2 years ago

Yes, would be an option to make it more flexible. I let the issue open and will see if I have time for it. But feel free to create a pull request if you like

HGlab01 commented 2 years ago

@jack-blackson you can test by using HGlab01/ioBroker.fuelpricemonitor#v0.3.1-alpha.0

image

jack-blackson commented 2 years ago

@HGlab01 I gave it a try and it works great for me - when I choose "exclude closed ones" the problem one is not appearing any more. I also adjusted the time, that it will only run between 7 and 21. Thank you!!

HGlab01 commented 2 years ago

added in v0.3.1 https://github.com/HGlab01/ioBroker.fuelpricemonitor/releases/tag/v0.3.1