Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. JavaScript
    5. JSON Tabelle FuelPriceMonitor [Austria]

    NEWS

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    JSON Tabelle FuelPriceMonitor [Austria]

    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      papaechokilo @sigi234 last edited by papaechokilo

      [gelöst]@sigi234 ja, stimmt. aber auch wenn ich es so eintrage let telgramInstanz=""; kommt derselbe Fehler. Weil in Zeile 236 sendTo(telegramInstanz, { steht und das kann nicht ausgeführt werden.

      sigi234 liv-in-sky 2 Replies Last reply Reply Quote 0
      • sigi234
        sigi234 Forum Testing Most Active @papaechokilo last edited by sigi234

        @papaechokilo sagte in JSON Tabelle FuelPriceMonitor [Austria]:

        @sigi234 ja, stimmt. aber auch wenn ich es so eintrage let telgramInstanz=""; kommt derselbe Fehler. Weil in Zeile 236 sendTo(telegramInstanz, { steht und das kann nicht ausgeführt werden.

        Zeig mal das Skript bis Zeile 35

        P 1 Reply Last reply Reply Quote 0
        • P
          papaechokilo @sigi234 last edited by papaechokilo

          [gelöst]@sigi234

          let anzahlAnzeige=30;
          let mySprit=["DIE"]; //oder ["GAS","DIE","SUP"] je nachdem, was man braucht
          let telegramInstanz="";  // wenn nicht genutzt:   let telegramInstanz="";
          let emailInstanz=""; //  hier email instanz eintragen z.B. "email.0" - bei "" wird keine mail gesendet
          let emailUser="xx@yyyy.at"
          // Die Bilder müssen unter /vis.0/Tankstellen liegen   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
           
          const config = getObject('system.config');
          const mylat =  config.common.latitude  //.replace(/(.*\..+?.+?.+?.+?.+?.+?).+/,"$1"); //*/"48.427656" //l
          const mylong = config.common.longitude  //.replace(/(.*\..+?.+?.+?.+?.+?.+?).+/,"$1"); log(mylat)
           
          const defaultPic="/vis.0/Tankstellen/default.png"
          const pictures=[{"firma":"BP","pic":"/vis.0/Tankstellen/bp.png"},
                         {"firma":"Genol","pic":"/vis.0/Tankstellen/genol.png"},
                         {"firma":"eni","pic":"/vis.0/Tankstellen/eni.png"},
                         {"firma":"Diskont","pic":"/vis.0/Tankstellen/diskont.png"},
                         {"firma":"Turmöl","pic":"/vis.0/Tankstellen/turmoel.png"},
                         {"firma":"paradies","pic":"/vis.0/Tankstellen/treibstoffparadies.png"},
                         {"firma":"Lohberger","pic":"/vis.0/Tankstellen/lohberger.png"},
                         {"firma":"SB-Tankstelle","pic":"/vis.0/Tankstellen/sb.jpg"},
                         {"firma":"Hofer","pic":"/vis.0/Tankstellen/hofer.png"},
                         {"firma":"AVIA","pic":"/vis.0/Tankstellen/avia.png"},
                         {"firma":"avanti","pic":"/vis.0/Tankstellen/avanti.png"},
                         {"firma":"Shell","pic":"/vis.0/Tankstellen/shell.png"},
                         {"firma":"Aral","pic":"/vis.0/Tankstellen/Aral.png"},
                         {"firma":"JET","pic":"/vis.0/Tankstellen/jet.png"},
                         {"firma":"Ultsch","pic":"/vis.0/Tankstellen/ultsch.png"},
                         {"firma":"bft","pic":"/vis.0/Tankstellen/bft.png"},
                         {"firma":"Spritkönig","pic":"/vis.0/Tankstellen/Spritkönig.png"},
                         {"firma":"Oil","pic":"/vis.0/Tankstellen/Oil.png"},
                         {"firma":"Lagerhaus","pic":"/vis.0/Tankstellen/Lagerhaus.png"},
                         {"firma":"Gelbmann","pic":"/vis.0/Tankstellen/Gelbmann.png"},
                         {"firma":"IQ","pic":"/vis.0/Tankstellen/IQ.jpg"}
                        ]
          
          code_text
          
          sigi234 1 Reply Last reply Reply Quote 0
          • liv-in-sky
            liv-in-sky @papaechokilo last edited by

            @papaechokilo

            du hast recht - habe ich nachträglich eingefügt und die abfrage vergessen - das einfügen:

            async function delTel(){
                if(telegramInstanz!=""){
                for (let b=0;b<mySprit.length;b++){await wait(2000);
                   if(getState('0_userdata.0.FUELPRICEMONITOR.'+mySprit[b]+'telegram_chatid').val!="") deletetext(mySprit[b]) // telegram reset !!
            }}}
            

            der teil gehört hier hin/ausgetauscht:

            Image 197.png

            1 Reply Last reply Reply Quote 0
            • sigi234
              sigi234 Forum Testing Most Active @papaechokilo last edited by sigi234

              @papaechokilo

              Zeile 3 Falsch

              let telegramInstanz="";  // wenn nicht genutzt:   let telegramInstanz="";
              
              1 Reply Last reply Reply Quote 0
              • M
                mrfloppy @liv-in-sky last edited by

                @liv-in-sky
                Ichhabe noch immer ein paar tanken die tageweise keine KM anzeigen.
                Gestern hatte sie aber noch eine Km anzeige.
                Und in den Objecten unter der ID ist auch eine locatin drinnen.
                Eine Idee was das sein könnte?

                LG

                liv-in-sky 2 Replies Last reply Reply Quote 0
                • liv-in-sky
                  liv-in-sky @mrfloppy last edited by liv-in-sky

                  @mrfloppy kannst du mir mal ein bild deiner datenpunkte (ganzen tree) zeigen, mit den tanken, die keine km anzeige haben ?

                  1 Reply Last reply Reply Quote 0
                  • liv-in-sky
                    liv-in-sky @mrfloppy last edited by liv-in-sky

                    @mrfloppy ich meine die dp mit den location der tankstelle unter der instanz

                    M 1 Reply Last reply Reply Quote 0
                    • M
                      mrfloppy @liv-in-sky last edited by mrfloppy

                      @liv-in-sky Screenshot 2023-02-13 115445.jpg Screenshot 2023-02-13 115250.jpg Screenshot 2023-02-13 115048.jpg

                      Wie gesagt an anderen Tagen stimmt die KM Angabe.

                      liv-in-sky 1 Reply Last reply Reply Quote 0
                      • liv-in-sky
                        liv-in-sky @mrfloppy last edited by

                        @mrfloppy seltsam - wie weit ist die von dir entfernt bzw was steht den sonst drin oder sollte drin stehen

                        M 1 Reply Last reply Reply Quote 0
                        • M
                          mrfloppy @liv-in-sky last edited by

                          @liv-in-sky
                          das kann ich nicht ganz genau sagen aber so 6-7 km.
                          Ich wei snur das gestern die Km drinnen gestanden sind aber halt ean einer anderen Position.
                          Ich beobachte das weiter

                          liv-in-sky 2 Replies Last reply Reply Quote 0
                          • liv-in-sky
                            liv-in-sky @mrfloppy last edited by

                            @mrfloppy ich denke. ich weiß den fehler - vermute ich eher

                            hier siehst du die id doppelt in den datenpunkten - wenn der wert null ist, wird die heimadresse angegeben - ich weiß nicht, warum das 2mal vorkommt

                            bitte prüfe das mal bei dir

                            Image 203.png
                            meine dp:
                            Image 202.png

                            1 Reply Last reply Reply Quote 0
                            • liv-in-sky
                              liv-in-sky @mrfloppy last edited by

                              @mrfloppy

                              ändere mal diese zeile 151

                              Image 204.png

                              das ist der code zum einsetzen:

                              else {if (ergebnis=="") ergebnis=mylat+','+mylong}
                              
                              M 2 Replies Last reply Reply Quote 0
                              • M
                                mrfloppy @liv-in-sky last edited by

                                @liv-in-sky
                                Jetzt hat Aderklaa einen Km Angabe.
                                Werde das beobachten
                                DAnke

                                Screenshot 2023-02-13 165807.jpg

                                1 Reply Last reply Reply Quote 0
                                • M
                                  mrfloppy @liv-in-sky last edited by

                                  @liv-in-sky
                                  schau mal

                                  Screenshot 2023-02-13 202548.jpg Screenshot 2023-02-13 165807.jpg

                                  vor 3Std hatte der Lohberger noch KM, jetzt nicht mehr.

                                  liv-in-sky 2 Replies Last reply Reply Quote 0
                                  • liv-in-sky
                                    liv-in-sky @mrfloppy last edited by

                                    @mrfloppy

                                    dann müßtest du bitte mal rausfinden, ob es wieder diese ID öfters als ordner gibt

                                    M 1 Reply Last reply Reply Quote 0
                                    • M
                                      mrfloppy @liv-in-sky last edited by mrfloppy

                                      @liv-in-sky sehe gerade was anderes-> schau mal
                                      dd8d397c-8133-45c2-9d84-ffcb3ee14c16-image.png
                                      da stimmt was mit der liste gar nicht
                                      der ist gar nicht auf Platz 2 (DP 1)

                                      Edit: Wenn ich das Script neu starte stimmt die JsonListe in der VIS
                                      Ist das Update deines Scriptes ev zu schnell? Und die DP noch nicht fertig geschrieben im FUELPRICE?

                                      liv-in-sky 1 Reply Last reply Reply Quote 0
                                      • liv-in-sky
                                        liv-in-sky @mrfloppy last edited by

                                        @mrfloppy hast du mal den browser refresht - evtl sind die dp nicht upgerdatet im admin

                                        M 1 Reply Last reply Reply Quote 0
                                        • M
                                          mrfloppy @liv-in-sky last edited by

                                          @liv-in-sky ja habe ich gehabt

                                          1 Reply Last reply Reply Quote 0
                                          • liv-in-sky
                                            liv-in-sky @mrfloppy last edited by

                                            @mrfloppy

                                            ich muss das morgen ansehen - heute geht leider nicht

                                            aber wenn ich so schnell drüber nachdenke - das script wird getriggert, wenn der erste dp geschrieben wird - evtl kann tatsächlich das script schneller sein, als der adapter

                                            du kannst mal das noch testen ungefähr bei zeile 70 diesen "on" block austauschen mit

                                            on({id: triggerArr, change: "ne"}, async function (obj) {
                                                var value = obj.state.val;
                                                var oldValue = obj.oldState.val;
                                                if (myPause) {setTimeout(async function () { mainFunc();}, 5000); /*log("Wert: "+value+" ID: "+obj.id+" AlterWert: "+oldValue);*/ myPause=false; setTimeout(async function () { myPause=true;}, 10000);}
                                              });
                                            
                                            M 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            997
                                            Online

                                            31.7k
                                            Users

                                            79.7k
                                            Topics

                                            1.3m
                                            Posts

                                            5
                                            69
                                            3535
                                            Loading More Posts
                                            • Oldest to Newest
                                            • Newest to Oldest
                                            • Most Votes
                                            Reply
                                            • Reply as topic
                                            Log in to reply
                                            Community
                                            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                            The ioBroker Community 2014-2023
                                            logo