Skip to content
  • 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
Logo
  1. ioBroker Community Home
  2. Deutsch
  3. Tester
  4. Test Adapter Bosch ebik connect / flow

NEWS

  • UPDATE 31.10.: Amazon Alexa - ioBroker Skill läuft aus ?
    apollon77A
    apollon77
    48
    3
    8.1k

  • Monatsrückblick – September 2025
    BluefoxB
    Bluefox
    13
    1
    1.8k

  • Neues Video "KI im Smart Home" - ioBroker plus n8n
    BluefoxB
    Bluefox
    15
    1
    2.1k

Test Adapter Bosch ebik connect / flow

Scheduled Pinned Locked Moved Tester
179 Posts 36 Posters 36.7k Views 42 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.
  • S schienw

    @bahnuhr
    Anbei mein Script:

    
    // Script um aus den DP vom Adapter "bosch-ebike" eine MAP zu erstellen und den Weg zu zeichnen
    // bahnuhr, 03_2024
    
    
    // Variablen
        var poly ="";       // hier werden die GPS gespeichert
       // var trip = "03";    // DP bei den Objekten der eingelesen werden soll: bosch-ebike.0.trips.xx.details
        var logging = true;
        var center_gps = "53.465, 11.71";    // Mittelpunkt der Karte
        var zoom = 17                       // Zoom der Karte
        var pfad = "route.html"             // Dateiname - wird in vis.0 gespeichert
    
    // GPS einlesen und der Variablen poly zuweisen
    
    
    
    
    
    // html erzeugen und speichern in /vis.0/xxx.html
        var string = '<!DOCTYPE html>\n<html>\n<head>\n<title>Simple Leaflet Map</title>\n<meta charset="utf-8" />\n'
        string = string + '<body>\n'
    
        string = string + '<table border=0>'
        string = string + '<tr>'
    
        const idsCO2 = $('bosch-ebike.0.trips.*.id');
        var f = 2
        var hilf = 0
        idsCO2.each(function(id, i) {
            var poly ="";  
          var h= getState(id).val
          if (i < 9){
              ii = i + 1
            hilf = "0" + ii 
          }   
          else{
            ii =i + 1
            hilf = i + 1
          }
    
         
         distance = 0
         
     
          var distance = getState("bosch-ebike.0.trips." + hilf + ".attributes.distance").val;   
          var startTime = getState("bosch-ebike.0.trips." + hilf + ".attributes.startTime").val; 
         
    
          var ModeUsage01_name = getState("bosch-ebike.0.trips." + hilf + ".attributes.assistModeUsage01.name").val;   
          var ModeUsage01_assistModeUsage = getState("bosch-ebike.0.trips." + hilf + ".attributes.assistModeUsage01.assistModeUsage").val;  
          var ModeUsage01_color = getState("bosch-ebike.0.trips." + hilf + ".attributes.assistModeUsage02.color").val;  
          var ModeUsage02_name = getState("bosch-ebike.0.trips." + hilf + ".attributes.assistModeUsage02.name").val;   
          var ModeUsage02_assistModeUsage = getState("bosch-ebike.0.trips." + hilf + ".attributes.assistModeUsage02.assistModeUsage").val;  
          var ModeUsage02_color = getState("bosch-ebike.0.trips." + hilf + ".attributes.assistModeUsage03.color").val; 
          var ModeUsage03_name = getState("bosch-ebike.0.trips." + hilf + ".attributes.assistModeUsage03.name").val;   
          var ModeUsage03_assistModeUsage = getState("bosch-ebike.0.trips." + hilf + ".attributes.assistModeUsage03.assistModeUsage").val;  
          var ModeUsage03_color = getState("bosch-ebike.0.trips." + hilf + ".attributes.assistModeUsage04.color").val; 
          var ModeUsage04_name = getState("bosch-ebike.0.trips." + hilf + ".attributes.assistModeUsage04.name").val;   
          var ModeUsage04_assistModeUsage = getState("bosch-ebike.0.trips." + hilf + ".attributes.assistModeUsage04.assistModeUsage").val;  
          var ModeUsage04_color = getState("bosch-ebike.0.trips." + hilf + ".attributes.assistModeUsage05.color").val; 
          var ModeUsage05_name = getState("bosch-ebike.0.trips." + hilf + ".attributes.assistModeUsage05.name").val;   
          var ModeUsage05_assistModeUsage = getState("bosch-ebike.0.trips." + hilf + ".attributes.assistModeUsage05.assistModeUsage").val;  
          var ModeUsage05_color = getState("bosch-ebike.0.trips." + hilf + ".attributes.assistModeUsage05.color").val; 
         
          var date = formatDate(startTime, "TT.MM.JJJJ SS:mm")
          
          string = string + '<td>'
          string = string + date + ' ' + distance/1000 + " KM"
          string = string + '<table border=0>'
    
            string = string + '<tr>'
              string = string + '<td bgcolor=yellow>'
                string = string + ModeUsage01_name
              string = string + '</td>'
              string = string + '<td bgcolor=blue>'
                string = string + ModeUsage02_name
              string = string + '</td>'
              string = string + '<td bgcolor=green>'
                string = string + ModeUsage03_name
              string = string + '</td>'
              string = string + '<td bgcolor=orange>'
                string = string + ModeUsage04_name
              string = string + '</td>'
              string = string + '<td bgcolor=red>'
                string = string + ModeUsage05_name
              string = string + '</td>'
            string = string + '</tr>'
    
            string = string + '<tr>' 
              string = string + '<td>'
                string = string + ModeUsage01_assistModeUsage/1000
              string = string + '</td>'
              string = string + '<td>'
                string = string + ModeUsage02_assistModeUsage/1000
              string = string + '</td>'
              string = string + '<td>'
                string = string + ModeUsage03_assistModeUsage/1000
              string = string + '</td>'
              string = string + '<td>'
                string = string + ModeUsage04_assistModeUsage/1000
              string = string + '</td>'
              string = string + '<td>'
                string = string + ModeUsage05_assistModeUsage/1000
              string = string + '</td>'
            string = string + '</tr>'
    
            var Prokm = distance /100
           
            string = string + '<tr>'
              string = string + '<td>'
                string = string + Math.round(ModeUsage01_assistModeUsage/Prokm) + ' %'
              string = string + '</td>'
              string = string + '<td>'
                string = string + Math.round(ModeUsage02_assistModeUsage/Prokm) + ' %'
              string = string + '</td>'
              string = string + '<td>'
                string = string + Math.round(ModeUsage03_assistModeUsage/Prokm) + ' %'
              string = string + '</td>'
              string = string + '<td>'
                string = string + Math.round(ModeUsage04_assistModeUsage/Prokm) + ' %'
              string = string + '</td>'
              string = string + '<td>'
                string = string + Math.round(ModeUsage05_assistModeUsage/Prokm) + ' %'
              string = string + '</td>'
            string = string + '</tr>'        
    
          string = string + '</table>'
         
    
            var poly =""; 
            var string3 = "";
            var obj = JSON.parse(getState("bosch-ebike.0.trips." + hilf + ".details").val); 
                           
            var end = obj.activityData.length - 1;
            var center_gps = '"' + obj.activityData[30].lat + ', ' + obj.activityData[30].lon + '"';
     
    
        for (var x=0; x<=end; x++) {
            if (obj.activityData[x].lat != null)        {
              poly = poly + "["+obj.activityData[x].lat+", "+obj.activityData[x].lon+"]"
            if (x < end) poly = poly + ","
            }
            else      {        
            }
        }
        if (logging) log (poly);
    
        
    string = string + '</td>'
    string = string + '<td>'
             
        var center_gps = "48.90376, 11.93504";    // Mittelpunkt der Karte
        var zoom = 11       
        
        string = string + '<link rel="stylesheet" href="https://unpkg.com/leaflet@1.6.0/dist/leaflet.css"integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ=="crossorigin=""/></head>\n'
        string = string + '<body>\n<div id="map' + hilf + '" style="width: 600px; height: 400px"></div>\n<script src="https://unpkg.com/leaflet@1.6.0/dist/leaflet.js"integrity="sha512-gZwIG9x3wUXg2hdXF6+rVkLF/0Vi9U8D2Ntg4Ga5I5BZpVkVxlJWbSQtXPSiUTtC0TjtGOmxa1AJPuV0CPthew=="crossorigin=""></script>\n<script>\n'
    
        string = string + "var map"+  hilf + " = L.map('map" + hilf + "').setView([" + center_gps + "], " + zoom + ");\n"
      
       
        string = string + "mapLink = '<a href=" + '"http://openstreetmap.org"' + ">OpenStreetMap</a>';\n"
        string = string + "L.tileLayer( 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {attribution: '&copy; ' + mapLink + ' Contributors', maxZoom: 18,}).addTo(map" + hilf + ");\n"
        
        string = string + 'var polyline = L.polyline([ \n' + poly + '\n], { color: "blue", weight: 3, opacity: .7, lineJoin: "round" } ).addTo(map' + hilf + ');\n'
        string = string + '</script>\n'
    string = string + '</td>'
    
    
    
    
    string = string + '</tr>'
       });                        
        
        
    
    
        string = string + '</body>\n</html>'
       
        writeFile("vis.0", "/" + pfad, string, (error) => {
            if (logging) log('Datei "" gespeichert!');
        });
    
    
    
    
    bahnuhrB Online
    bahnuhrB Online
    bahnuhr
    Forum Testing Most Active
    wrote on last edited by
    #157

    @schienw

    Super
    Und wenns funktioniert noch besser.


    Wenn ich helfen konnte, dann Daumen hoch (Pfeil nach oben)!
    Danke.
    gute Forenbeiträge: https://forum.iobroker.net/topic/51555/hinweise-f%C3%BCr-gute-forenbeitr%C3%A4ge
    ScreenToGif :https://www.screentogif.com/downloads.html

    1 Reply Last reply
    0
    • A Offline
      A Offline
      ae55
      wrote on last edited by ae55
      #158

      Habe gerade versucht, den Adapter einzurichten, jedoch kam keine onebikeapp-ios:// URL sondern nur ein Link, der mit "https://p9.authz.bosch.com/auth/realms/obc/broker/skid/endpoint" beginnt...
      34d98a5b-4c2f-4037-911f-9a8b9038c9f9-grafik.png
      Ich habe die Flow App mit einem Kiox300 und einer LED Remote am E-Bike.

      Samson71S T 2 Replies Last reply
      0
      • A ae55

        Habe gerade versucht, den Adapter einzurichten, jedoch kam keine onebikeapp-ios:// URL sondern nur ein Link, der mit "https://p9.authz.bosch.com/auth/realms/obc/broker/skid/endpoint" beginnt...
        34d98a5b-4c2f-4037-911f-9a8b9038c9f9-grafik.png
        Ich habe die Flow App mit einem Kiox300 und einer LED Remote am E-Bike.

        Samson71S Offline
        Samson71S Offline
        Samson71
        Global Moderator
        wrote on last edited by
        #159

        @ae55
        Warum auf Englisch im deutschen Bereich und in einem deutschen Post? Der IP nach sollte Dir Deutsch nicht fremd sein.

        Gruß, Markus

        Maßnahmen zum Schutz des Forums:
        https://forum.iobroker.net/topic/79618/ma%C3%9Fnahmen-zum-schutz-des-forums
        Hinweise für gute Forenbeiträge:
        https://forum.iobroker.net/topic/51555/hinweise-f%C3%BCr-gute-forenbeitr%C3%A4ge

        A 1 Reply Last reply
        0
        • Samson71S Samson71

          @ae55
          Warum auf Englisch im deutschen Bereich und in einem deutschen Post? Der IP nach sollte Dir Deutsch nicht fremd sein.

          A Offline
          A Offline
          ae55
          wrote on last edited by
          #160

          @samson71 Sorry, war es halt noch gewohnt vom Home Assistant-Forum alles auf Englisch zu schreiben :-)...

          Samson71S 1 Reply Last reply
          0
          • A ae55

            Habe gerade versucht, den Adapter einzurichten, jedoch kam keine onebikeapp-ios:// URL sondern nur ein Link, der mit "https://p9.authz.bosch.com/auth/realms/obc/broker/skid/endpoint" beginnt...
            34d98a5b-4c2f-4037-911f-9a8b9038c9f9-grafik.png
            Ich habe die Flow App mit einem Kiox300 und einer LED Remote am E-Bike.

            T Offline
            T Offline
            tombox
            wrote on last edited by
            #161

            @ae55 also ich würde vermuten der browser blockiert irgendwas wie cookies

            A 1 Reply Last reply
            0
            • T tombox

              @ae55 also ich würde vermuten der browser blockiert irgendwas wie cookies

              A Offline
              A Offline
              ae55
              wrote on last edited by
              #162

              @tombox Ich habe in den Einstellungen von Chrome Drittanbieter-Cookies auf "immer erlaubt" gesetzt, dies hat das Problem nicht gelöst...
              Wie könnte ich es lösen?

              T 1 Reply Last reply
              0
              • A ae55

                @samson71 Sorry, war es halt noch gewohnt vom Home Assistant-Forum alles auf Englisch zu schreiben :-)...

                Samson71S Offline
                Samson71S Offline
                Samson71
                Global Moderator
                wrote on last edited by
                #163

                @ae55
                Gerade davon und deswegen heben wir bzw. dieses Forum sich (bewusst) ab 😄

                Gruß, Markus

                Maßnahmen zum Schutz des Forums:
                https://forum.iobroker.net/topic/79618/ma%C3%9Fnahmen-zum-schutz-des-forums
                Hinweise für gute Forenbeiträge:
                https://forum.iobroker.net/topic/51555/hinweise-f%C3%BCr-gute-forenbeitr%C3%A4ge

                1 Reply Last reply
                1
                • A ae55

                  @tombox Ich habe in den Einstellungen von Chrome Drittanbieter-Cookies auf "immer erlaubt" gesetzt, dies hat das Problem nicht gelöst...
                  Wie könnte ich es lösen?

                  T Offline
                  T Offline
                  tombox
                  wrote on last edited by
                  #164

                  @ae55 cache leeren oder incognitio Fenster

                  A 1 Reply Last reply
                  0
                  • T tombox

                    @ae55 cache leeren oder incognitio Fenster

                    A Offline
                    A Offline
                    ae55
                    wrote on last edited by
                    #165

                    @tombox Danke, nachdem ich einmal mit "Briwserdaten löschen → gesamte Zeit" alles gelöscht hab, hat es nun auch funktioniert 👍🏻

                    G 1 Reply Last reply
                    0
                    • A ae55

                      @tombox Danke, nachdem ich einmal mit "Briwserdaten löschen → gesamte Zeit" alles gelöscht hab, hat es nun auch funktioniert 👍🏻

                      G Offline
                      G Offline
                      Gonzokalle
                      wrote on last edited by Gonzokalle
                      #166

                      Hallo zusammen,

                      ich komme bei der Anmeldung auch nicht weiter.
                      Nach dem Klick auf Singlekey Login komme öffnet sich diese Seite.

                      9568daae-7439-4119-b8e0-fffcf989df35-image.png

                      beziehungsweise diese Seite

                      a86eb154-d18f-4844-b7db-297a5858561f-image.png

                      Ich würde ungerne meine Browserdaten löschen.
                      Wie komme ich an die URL?

                      Im Inkgnito Fenster kommt das hier.

                      3288442f-5a71-4baf-9fe1-906776066495-image.png

                      Problem gelöst. Der Werbeblocker war aktiv.

                      1 Reply Last reply
                      0
                      • N Offline
                        N Offline
                        no6mis
                        wrote on last edited by
                        #167

                        @mclane said in Test Adapter Bosch ebik connect / flow:

                        Ein anderes Thema ist die Übermittlung des Akku Stands. Habe mich mal ein wenig informiert.
                        Dazu ist ein Flow+ Abo von Bosch notwendig, welches knapp 40 Euro im Jahr kostet.
                        Zudem ist - sofern nicht verbaut - ein ConnectModul notwendig, welches so round about 100 Euro kostet.

                        Wird mit ConnectModul dann auch der letzte bekannte Standort und der Akku-Stand durch den Adapter ausgelesen? Jemand mit ConnectModul hier, der das mal ausprobieren könnte?

                        R 1 Reply Last reply
                        0
                        • N no6mis

                          @mclane said in Test Adapter Bosch ebik connect / flow:

                          Ein anderes Thema ist die Übermittlung des Akku Stands. Habe mich mal ein wenig informiert.
                          Dazu ist ein Flow+ Abo von Bosch notwendig, welches knapp 40 Euro im Jahr kostet.
                          Zudem ist - sofern nicht verbaut - ein ConnectModul notwendig, welches so round about 100 Euro kostet.

                          Wird mit ConnectModul dann auch der letzte bekannte Standort und der Akku-Stand durch den Adapter ausgelesen? Jemand mit ConnectModul hier, der das mal ausprobieren könnte?

                          R Offline
                          R Offline
                          ratte-rizzo
                          wrote on last edited by
                          #168

                          @no6mis sagte in Test Adapter Bosch ebik connect / flow:

                          Wird mit ConnectModul dann auch der letzte bekannte Standort und der Akku-Stand durch den Adapter ausgelesen? Jemand mit ConnectModul hier, der das mal ausprobieren könnte?

                          Also ich hab sowohl das Connect-Modul verbaut, als auch das Abo... Was muss ich zum Testen tun?

                          N 1 Reply Last reply
                          0
                          • R ratte-rizzo

                            @no6mis sagte in Test Adapter Bosch ebik connect / flow:

                            Wird mit ConnectModul dann auch der letzte bekannte Standort und der Akku-Stand durch den Adapter ausgelesen? Jemand mit ConnectModul hier, der das mal ausprobieren könnte?

                            Also ich hab sowohl das Connect-Modul verbaut, als auch das Abo... Was muss ich zum Testen tun?

                            N Offline
                            N Offline
                            no6mis
                            wrote on last edited by
                            #169

                            @ratte-rizzo said in Test Adapter Bosch ebik connect / flow:

                            Also ich hab sowohl das Connect-Modul verbaut, als auch das Abo... Was muss ich zum Testen tun?

                            Mein Verständnis ist, dass mit ConnectModul (und Abo) sowohl SOC als auch die letzte bekannte Position in der Cloud landen müssen, da sie auch ohne Bluetooth Verbindung in der Flow-App angezeigt werden.

                            Tauchen die Datenpunkte bei dir im Adapter auf?
                            @tombox falls nicht, was muss @ratte-rizzo tun, um dich bei der Implementierung zu unterstützen?

                            R N D 3 Replies Last reply
                            0
                            • N no6mis

                              @ratte-rizzo said in Test Adapter Bosch ebik connect / flow:

                              Also ich hab sowohl das Connect-Modul verbaut, als auch das Abo... Was muss ich zum Testen tun?

                              Mein Verständnis ist, dass mit ConnectModul (und Abo) sowohl SOC als auch die letzte bekannte Position in der Cloud landen müssen, da sie auch ohne Bluetooth Verbindung in der Flow-App angezeigt werden.

                              Tauchen die Datenpunkte bei dir im Adapter auf?
                              @tombox falls nicht, was muss @ratte-rizzo tun, um dich bei der Implementierung zu unterstützen?

                              R Offline
                              R Offline
                              ratte-rizzo
                              wrote on last edited by
                              #170

                              @no6mis sagte in Test Adapter Bosch ebik connect / flow:

                              Mein Verständnis ist, dass mit ConnectModul (und Abo) sowohl SOC als auch die letzte bekannte Position in der Cloud landen müssen, da sie auch ohne Bluetooth Verbindung in der Flow-App angezeigt werden.

                              Tauchen die Datenpunkte bei dir im Adapter auf?

                              Ich habe lediglich

                              bosch-ebike.0.trips.01.attributes.totalBatteryConsumptionPercentage
                              

                              der aber leer ist. Sonst weist nichts auf Batterie oder Ort hin.

                              N 1 Reply Last reply
                              0
                              • R ratte-rizzo

                                @no6mis sagte in Test Adapter Bosch ebik connect / flow:

                                Mein Verständnis ist, dass mit ConnectModul (und Abo) sowohl SOC als auch die letzte bekannte Position in der Cloud landen müssen, da sie auch ohne Bluetooth Verbindung in der Flow-App angezeigt werden.

                                Tauchen die Datenpunkte bei dir im Adapter auf?

                                Ich habe lediglich

                                bosch-ebike.0.trips.01.attributes.totalBatteryConsumptionPercentage
                                

                                der aber leer ist. Sonst weist nichts auf Batterie oder Ort hin.

                                N Offline
                                N Offline
                                no6mis
                                wrote on last edited by
                                #171

                                @ratte-rizzo said in Test Adapter Bosch ebik connect / flow:

                                Sonst weist nichts auf Batterie oder Ort hin.

                                Ich hätte das eher in info erwartet, da es unabhängig von Trips sein sollte.

                                R 1 Reply Last reply
                                0
                                • N no6mis

                                  @ratte-rizzo said in Test Adapter Bosch ebik connect / flow:

                                  Sonst weist nichts auf Batterie oder Ort hin.

                                  Ich hätte das eher in info erwartet, da es unabhängig von Trips sein sollte.

                                  R Offline
                                  R Offline
                                  ratte-rizzo
                                  wrote on last edited by
                                  #172

                                  @no6mis sagte in Test Adapter Bosch ebik connect / flow:

                                  Ich hätte das eher in info erwartet, da es unabhängig von Trips sein sollte.

                                  Da hab ich nur bosch-ebike.0.info.connection = TRUE und dem Zeitstempel von heute Nacht (wo ich nicht gefahren bin). Also ziemlich aktuell. Sonst keine weiteren Datenpunkte.

                                  1 Reply Last reply
                                  0
                                  • M Offline
                                    M Offline
                                    Migul_70
                                    wrote on last edited by
                                    #173

                                    Hallo,

                                    irgendwie klappt die Anmeldung nicht. Zwei Browser, inkognito oder nicht, kein Werbeblocker, cookies gelöscht. Entweder bin ich schon angemeldet oder er findet die Cookies nicht. Hab nach einer Stunde aufgegeben. Läßt auch keinen weiteren Versuch mehr zu. Hat vielleicht jemand noch einen Tip für mich?

                                    Danke

                                    M 1 Reply Last reply
                                    0
                                    • M Migul_70

                                      Hallo,

                                      irgendwie klappt die Anmeldung nicht. Zwei Browser, inkognito oder nicht, kein Werbeblocker, cookies gelöscht. Entweder bin ich schon angemeldet oder er findet die Cookies nicht. Hab nach einer Stunde aufgegeben. Läßt auch keinen weiteren Versuch mehr zu. Hat vielleicht jemand noch einen Tip für mich?

                                      Danke

                                      M Offline
                                      M Offline
                                      Migul_70
                                      wrote on last edited by
                                      #174

                                      @migul_70 Hallo,

                                      hab's jetzt endlich geschafft, die URL zu bekommen. Leider wird er nicht grün. Gibt es da Probleme mit dem Passwort?

                                      D 1 Reply Last reply
                                      0
                                      • N no6mis

                                        @ratte-rizzo said in Test Adapter Bosch ebik connect / flow:

                                        Also ich hab sowohl das Connect-Modul verbaut, als auch das Abo... Was muss ich zum Testen tun?

                                        Mein Verständnis ist, dass mit ConnectModul (und Abo) sowohl SOC als auch die letzte bekannte Position in der Cloud landen müssen, da sie auch ohne Bluetooth Verbindung in der Flow-App angezeigt werden.

                                        Tauchen die Datenpunkte bei dir im Adapter auf?
                                        @tombox falls nicht, was muss @ratte-rizzo tun, um dich bei der Implementierung zu unterstützen?

                                        N Offline
                                        N Offline
                                        no6mis
                                        wrote on last edited by
                                        #175

                                        @no6mis said in Test Adapter Bosch ebik connect / flow:

                                        tombox falls nicht, was muss ratte-rizzo tun, um dich bei der Implementierung zu unterstützen?

                                        @tombox, hast du mal geschaut, ob du die Position und den SOC aus dem ConnectModul auslesen kannst?

                                        1 Reply Last reply
                                        0
                                        • S schienw

                                          @bahnuhr
                                          Anbei mein Script:

                                          
                                          // Script um aus den DP vom Adapter "bosch-ebike" eine MAP zu erstellen und den Weg zu zeichnen
                                          // bahnuhr, 03_2024
                                          
                                          
                                          // Variablen
                                              var poly ="";       // hier werden die GPS gespeichert
                                             // var trip = "03";    // DP bei den Objekten der eingelesen werden soll: bosch-ebike.0.trips.xx.details
                                              var logging = true;
                                              var center_gps = "53.465, 11.71";    // Mittelpunkt der Karte
                                              var zoom = 17                       // Zoom der Karte
                                              var pfad = "route.html"             // Dateiname - wird in vis.0 gespeichert
                                          
                                          // GPS einlesen und der Variablen poly zuweisen
                                          
                                          
                                          
                                          
                                          
                                          // html erzeugen und speichern in /vis.0/xxx.html
                                              var string = '<!DOCTYPE html>\n<html>\n<head>\n<title>Simple Leaflet Map</title>\n<meta charset="utf-8" />\n'
                                              string = string + '<body>\n'
                                          
                                              string = string + '<table border=0>'
                                              string = string + '<tr>'
                                          
                                              const idsCO2 = $('bosch-ebike.0.trips.*.id');
                                              var f = 2
                                              var hilf = 0
                                              idsCO2.each(function(id, i) {
                                                  var poly ="";  
                                                var h= getState(id).val
                                                if (i < 9){
                                                    ii = i + 1
                                                  hilf = "0" + ii 
                                                }   
                                                else{
                                                  ii =i + 1
                                                  hilf = i + 1
                                                }
                                          
                                               
                                               distance = 0
                                               
                                           
                                                var distance = getState("bosch-ebike.0.trips." + hilf + ".attributes.distance").val;   
                                                var startTime = getState("bosch-ebike.0.trips." + hilf + ".attributes.startTime").val; 
                                               
                                          
                                                var ModeUsage01_name = getState("bosch-ebike.0.trips." + hilf + ".attributes.assistModeUsage01.name").val;   
                                                var ModeUsage01_assistModeUsage = getState("bosch-ebike.0.trips." + hilf + ".attributes.assistModeUsage01.assistModeUsage").val;  
                                                var ModeUsage01_color = getState("bosch-ebike.0.trips." + hilf + ".attributes.assistModeUsage02.color").val;  
                                                var ModeUsage02_name = getState("bosch-ebike.0.trips." + hilf + ".attributes.assistModeUsage02.name").val;   
                                                var ModeUsage02_assistModeUsage = getState("bosch-ebike.0.trips." + hilf + ".attributes.assistModeUsage02.assistModeUsage").val;  
                                                var ModeUsage02_color = getState("bosch-ebike.0.trips." + hilf + ".attributes.assistModeUsage03.color").val; 
                                                var ModeUsage03_name = getState("bosch-ebike.0.trips." + hilf + ".attributes.assistModeUsage03.name").val;   
                                                var ModeUsage03_assistModeUsage = getState("bosch-ebike.0.trips." + hilf + ".attributes.assistModeUsage03.assistModeUsage").val;  
                                                var ModeUsage03_color = getState("bosch-ebike.0.trips." + hilf + ".attributes.assistModeUsage04.color").val; 
                                                var ModeUsage04_name = getState("bosch-ebike.0.trips." + hilf + ".attributes.assistModeUsage04.name").val;   
                                                var ModeUsage04_assistModeUsage = getState("bosch-ebike.0.trips." + hilf + ".attributes.assistModeUsage04.assistModeUsage").val;  
                                                var ModeUsage04_color = getState("bosch-ebike.0.trips." + hilf + ".attributes.assistModeUsage05.color").val; 
                                                var ModeUsage05_name = getState("bosch-ebike.0.trips." + hilf + ".attributes.assistModeUsage05.name").val;   
                                                var ModeUsage05_assistModeUsage = getState("bosch-ebike.0.trips." + hilf + ".attributes.assistModeUsage05.assistModeUsage").val;  
                                                var ModeUsage05_color = getState("bosch-ebike.0.trips." + hilf + ".attributes.assistModeUsage05.color").val; 
                                               
                                                var date = formatDate(startTime, "TT.MM.JJJJ SS:mm")
                                                
                                                string = string + '<td>'
                                                string = string + date + ' ' + distance/1000 + " KM"
                                                string = string + '<table border=0>'
                                          
                                                  string = string + '<tr>'
                                                    string = string + '<td bgcolor=yellow>'
                                                      string = string + ModeUsage01_name
                                                    string = string + '</td>'
                                                    string = string + '<td bgcolor=blue>'
                                                      string = string + ModeUsage02_name
                                                    string = string + '</td>'
                                                    string = string + '<td bgcolor=green>'
                                                      string = string + ModeUsage03_name
                                                    string = string + '</td>'
                                                    string = string + '<td bgcolor=orange>'
                                                      string = string + ModeUsage04_name
                                                    string = string + '</td>'
                                                    string = string + '<td bgcolor=red>'
                                                      string = string + ModeUsage05_name
                                                    string = string + '</td>'
                                                  string = string + '</tr>'
                                          
                                                  string = string + '<tr>' 
                                                    string = string + '<td>'
                                                      string = string + ModeUsage01_assistModeUsage/1000
                                                    string = string + '</td>'
                                                    string = string + '<td>'
                                                      string = string + ModeUsage02_assistModeUsage/1000
                                                    string = string + '</td>'
                                                    string = string + '<td>'
                                                      string = string + ModeUsage03_assistModeUsage/1000
                                                    string = string + '</td>'
                                                    string = string + '<td>'
                                                      string = string + ModeUsage04_assistModeUsage/1000
                                                    string = string + '</td>'
                                                    string = string + '<td>'
                                                      string = string + ModeUsage05_assistModeUsage/1000
                                                    string = string + '</td>'
                                                  string = string + '</tr>'
                                          
                                                  var Prokm = distance /100
                                                 
                                                  string = string + '<tr>'
                                                    string = string + '<td>'
                                                      string = string + Math.round(ModeUsage01_assistModeUsage/Prokm) + ' %'
                                                    string = string + '</td>'
                                                    string = string + '<td>'
                                                      string = string + Math.round(ModeUsage02_assistModeUsage/Prokm) + ' %'
                                                    string = string + '</td>'
                                                    string = string + '<td>'
                                                      string = string + Math.round(ModeUsage03_assistModeUsage/Prokm) + ' %'
                                                    string = string + '</td>'
                                                    string = string + '<td>'
                                                      string = string + Math.round(ModeUsage04_assistModeUsage/Prokm) + ' %'
                                                    string = string + '</td>'
                                                    string = string + '<td>'
                                                      string = string + Math.round(ModeUsage05_assistModeUsage/Prokm) + ' %'
                                                    string = string + '</td>'
                                                  string = string + '</tr>'        
                                          
                                                string = string + '</table>'
                                               
                                          
                                                  var poly =""; 
                                                  var string3 = "";
                                                  var obj = JSON.parse(getState("bosch-ebike.0.trips." + hilf + ".details").val); 
                                                                 
                                                  var end = obj.activityData.length - 1;
                                                  var center_gps = '"' + obj.activityData[30].lat + ', ' + obj.activityData[30].lon + '"';
                                           
                                          
                                              for (var x=0; x<=end; x++) {
                                                  if (obj.activityData[x].lat != null)        {
                                                    poly = poly + "["+obj.activityData[x].lat+", "+obj.activityData[x].lon+"]"
                                                  if (x < end) poly = poly + ","
                                                  }
                                                  else      {        
                                                  }
                                              }
                                              if (logging) log (poly);
                                          
                                              
                                          string = string + '</td>'
                                          string = string + '<td>'
                                                   
                                              var center_gps = "48.90376, 11.93504";    // Mittelpunkt der Karte
                                              var zoom = 11       
                                              
                                              string = string + '<link rel="stylesheet" href="https://unpkg.com/leaflet@1.6.0/dist/leaflet.css"integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ=="crossorigin=""/></head>\n'
                                              string = string + '<body>\n<div id="map' + hilf + '" style="width: 600px; height: 400px"></div>\n<script src="https://unpkg.com/leaflet@1.6.0/dist/leaflet.js"integrity="sha512-gZwIG9x3wUXg2hdXF6+rVkLF/0Vi9U8D2Ntg4Ga5I5BZpVkVxlJWbSQtXPSiUTtC0TjtGOmxa1AJPuV0CPthew=="crossorigin=""></script>\n<script>\n'
                                          
                                              string = string + "var map"+  hilf + " = L.map('map" + hilf + "').setView([" + center_gps + "], " + zoom + ");\n"
                                            
                                             
                                              string = string + "mapLink = '<a href=" + '"http://openstreetmap.org"' + ">OpenStreetMap</a>';\n"
                                              string = string + "L.tileLayer( 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {attribution: '&copy; ' + mapLink + ' Contributors', maxZoom: 18,}).addTo(map" + hilf + ");\n"
                                              
                                              string = string + 'var polyline = L.polyline([ \n' + poly + '\n], { color: "blue", weight: 3, opacity: .7, lineJoin: "round" } ).addTo(map' + hilf + ');\n'
                                              string = string + '</script>\n'
                                          string = string + '</td>'
                                          
                                          
                                          
                                          
                                          string = string + '</tr>'
                                             });                        
                                              
                                              
                                          
                                          
                                              string = string + '</body>\n</html>'
                                             
                                              writeFile("vis.0", "/" + pfad, string, (error) => {
                                                  if (logging) log('Datei "" gespeichert!');
                                              });
                                          
                                          
                                          
                                          
                                          ChaotC Offline
                                          ChaotC Offline
                                          Chaot
                                          wrote on last edited by
                                          #176

                                          @schienw Danke für dein Script.
                                          Irgendwie bekomme ich das bei mir nicht so richtig zum laufen.
                                          Alle Datenpunkte scheinen vorhanden zu sein, aber es wird keine Date erzeugt.
                                          Muss ich da noch irgendwas beachten?

                                          ioBroker auf NUC unter Proxmox; VIS: 12" Touchscreen und 17" Touch; Lichtsteuerung, Thermometer und Sensoren: Tasmota (39); Ambiente Beleuchtung: WLED (9); Heizung: DECT Thermostate (9) an Fritz 6690; EMS-ESP; 1 Echo V2; 3 Echo DOT; 1 Echo Connect; 2 Echo Show 5; Unifi Ap-Ac Lite.

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          Support us

                                          ioBroker
                                          Community Adapters
                                          Donate

                                          420

                                          Online

                                          32.4k

                                          Users

                                          81.4k

                                          Topics

                                          1.3m

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

                                          • Don't have an account? Register

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