Skip to content
  • Home
  • Recent
  • Tags
  • 0 Unread 0
  • Categories
  • Unreplied
  • Popular
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. Deutsch
  3. Skripten / Logik
  4. [gelöst] Aktuelle Abfahrtszeiten Straßenbahn-Haltestelle einlesen ?!?

NEWS

  • Verwendung von KI bitte immer deutlich kennzeichnen
    HomoranH
    Homoran
    5
    1
    67

  • Monatsrückblick Januar/Februar 2026 ist online!
    BluefoxB
    Bluefox
    18
    1
    839

  • Jahresrückblick 2025 – unser neuer Blogbeitrag ist online! ✨
    BluefoxB
    Bluefox
    18
    1
    6.4k

[gelöst] Aktuelle Abfahrtszeiten Straßenbahn-Haltestelle einlesen ?!?

Scheduled Pinned Locked Moved Skripten / Logik
17 Posts 6 Posters 3.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pix
    wrote on last edited by
    #4

    Halllo,

    Unglaublich, wie einfach es gehen kann. In meiner Stadt muss ich mich mit dem Parsen der mobilen Webseite des Verkehrsbetriebes rumschlagen und langen Code schreiben, um die nächste Bahn in eine Richtung zu erhalten. Wäre echt gut, auch solche Daten, wie in Dresden zu haben. Aber hier ist man eine Kooperation mit google eingegangen. Google erhält alle Daten für seine Apps, nicht aber die Öffentlichkeit.

    Auf dieser Basis macht ein Adapter auch keinen Sinn.

    Musste ich mal loswerden. :)

    Pix

    ioBroker auf Ubuntu in Proxmox (früher Mac mini (bis OS X 10.12.6 Sierra), VIS via iOS; angeschlossen: Homematic CCU2, Homepilot 1, ConBee II, einige Wemos, Sonos, Unifi CK+Protect, Homekit, Homebridge; KEIN blockly! Github-Profil

    1 Reply Last reply
    0
    • paul53P Offline
      paul53P Offline
      paul53
      wrote on last edited by paul53
      #5

      Eine einfachere Variante schreibt die Abfahrzeiten in 8 Datenpunkte in der Form

      19:00 +2 Linie 11 nach Zschertnitz

      var dvb = require('dvbjs');
      
      var stop = 'Zellescher Weg';
      var timeOffset = 1; // how many minutes in the future, 0 for now
      var numResults = 8; // number of results
      
      function umlaut(value){
        value = value.replace(/Ä/g, 'Ae');
        value = value.replace(/Ö/g, 'Oe');
        value = value.replace(/Ü/g, 'Ue');
        value = value.replace(/ä/g, 'ae');
        value = value.replace(/ö/g, 'oe');
        value = value.replace(/ü/g, 'ue');
        value = value.replace(/ß/g, 'ss');
        value = value.replace(/ /g, '_');
        value = value.replace(/\./g, '');
        value = value.replace(/,/g, '');
        value = value.replace(/\(/g, '');
        value = value.replace(/\)/g, '');
        return value;
      }
      
      var idStop = 'dvb.' + umlaut(stop) + '.';
      
      for(var i = 0; i < numResults; i++) {
          createState(idStop + i, '00:00', {
              type: 'string',
              name: 'dvb.' + stop + '.' + i,
              desc: 'Abfahrt ' + stop
          });
      }
      
      function Zeiten(obj, id) {
          var abfahrt = formatDate(obj.scheduledTime, 'hh:mm');
          setState(id, abfahrt + ' +' + obj.delayTime + ' Linie ' + obj.line + ' nach ' + obj.direction, true);
      }
      
      function getData () {
          dvb.monitor(stop, timeOffset, numResults, function(err, data) {
              if (err) log('Fehler DVB-Abfrage: ' + err, 'error');
              else {
                  for( var i = 0; i < data.length; i++) {
                      Zeiten(data[i], idStop + i);
                  }
              }    
          });
      }
      
      schedule('* * * * *', getData);  // jede Minute
      

      Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
      Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

      1 Reply Last reply
      0
      • R Offline
        R Offline
        Ritschy2000
        wrote on last edited by
        #6

        Ich bin begeistert…. 10000 x DANKE für die Hilfe...

        Leider bekomme ich folgende Fehlermeldung:

        javascript.0 script.js.Straßenbahn.dvbs: Cannot find module 'bluebird' at Module._compile (module.js:409:26), at Object.Module._extensions..js (module.js:416:10), at Module.load (module.js:343:32), at Function.Module._load (module.js:300:12), at Module.require (module.js:353:17), at require (internal/module.js:12:17), at Object. (/opt/iobroker/node_modules/iobroker.javascript/node_modules/dvbjs/index.js:6:14), at Module._compile (module.js:409:26), at Object.Module._extensions..js (module.js:416:10), at Module.load (module.js:343:32), at Function.Module._load (module.js:300:12), at Module.require (module.js:353:17), at require (internal/module.js:12:17), at sandbox.require (/opt/iobroker/node_modules/iobroker.javascript/javascript.js:748:32), at script.js.Straßenbahn.dvbs:1:11

        liegt sicherlich daran, dass ich noch :

        Javascript/Node.js 0.13.2 statt: 1.0.3 installiert habe, oder?

        Werde es mal update und erneut probieren...

        Grüße

        1 Reply Last reply
        0
        • R Offline
          R Offline
          Ritschy2000
          wrote on last edited by
          #7

          muss leider noch mal nerven, bekomme es einfach nicht hin:

          habe folgendes gemacht:

          im Bereich Adapter über:

          "installiere aus eigener URL" : https://github.com/kiliankoe/dvbjs installiert:

          LOG:iobroker 2017-07-16 17:24:29.083 info exit 0

          iobroker 2017-07-16 17:24:29.012 info └── request-promise@4.2.1 (stealthy-require@1.1.1, bluebird@3.5.0, tough-cookie@2.3.2, request-promise-core@1.1.1)

          iobroker 2017-07-16 17:24:29.012 info ├── request@2.81.0 (aws-sign2@0.6.0, tunnel-agent@0.6.0, oauth-sign@0.8.2, forever-agent@0.6.1, is-typedarray@1.0.0, caseless@0.12.0, safe-buffer@5.1.1, stringstream@0.0.5, aws4@1.6.0, isstream@0.1.2,

          iobroker 2017-07-16 17:24:29.012 info dvbjs@4.3.5 opt/iobroker/node_modules/dvbjs├── proj4@2.4.3 (wkt-parser@1.2.0, mgrs@1.0.0)

          iobroker 2017-07-16 17:23:50.746 info npm install https://github.com/kiliankoe/dvbjs/tarball/master –production --prefix "/opt/iobroker" (System call)

          iobroker 2017-07-16 17:23:50.362 info install https://github.com/kiliankoe/dvbjs/tarball/master

          iobroker 2017-07-16 17:23:49.032 info url "https://github.com/kiliankoe/dvbjs" --debug

          zusätzliches NPM Modul: "dvbjs" eingetragen, Script kopiert und gestartet:

          folgende Fehlermelung:

          javascript.0 script.js.Straßenbahn.dvbs: Cannot find module 'bluebird' at Module._compile (module.js:409:26), at Object.Module._extensions..js (module.js:416:10), at Module.load (module.js:343:32), at Function.Module._load (module.js:300:12), at Module.require (module.js:353:17), at require (internal/module.js:12:17), at Object. (/opt/iobroker/node_modules/iobroker.javascript/node_modules/dvbjs/index.js:6:14), at Module._compile (module.js:409:26), at Object.Module._extensions..js (module.js:416:10), at Module.load (module.js:343:32), at Function.Module._load (module.js:300:12), at Module.require (module.js:353:17), at require (internal/module.js:12:17), at sandbox.require (/opt/iobroker/node_modules/iobroker.javascript/javascript.js:748:32), at script.js.Straßenbahn.dvbs:1:11

          17:19:14.975 [info] javascript.0 script.js.Straßenbahn.dvbs: registered 0 subscriptions and 1 schedule

          Jemand eine Idee??

          Was habe ich falsch gemacht.

          Danke im Voraus.

          Gruße

          1 Reply Last reply
          0
          • paul53P Offline
            paul53P Offline
            paul53
            wrote on last edited by
            #8

            @Ritschy2000:

            habe folgendes gemacht:

            im Bereich Adapter über:

            "installiere aus eigener URL" : https://github.com/kiliankoe/dvbjs installiert: `
            Das ist unnötig, da das NPM-Modul, das in der JS-Konfiguration neu eingetragen wird, automatisch installiert wird.
            @Ritschy2000:

            javascript.0 script.js.Straßenbahn.dvbs: Cannot find module 'bluebird' `
            Welche node-Version ? Auf Konsole prüfen mit node -v .

            Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
            Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

            1 Reply Last reply
            0
            • R Offline
              R Offline
              Ritschy2000
              wrote on last edited by
              #9

              ahhh, okay. war mir nicht bekannt, dass es durch den Eintrag mit installiert wird…

              Node Version ist 4.7.0

              welche Version wird empfohlen??

              1 Reply Last reply
              0
              • paul53P Offline
                paul53P Offline
                paul53
                wrote on last edited by
                #10

                Version 4.7.0 sollte o.k. sein. Existiert bei Dir das Verzeichnis ?
                > ioBroker\node_modules\iobroker.javascript\node_modules\dvbjs\node_modules\bluebird
                Ich würde einen zweiten Versuch wagen: dvbjs aus der Konfig löschen und Adapter neu starten (speichern) und anschließend wieder dvbjs eintragen. Vielleicht wird das Modul 'bluebird' dann installiert ?

                Oder installiere 'bluebird' manuell

                npm install --save bluebird
                

                Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
                Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

                1 Reply Last reply
                0
                • R Offline
                  R Offline
                  Ritschy2000
                  wrote on last edited by
                  #11

                  geht leider immer noch nicht…

                  bluebird war im Verzeichnis nicht vorhanden, habe es jetzt installiert:

                  /opt/iobroker/node_modules/dvbjs/node_modules# ls

                  bluebird proj4 request request-promise

                  /opt/iobroker/node_modules/dvbjs/node_modules/bluebird# ls

                  changelog.md js LICENSE package.json README.md

                  sollte alles vorhanden sein. Reboot habe ich auch gemacht...

                  Fehlermeldung bleibt: :(

                  javascript.0 script.js.dvbjs.dvbs: Cannot find module 'bluebird' at Module._compile (module.js:409:26), at Object.Module._extensions..js (module.js:416:10), at Module.load (module.js:343:32), at Function.Module._load (module.js:300:12), at Module.require (module.js:353:17), at require (internal/module.js:12:17), at Object. (/opt/iobroker/node_modules/iobroker.javascript/node_modules/dvbjs/index.js:6:14), at Module._compile (module.js:409:26), at Object.Module._extensions..js (module.js:416:10), at Module.load (module.js:343:32), at Function.Module._load (module.js:300:12), at Module.require (module.js:353:17), at require (internal/module.js:12:17), at sandbox.require (/opt/iobroker/node_modules/iobroker.javascript/javascript.js:748:32), at script.js.dvbjs.dvbs:1:11

                  1 Reply Last reply
                  0
                  • R Offline
                    R Offline
                    Ritschy2000
                    wrote on last edited by
                    #12

                    Jetzt habe ich es doch noch hinbekommen:

                    unter opt/iobroker/node_modules/iobroker.javascript/node_modules/dvbjs/node_modules/

                    Bluebird installiert, jetzt läuft es…

                    VIELEN VIELEN DANK!

                    Gruß

                    1 Reply Last reply
                    0
                    • paul53P Offline
                      paul53P Offline
                      paul53
                      wrote on last edited by paul53
                      #13

                      @Ritschy2000:

                      Jetzt habe ich es doch noch hinbekommen:

                      Es freut mich, das zu lesen :D

                      Dann markiere bitte noch das Thema als gelöst (im ersten Beitrag).

                      Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
                      Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

                      1 Reply Last reply
                      0
                      • R Offline
                        R Offline
                        Ritschy2000
                        wrote on last edited by
                        #14

                        erledigt. :)

                        1 Reply Last reply
                        0
                        • D Offline
                          D Offline
                          DUDU
                          wrote on last edited by
                          #15

                          hallo ich würde gerne so etwas mit dem VBN Haltestellenfahrplan umsetzen.

                          Kann mir jemand eine Möglichkeit nennen?

                          1 Reply Last reply
                          0
                          • R Offline
                            R Offline
                            RMortan
                            wrote on last edited by
                            #16

                            Hallo habe grad versucht das um zusetzen… Leider bleiben mir um Script die Zeiten für Abfahrten auf 00:00 stehen woran kann das liegen einer ne idee.

                            Liebe Grüße aus Dresden

                            1 Reply Last reply
                            0
                            • S Offline
                              S Offline
                              stubennatter
                              wrote on last edited by
                              #17

                              Hallo,

                              geht scheinbar nicht mehr oder?
                              Weil bekomme eine Fehlermeldung wenn ich per eigen URL installieren möchte:

                              Fertig mit Fehler: (node:13094) UnhandledPromiseRejectionWarning: ParserError: Protocol error, got "H" as reply type byte. Please report this. at handleError (/opt/iobroker/node_modules/redis-parser/lib/parser.js:190:15) at parseType (/opt/iobroker/node_modules/redis-parser/lib/parser.js:304:14)

                              Gruß Micha

                              1 Reply Last reply
                              0

                              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                              With your input, this post could be even better 💗

                              Register Login
                              Reply
                              • Reply as topic
                              Log in to reply
                              • Oldest to Newest
                              • Newest to Oldest
                              • Most Votes


                              Support us

                              ioBroker
                              Community Adapters
                              Donate

                              307

                              Online

                              32.8k

                              Users

                              82.7k

                              Topics

                              1.3m

                              Posts
                              Community
                              Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
                              ioBroker Community 2014-2025
                              logo
                              • Login

                              • Don't have an account? Register

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Home
                              • Recent
                              • Tags
                              • Unread 0
                              • Categories
                              • Unreplied
                              • Popular
                              • GitHub
                              • Docu
                              • Hilfe