Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Off Topic
    4. Microcontroller
    5. JK-BMS über RS485 mit ESPHome auslesen

    NEWS

    • [erledigt] 15. 05. Wartungsarbeiten am ioBroker Forum

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    JK-BMS über RS485 mit ESPHome auslesen

    This topic has been deleted. Only users with topic management privileges can see it.
    • Homoran
      Homoran Global Moderator Administrators @Marco 3 last edited by Homoran

      @marco-3 sagte in JK-BMS über RS485 mit ESPHome auslesen:

      Wäre sehr schön, wenn wir den JKBMS (bald sind es 2) zum fliegen bekommen,

      ich auch
      https://forum.iobroker.net/post/1082344

      und da ist noch einer
      https://forum.iobroker.net/post/1095743
      mit einer etwas anderen Konstellation

      1 Reply Last reply Reply Quote 0
      • syssi
        syssi @Marco 3 last edited by syssi

        @marco-3 Man benötigt kein Home Assistant um eine ESPHome Node zu bauen & zu flashen. Eigentlich ist ESPHome ein Kommandozeilen-Tool, in welches man eine YAML-Datei hinein füttert, welche dann zu C++-Code umgewandelt, compiliert und auf den nächstbesten (im ersten Schritt am USB-Port steckenden) ESP geflasht wird.

        Versuche dich mal an dieser Schritt-für-Schritt-Anleitung entlang zu hangeln. Es kann sein, dass es sich nicht um die perfekte Anleitung handelt, wenn man aus dem ioBroker-Universum kommt aber ich weiß es nicht besser. 😉

        1. Schnapp dir eine aktuelle Ubuntu-VM
        2. Installiere den Python-Paketmanager "pipx": sudo apt-get install pipx
        3. Nutze den Paketmanager (als normaler User) um das aktuellste ESPHome-Release zu installieren pipx install esphome. Die Installation legt hier eine ausführbare Datei hin: ~/.local/bin/esphome

        Nun hast du bereits alle Werkzeuge beisammen. Per

        ~/.local/bin/esphome run example.yaml
        

        könntest du deine erste YAML-Datei (example.yaml) interpretieren, compilieren und flashen. Im letzten Schritt der Operation run listet das Tool alle verfügbaren Wege einen ESP zu flashen. Für den Anfang muss der ESP per USB-Kabel angesteckt sein, dann wird er gefunden und zur Auswahl gestellt.

        M 1 Reply Last reply Reply Quote 0
        • M
          Marco 3 @syssi last edited by Marco 3

          @syssi
          danke, dass gehe ich mit an...

          Ubuntu ist in der VM drauf ubuntu-22.04.3-desktop-amd64 --> esphome ist laut deinen Schritten installiert.
          ABER:

          ubuntu@ubuntu-virtual-machine:~/Schreibtisch$ ~/.local/bin/esphome run example.yaml
          INFO ESPHome 2023.12.5
          INFO Reading configuration example.yaml...
          ERROR Error while reading config: Invalid YAML syntax:
          
          Error reading file example.yaml: [Errno 2] No such file or directory: 'example.yaml'
          ubuntu@ubuntu-virtual-machine:~/Schreibtisch$ 
          
          

          Ich brech hier mal kurz ab. Ich habe gerade von HOMEassitent in VM für VMware gefunden und versuche dies nun über die VMware bis zum ESPhome zu treiben, um eine Grafische Oberfläche zu haben.
          in der reinen Kommandozeilenwelt, ist bei mir, doch die Fehlerquote sehr hoch....

          Auch der Versuch scheitert bei mir, ich leg es erst mal auf Eis.

          syssi 1 Reply Last reply Reply Quote 0
          • syssi
            syssi @Marco 3 last edited by

            @marco-3 Nur die Ruhe. Wir haben uns lediglich falsch verstanden. "example.yaml" ist der Dateiname einer beliebigen Konfiguration, welche erstmal (in deinem Fall) auf dem Schreibtisch/Desktop liegen muss bevor sie verarbeitet werden kann.

            Ist meine Annahme richtig, dass du eine JK-BMS per Bluetooth auslesen willst? In diesem Fall schnappst du dir diese Datei:

            https://github.com/syssi/esphome-jk-bms/blob/main/esp32-ble-example.yaml

            Zum Beispiel als RAW-Download:

            https://raw.githubusercontent.com/syssi/esphome-jk-bms/main/esp32-ble-example.yaml

            Dann musst du einmal im Kopf die Variable mac_address auf die MAC-Adresse deines Gerätes aktualisieren. Danach suchst du dir deinen Weg, wie diese Datei auf deinen Schreibtisch/Desktop in die VM kommt. Nun startest du den Vorgang:

             ~/.local/bin/esphome run esp32-ble-example.yaml
            

            Im besten Fall stellst du vorher noch sicher, dass der ESP sauber per USB an die VM durchgereicht ist.

            M 1 Reply Last reply Reply Quote 0
            • M
              Marco 3 @syssi last edited by Marco 3

              @syssi
              Danke für die fixe Antwort.

              Mein aktueller Fortschritt:
              Diese Anleitung habe ich genommen.
              https://www.youtube.com/watch?v=KEkkUogxt60

              1. https://www.virtualbox.org/wiki/Downloads --> auf den Win10 Rechner installiert
              2. https://www.home-assistant.io/installation/windows --> das .vdi eingepflegt
              3. die USB Ports alle durchgeleitet in Virtual Box
              4. den ESP32 erfolgreich mit der W-Lan Verbindung verbunden. -> jetzt sollte OTA-Flashen funktionieren.
              5. https://github.com/syssi/esphome-jk-bms/blob/main/esp32-ble-example.yaml und die MAC angepast --> er verbindet und es kommen Daten.
              6. jetzt noch die MQTT Adressen anpassen --> ongoing
              syssi 1 Reply Last reply Reply Quote 0
              • syssi
                syssi @Marco 3 last edited by

                Super! Ich hatte in der Vergangenheit den ein oder anderen ioBroker-User, bei welchen die Einstellungen des MQTT-Adapters zu einem Absturz des ESPs geführt haben. Es gibt bei ioBroker die Option, dass der neue MQTT-User erstmal mit Nachrichten geflutet werden soll. Dies überfordert den ESP und er crasht. Schaltet man die Option aus, läuft der Betrieb in der Regel stabil. Du scheinst nicht über diesen Punkt gestolpert zu sein.

                M 1 Reply Last reply Reply Quote 0
                • M
                  Marco 3 @syssi last edited by

                  @syssi
                  noch nicht.... bin noch nicht weiter gekommen, ich glaub da ist was mit den Leerzeichen..... bringt Fehler bei der IP Zeile und Passwort usw..... kann an das auch in die Secret Zeile irgend wie einpflegen?

                  mach dann in ca. 2h weiter...

                  syssi 1 Reply Last reply Reply Quote 0
                  • Homoran
                    Homoran Global Moderator Administrators last edited by

                    ich störe nur ungern!

                    aber hat das noch was mit Einsteigerfragen zu ioBroker zu tun?

                    1 Reply Last reply Reply Quote 0
                    • syssi
                      syssi @Marco 3 last edited by

                      @marco-3 Anstatt die Secrets in der secrets.yaml zu pflegen, welche im gleichen Verzehnis liegen muss, kannst du die Stellen auch gegen hardcodierte Werte ersetzen:

                      # vorher
                      mqtt:
                        broker: !secret mqtt_host
                        username: !secret mqtt_username
                        password: !secret mqtt_password
                        id: mqtt_client
                      
                      # nachher
                      mqtt:
                        broker: 192.168.1.2
                        username: MQTT_USERNAME
                        password: MQTT_PASSWORD
                        id: mqtt_client
                      

                      Solltest du zu den ioBroker-Nutzern gehören, die ihren Broker ohne Benutzername und Passwort betreiben, kannst du diese Zeilen auch entfernen:

                      mqtt:
                        broker: 192.168.1.2
                        port: 1883
                      
                      M 1 Reply Last reply Reply Quote 0
                      • M
                        Marco 3 @syssi last edited by Marco 3

                        @syssi

                        ich habe erst hard codiert probiert, da gab es Fehler beim compilen.
                        mit Pflege der secrets.yaml hat das compilen und hochladen funktioniert.

                        Aber es kommt nichts im iobroker an --> STOP --> ich hab das # entfernen vom MQTT vergessen....JETZT kommt was im iobroker MQTT an!

                        Das logging unter HA loggt folgendes:

                        21:06:35][D][jk_bms_ble:663]: Unknown168: C0.06.00.00.00.00.00.00.00.00.00.00.00.00.07.00.01.00.00.00.29.04.00.00.00.00.A4.18.3F.40.00.00.00.00.E2.04.00.00.00.00.00.01.00.05.00.00 (46)
                        [21:06:35][D][jk_bms_ble:677]: Unknown189: 0x04 0x00
                        [21:06:35][D][jk_bms_ble:681]: Unknown192: 0x00
                        [21:06:35][D][jk_bms_ble:683]: Unknown193: 0x00 0xA4 (0x00 0x8D)
                        [21:06:35][D][jk_bms_ble:685]: Unknown195: 0x18 0x3F (0x21 0x40)
                        [21:06:35][W][component:214]: Component esp32_ble took a long time for an operation (0.56 s).
                        [21:06:35][W][component:215]: Components should block for at most 20-30ms.
                        [21:06:40][I][jk_bms_ble:467]: Cell info frame (version 2, 300 bytes) received
                        [21:06:40][D][sensor:094]: 'bms1 cell voltage 1': Sending state 3.31500 V with 3 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 cell resistance 1': Sending state 0.03800 Ω with 3 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 cell voltage 2': Sending state 3.31600 V with 3 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 cell resistance 2': Sending state 0.03800 Ω with 3 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 cell voltage 3': Sending state 3.31600 V with 3 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 cell resistance 3': Sending state 0.03800 Ω with 3 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 cell voltage 4': Sending state 3.31800 V with 3 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 cell resistance 4': Sending state 0.03800 Ω with 3 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 cell voltage 5': Sending state 3.31800 V with 3 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 cell resistance 5': Sending state 0.03700 Ω with 3 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 cell voltage 6': Sending state 3.31800 V with 3 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 cell resistance 6': Sending state 0.03700 Ω with 3 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 cell voltage 7': Sending state 3.31600 V with 3 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 cell resistance 7': Sending state 0.03700 Ω with 3 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 cell voltage 8': Sending state 3.31600 V with 3 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 cell resistance 8': Sending state 0.03800 Ω with 3 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 cell voltage 9': Sending state 3.31800 V with 3 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 cell resistance 9': Sending state 0.03700 Ω with 3 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 cell voltage 10': Sending state 3.31600 V with 3 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 cell resistance 10': Sending state 0.03700 Ω with 3 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 cell voltage 11': Sending state 3.31800 V with 3 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 cell resistance 11': Sending state 0.03700 Ω with 3 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 cell voltage 12': Sending state 3.31600 V with 3 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 cell resistance 12': Sending state 0.03700 Ω with 3 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 cell voltage 13': Sending state 3.31600 V with 3 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 cell voltage 14': Sending state 3.31600 V with 3 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 cell voltage 15': Sending state 3.31800 V with 3 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 min voltage cell': Sending state 2.00000  with 0 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 temperature sensor 2': Sending state 10.50000 °C with 1 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 power tube temperature': Sending state 11.90000 °C with 1 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 errors bitmask': Sending state 0.00000  with 0 decimals of accuracy
                        [21:06:40][D][text_sensor:064]: 'bms1 errors': Sending state ''
                        [21:06:40][D][sensor:094]: 'bms1 balancing current': Sending state 0.00000 A with 2 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 state of charge': Sending state 77.00000 % with 0 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 capacity remaining': Sending state 216.96301 Ah with 3 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 total battery capacity setting': Sending state 280.00000 Ah with 0 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 charging cycles': Sending state 140.00000  with 0 decimals of accuracy
                        [21:06:40][D][sensor:094]: 'bms1 total charging cycle capacity': Sending state 39417.99219 Ah with 3 decimals of accuracy
                        [21:06:40][D][jk_bms_ble:647]: Unknown158: 0x64 0x00 (always 0x64 0x00?)
                        [21:06:40][D][jk_bms_ble:650]: Unknown160: 0x7D 0x02 (always 0xC5 0x09?)
                        [21:06:40][D][sensor:094]: 'bms1 total runtime': Sending state 31019928.00000 s with 0 decimals of accuracy
                        [21:06:40][D][text_sensor:064]: 'bms1 total runtime formatted': Sending state '359d '
                        [21:06:40][D][jk_bms_ble:663]: Unknown168: C0.06.00.00.00.00.00.00.00.00.00.00.00.00.07.00.01.00.00.00.29.04.00.00.00.00.A4.18.3F.40.00.00.00.00.E2.04.00.00.00.00.00.01.00.05.00.00 (46)
                        [21:06:40][D][jk_bms_ble:677]: Unknown189: 0x04 0x00
                        [21:06:40][D][jk_bms_ble:681]: Unknown192: 0x00
                        [21:06:40][D][jk_bms_ble:683]: Unknown193: 0x00 0xA4 (0x00 0x8D)
                        [21:06:45][I][jk_bms_ble:467]: Cell info frame (version 2, 300 bytes) received
                        [21:06:45][D][sensor:094]: 'bms1 cell voltage 1': Sending state 3.31800 V with 3 decimals of accuracy
                        [21:06:45][D][sensor:094]: 'bms1 cell resistance 1': Sending state 0.03800 Ω with 3 decimals of accuracy
                        [21:06:45][D][sensor:094]: 'bms1 cell voltage 2': Sending state 3.31800 V with 3 decimals of accuracy
                        [21:06:45][D][sensor:094]: 'bms1 cell resistance 2': Sending state 0.03800 Ω with 3 decimals of accuracy
                        [21:06:45][D][sensor:094]: 'bms1 cell voltage 3': Sending state 3.31600 V with 3 decimals of accuracy
                        [21:06:45][D][sensor:094]: 'bms1 cell resistance 3': Sending state 0.03800 Ω with 3 decimals of accuracy
                        [21:06:45][D][sensor:094]: 'bms1 cell voltage 4': Sending state 3.31600 V with 3 decimals of accuracy
                        [21:06:45][D][sensor:094]: 'bms1 cell resistance 4': Sending state 0.03800 Ω with 3 decimals of accuracy
                        [21:06:45][D][sensor:094]: 'bms1 cell voltage 5': Sending state 3.31800 V with 3 decimals of accuracy
                        [21:06:45][D][sensor:094]: 'bms1 cell resistance 5': Sending state 0.03700 Ω with 3 decimals of accuracy
                        [21:06:45][D][sensor:094]: 'bms1 cell voltage 6': Sending state 3.31600 V with 3 decimals of accuracy
                        [21:06:45][D][sensor:094]: 'bms1 cell resistance 6': Sending state 0.03700 Ω with 3 decimals of accuracy
                        [21:06:45][D][sensor:094]: 'bms1 cell voltage 7': Sending state 3.31800 V with 3 decimals of accuracy
                        [21:06:45][D][sensor:094]: 'bms1 cell resistance 7': Sending state 0.03700 Ω with 3 decimals of accuracy
                        [21:06:45][D][sensor:094]: 'bms1 cell voltage 8': Sending state 3.31600 V with 3 decimals of accuracy
                        [21:06:45][D][sensor:094]: 'bms1 cell resistance 8': Sending state 0.03800 Ω with 3 decimals of accuracy
                        [21:06:45][D][sensor:094]: 'bms1 cell voltage 9': Sending state 3.31800 V with 3 decimals of accuracy
                        [21:06:45][D][sensor:094]: 'bms1 cell resistance 9': Sending state 0.03700 Ω with 3 decimals of accuracy
                        [21:06:45][D][sensor:094]: 'bms1 cell voltage 10': Sending state 3.31600 V with 3 decimals of accuracy
                        [21:06:45][D][sensor:094]: 'bms1 cell resistance 10': Sending state 0.03700 Ω with 3 decimals of accuracy
                        [21:06:45][D][sensor:094]: 'bms1 cell voltage 11': Sending state 3.31600 V with 3 decimals of accuracy
                        [21:06:45][D][sensor:094]: 'bms1 cell resistance 11': Sending state 0.03700 Ω with 3 decimals of accuracy
                        [21:06:45][D][sensor:094]: 'bms1 cell voltage 12': Sending state 3.31600 V with 3 decimals of accuracy
                        [21:06:45][D][sensor:094]: 'bms1 cell resistance 12': Sending state 0.03700 Ω with 3 decimals of accuracy
                        [21:06:45][D][sensor:094]: 'bms1 cell voltage 14': Sending state 3.31800 V with 3 decimals of accuracy
                        [21:06:45][D][sensor:094]: 'bms1 cell resistance 14': Sending state 0.03700 Ω with 3 decimals of accuracy
                        [21:06:46][D][sensor:094]: 'bms1 cell voltage 15': Sending state 3.31800 V with 3 decimals of accuracy
                        [21:06:46][D][sensor:094]: 'bms1 cell resistance 15': Sending state 0.03700 Ω with 3 decimals of accuracy
                        [21:06:46][D][sensor:094]: 'bms1 min voltage cell': Sending state 2.00000  with 0 decimals of accuracy
                        [21:06:46][D][jk_bms_ble:557]: Unknown112: 0x00 0x00
                        [21:06:46][D][jk_bms_ble:562]: Wire resistance warning bitmask: 0x00 0x00 0x00 0x00
                        [21:06:46][D][sensor:094]: 'bms1 total voltage': Sending state 53.07000 V with 2 decimals of accuracy
                        [21:06:46][D][sensor:094]: 'bms1 current': Sending state 0.00000 A with 2 decimals of accuracy
                        [21:06:46][D][sensor:094]: 'bms1 power': Sending state 0.00000 W with 2 decimals of accuracy
                        [21:06:46][D][sensor:094]: 'bms1 state of charge': Sending state 77.00000 % with 0 decimals of accuracy
                        [21:06:46][D][sensor:094]: 'bms1 capacity remaining': Sending state 216.96301 Ah with 3 decimals of accuracy
                        [21:06:46][D][sensor:094]: 'bms1 total battery capacity setting': Sending state 280.00000 Ah with 0 decimals of accuracy
                        [21:06:46][D][sensor:094]: 'bms1 charging cycles': Sending state 140.00000  with 0 decimals of accuracy
                        [21:06:46][D][jk_bms_ble:681]: Unknown192: 0x00
                        [21:06:46][D][jk_bms_ble:683]: Unknown193: 0x00 0xA4 (0x00 0x8D)
                        [21:06:46][D][jk_bms_ble:685]: Unknown195: 0x18 0x3F (0x21 0x40)
                        [21:06:46][W][component:214]: Component esp32_ble took a long time for an operation (0.55 s).
                        [21:06:46][W][component:215]: Components should block for at most 20-30ms.
                        [21:06:50][I][jk_bms_ble:467]: Cell info frame (version 2, 300 bytes) received
                        [21:06:50][D][sensor:094]: 'bms1 cell voltage 1': Sending state 3.31800 V with 3 decimals of accuracy
                        [21:06:50][D][sensor:094]: 'bms1 cell resistance 1': Sending state 0.03800 Ω with 3 decimals of accuracy
                        [21:06:50][D][sensor:094]: 'bms1 cell voltage 2': Sending state 3.31600 V with 3 decimals of accuracy
                        [21:06:50][D][sensor:094]: 'bms1 cell resistance 2': Sending state 0.03800 Ω with 3 decimals of accuracy
                        [21:06:50][D][sensor:094]: 'bms1 cell voltage 3': Sending state 3.31500 V with 3 decimals of accuracy
                        [21:06:50][D][sensor:094]: 'bms1 cell resistance 3': Sending state 0.03800 Ω with 3 decimals of accuracy
                        [21:06:50][D][sensor:094]: 'bms1 cell voltage 4': Sending state 3.31600 V with 3 decimals of accuracy
                        [21:06:50][D][sensor:094]: 'bms1 cell resistance 4': Sending state 0.03800 Ω with 3 decimals of accuracy
                        [21:06:51][D][sensor:094]: 'bms1 cell voltage 5': Sending state 3.31800 V with 3 decimals of accuracy
                        [21:06:51][D][sensor:094]: 'bms1 cell resistance 5': Sending state 0.03700 Ω with 3 decimals of accuracy
                        [21:06:51][D][sensor:094]: 'bms1 cell voltage 6': Sending state 3.31500 V with 3 decimals of accuracy
                        [21:06:51][D][sensor:094]: 'bms1 cell resistance 6': Sending state 0.03700 Ω with 3 decimals of accuracy
                        [21:06:51][D][sensor:094]: 'bms1 cell voltage 7': Sending state 3.31600 V with 3 decimals of accuracy
                        [21:06:51][D][sensor:094]: 'bms1 cell resistance 7': Sending state 0.03700 Ω with 3 decimals of accuracy
                        [21:06:51][D][sensor:094]: 'bms1 cell voltage 8': Sending state 3.31600 V with 3 decimals of accuracy
                        [21:06:51][D][sensor:094]: 'bms1 cell resistance 8': Sending state 0.03800 Ω with 3 decimals of accuracy
                        [21:06:51][D][sensor:094]: 'bms1 cell voltage 9': Sending state 3.31800 V with 3 decimals of accuracy
                        [21:06:51][D][sensor:094]: 'bms1 cell resistance 9': Sending state 0.03700 Ω with 3 decimals of accuracy
                        [21:06:51][D][sensor:094]: 'bms1 cell voltage 10': Sending state 3.31600 V with 3 decimals of accuracy
                        [21:06:51][D][sensor:094]: 'bms1 cell voltage 12': Sending state 3.31800 V with 3 decimals of accuracy
                        [21:06:51][D][sensor:094]: 'bms1 cell resistance 12': Sending state 0.03700 Ω with 3 decimals of accuracy
                        [21:06:51][D][sensor:094]: 'bms1 cell voltage 13': Sending state 3.31600 V with 3 decimals of accuracy
                        [21:06:51][D][sensor:094]: 'bms1 cell voltage 14': Sending state 3.31800 V with 3 decimals of accuracy
                        [21:06:51][D][sensor:094]: 'bms1 average cell voltage': Sending state 3.31700 V with 3 decimals of accuracy
                        [21:06:51][D][sensor:094]: 'bms1 delta cell voltage': Sending state 0.00200 V with 3 decimals of accuracy
                        [21:06:51][D][sensor:094]: 'bms1 max voltage cell': Sending state 2.00000  with 0 decimals of accuracy
                        [21:06:51][D][sensor:094]: 'bms1 min voltage cell': Sending state 1.00000  with 0 decimals of accuracy
                        [21:06:51][D][jk_bms_ble:557]: Unknown112: 0x00 0x00
                        [21:06:51][D][jk_bms_ble:562]: Wire resistance warning bitmask: 0x00 0x00 0x00 0x00
                        [21:06:51][D][sensor:094]: 'bms1 total voltage': Sending state 53.06800 V with 2 decimals of accuracy
                        [21:06:51][D][sensor:094]: 'bms1 current': Sending state 0.00000 A with 2 decimals of accuracy
                        [21:06:51][D][sensor:094]: 'bms1 discharging power': Sending state 0.00000 W with 2 decimals of accuracy
                        [21:06:51][D][sensor:094]: 'bms1 temperature sensor 1': Sending state 10.10000 °C with 1 decimals of accuracy
                        [21:06:51][D][sensor:094]: 'bms1 temperature sensor 2': Sending state 10.50000 °C with 1 decimals of accuracy
                        [21:06:51][D][sensor:094]: 'bms1 power tube temperature': Sending state 11.90000 °C with 1 decimals of accuracy
                        [21:06:51][D][sensor:094]: 'bms1 errors bitmask': Sending state 0.00000  with 0 decimals of accuracy
                        [21:06:51][D][text_sensor:064]: 'bms1 errors': Sending state ''
                        [21:06:51][D][sensor:094]: 'bms1 balancing current': Sending state 0.00000 A with 2 decimals of accuracy
                        [21:06:51][D][sensor:094]: 'bms1 state of charge': Sending state 77.00000 % with 0 decimals of accuracy
                        [21:06:51][D][sensor:094]: 'bms1 capacity remaining': Sending state 216.96301 Ah with 3 decimals of accuracy
                        [21:06:51][D][sensor:094]: 'bms1 total battery capacity setting': Sending state 280.00000 Ah with 0 decimals of accuracy
                        [21:06:51][D][sensor:094]: 'bms1 charging cycles': Sending state 140.00000  with 0 decimals of accuracy
                        [21:06:51][D][sensor:094]: 'bms1 total charging cycle capacity': Sending state 39417.99219 Ah with 3 decimals of accuracy
                        [21:06:51][D][jk_bms_ble:647]: Unknown158: 0x64 0x00 (always 0x64 0x00?)
                        [21:06:51][D][jk_bms_ble:650]: Unknown160: 0x7D 0x02 (always 0xC5 0x09?)
                        [21:06:51][D][sensor:094]: 'bms1 total runtime': Sending state 31019940.00000 s with 0 decimals of accuracy
                        [21:06:51][D][text_sensor:064]: 'bms1 total runtime formatted': Sending state '359d '
                        [21:06:51][D][jk_bms_ble:663]: Unknown168: C0.06.00.00.00.00.00.00.00.00.00.00.00.00.07.00.01.00.00.00.29.04.00.00.00.00.A4.18.3F.40.00.00.00.00.E2.04.00.00.00.00.00.01.00.05.00.00 (46)
                        [21:06:51][D][jk_bms_ble:677]: Unknown189: 0x04 0x00
                        [21:06:51][D][jk_bms_ble:681]: Unknown192: 0x00
                        
                        
                        1 Reply Last reply Reply Quote 0
                        • M
                          Marco 3 last edited by Marco 3

                          Update:
                          die MQTT habe ich erst einmal deaktiviert. Lief nur 5min

                          Daher habe ich den ESP32 noch einmal neu aufgesetzt. mit aktivem web server

                          web_server:
                            port: 80
                          

                          api erst mal noch aktiviert und MQTT deaktiviert

                          # If you don't use Home Assistant please remove this `api` section and uncomment the `mqtt` component!
                          api:
                          
                          # mqtt:
                          #   broker: !secret mqtt_host
                          #   username: !secret mqtt_username
                          #   password: !secret mqtt_password
                          #   id: mqtt_client
                          

                          Allgemein läuft es ca 5min und dann ist der WEB server nicht mehr erreichbar und der ESP scheint sich aufzuhängen.... es blinkt nicht mehr so wie er es bei aktiver Verbindung macht.

                          Kann ich die api: auch deaktivieren, baut er dann den WEB server trotzdem auf?

                          So wie ich dass nun beobachte, hat er sich gerade von selbst wieder verbunden und liefert wieder Daten an den WEB Server....

                          syssi 1 Reply Last reply Reply Quote 0
                          • syssi
                            syssi @Marco 3 last edited by

                            @marco-3 Die api-Komponente möchte eine aktive Verbindung zu einem HA-Instanz oder ESPHome-Client. Wenn diese fehlt, geht die Node von einem Problem aus und startet neu. So kannst du dieses Verhalten unterbinden:

                            api:
                              reboot_timeout: 0s
                            

                            Die api-Komponente ist praktisch um per ESPHome-Client das Log abzurufen:

                            ~/.local/bin/esphome log esp32-ble-example.yaml
                            

                            Wenn du das nicht brauchst / dir das Log über die Webseite anschaust, kannst du die Zeile auch komplett weg lassen. Die sog. native API ist nur notwendig für direkte Home Assistant oder ESPHome-CLI-Anbindung.

                            1 Reply Last reply Reply Quote 0
                            • M
                              Marco 3 last edited by

                              mqtt:
                                broker: 192.168.178.83
                                port: 1883
                                username: mqttuser
                                password: passwort
                                
                              

                              ich hab den MQTT versucht zu aktivieren, der ESP verbindet und bleibt erst mal verbunden mit dem iobroker.

                              Aber:
                              Screenshot 2024-01-04 125746.png

                              so bringt er es im MQTT Ordner rein.

                              esphome, homeassitant sind nicht gewollt, kommen aber über die Verbindung mit.

                              Ich glaube, aber nicht wissen, gestern hatte ich dies mit bms1 gemacht, da war nur der bms1 Ordner da.

                              Und dieses mal stehen keine Werte drin, nur nan

                              Ich gehe erst einmal wieder zurück... zum anders ESP (Programm BLE 3.4 oder so aus AkkuDoktor Forum)

                              Was mir hier noch aufgefallen ist, wenn man mit BT auf den JK-bms drauf geht, das Piep Feedback.

                              bei:
                              Handy --> biep-biep (und er ist verbunden)
                              ESP (BLE_3.4) --> biep-biep (und er ist verbunden)
                              ESP (esphome) --> biep-------------------------------biep (verbunden, aber manchmal auch nur 1 piep

                              syssi 1 Reply Last reply Reply Quote 0
                              • syssi
                                syssi @Marco 3 last edited by

                                @marco-3 Der Ordner esphome und homeassistant helfen Home Assistant die Node automatisch zu finden und als neues Gerät inkl. seiner Entitäten (Sensoren, Schalter, Bedienelemte, etc.) anzubieten. Du kannst das verhalten deaktivieren:

                                mqtt:
                                  broker: 192.168.178.83
                                  port: 1883
                                  username: mqttuser
                                  password: passwort
                                  discovery: false
                                

                                Anschließend sollte nur noch ein Ordner übrig bleiben, welcher den Hostnamen der ESPHome Node (jk-bms wenn du den Wert unter name: nicht geändert hast) trägt. Hier finden sich alle Messwerte etc.

                                M 1 Reply Last reply Reply Quote 0
                                • M
                                  Marco 3 @syssi last edited by

                                  @syssi
                                  Danke, daß werde ich heute abend probieren.

                                  Jetzt noch die Frage mit dem

                                  Piep, Piep login bei Handy -App

                                  und

                                  dem Piep,........1-4sekunden, Piep --> bei esphome login.

                                  Kann dies mit dem SU - 123456 login und die damit zur Verfügung stehenden "Buttons" zu tuen haben?

                                  Ist es möglich, die SU Rechte zu entkoppeln, um eine eventuelle Fehlbedienung (Ladeschlussspannugng), BMS Balancer Startspannung BMS off, ) zu vermeiden. Quasie nur kucken, aber nix anfassen.

                                  Wenn ich die Zeit heute finde werde ich noch mal einen neuen ESP D1 Mini ESP32 heute flaschen.

                                  Was kann man alles raus hauen, um diesen ESP performant zu machen, das Web Interface eventuell zu lassen, um gleich zu sehen, ob noch Daten kommen. HomeAssistant ist erst mal nicht gewünscht, da ich iobroker bevorzuge, aber die homeassistant Umgbung nutzen möchte, um den ESP zu flashen, ist um einigiges komfortabler, als mit Arduino IDE. (oh man diese Schachtelsätze) 🙂

                                  syssi 1 Reply Last reply Reply Quote 0
                                  • syssi
                                    syssi @Marco 3 last edited by

                                    @marco-3

                                    Piep, Piep login bei Handy -App

                                    Das BMS piept pro empfangenem Befehl. Ich würde nicht am piepen festmachen, ob etwas nicht funktioniert. Das Logbuch ist aussagekräftiger. Wenn etwas nicht wie erwartet funktioniert, bitte das Logbuch posten!

                                    Kann dies mit dem SU - 123456 login und die damit zur Verfügung stehenden "Buttons" zu tuen haben?

                                    Die JK-BMS-App behauptet zwar ein Passwort zu benötigen und zwar jenes, was im BMS hinterlegt ist. Das BMS sendet dieses Passwort aber in der Willkommensnachricht und die App vergleicht den Wert mit deiner Eingabe. Die ESPHome-Implementierung verzichtet auf diese vorgegaukelte Sicherheit. Man kann immer in das BMS schreiben. Auch ohne Passwort.

                                    Ist es möglich, die SU Rechte zu entkoppeln, um eine eventuelle Fehlbedienung (Ladeschlussspannugng), BMS Balancer Startspannung BMS off, ) zu vermeiden. Quasie nur kucken, aber nix anfassen.

                                    Du kannst alle Entitäten/Zeilen aus der YAML-Datei löschen, welche du nicht willst. Zum Beispiel löschst du den gesamten switch-Block und den number-Block. Dann bleiben nur noch Lese-Operationen (sensor, binary_sensor) übrig.

                                    Was kann man alles raus hauen, um diesen ESP performant zu machen, das Web Interface eventuell zu lassen, um gleich zu sehen, ob noch Daten kommen. HomeAssistant ist erst mal nicht gewünscht, da ich iobroker bevorzuge, aber die homeassistant Umgbung nutzen möchte, um den ESP zu flashen, ist um einigiges komfortabler, als mit Arduino IDE. (oh man diese Schachtelsätze)

                                    Der Webserver ist das größte Schwergewicht für welches du dich nur entscheiden konntest. Die api-Komponente ist die leichtgewichtigste Implementierung. Danach kommt mqtt. Dann kommt lange lange nichts und dann der Webserver. Trenn dich lieber vom Webserver und prüfe die Werte immer via MQTT.

                                    1 Reply Last reply Reply Quote 0
                                    • M
                                      Marco 3 last edited by Marco 3

                                      Der Webserver ist das größte Schwergewicht für welches du dich nur entscheiden konntest. Die api-Komponente ist die leichtgewichtigste Implementierung. Danach kommt mqtt. Dann kommt lange lange nichts und dann der Webserver. Trenn dich lieber vom Webserver und prüfe die Werte immer via MQTT.

                                      wird gemacht, Danke noch mal für die immer nett bleibende und ausfühlichen Erklärungen!

                                      Eine Frage, noch... wie entscheident ist diese Angabe im .yaml

                                      esp32:
                                        board: wemos_d1_mini32
                                        framework:
                                          type: esp-idf
                                      

                                      dies habe ich auf diese Werte, bei der der manuellen ESP Auswahl geändert.
                                      Ich glaube es war so, das habe ich hier gerade nicht vorliegen

                                      esp32:
                                        board: ESP32dev
                                        framework:
                                          type: adruino
                                      
                                      syssi 1 Reply Last reply Reply Quote 0
                                      • syssi
                                        syssi @Marco 3 last edited by

                                        @marco-3 In der Vergangenheit war der Bluetooth-Stack aus dem Arduino-Framework kaputt/instabiler, als wenn man unmittelbar auf ESP-IDF setzt. Konkreter gesprochen: Das JK-BMS sendet 150 Bytes lange Notifications, welche wenn ich mich richtig erinnere so im BLE-Spec nicht vorgesehen sind. Das Arduino-Framework crasht beim Empfang einer solchen Nachricht. Der Kern unten drunter (ESP-IDF) steckt diese große Nachricht einfach weg. Es ist aber möglich, dass es sich um eine Problematik aus der Vergangenheit handelt, da es mittlerweile auch Nutzer gibt die aktiv das Arduino-Framework nutzen. Wenn du mich fragst, dann ist ESP-IDF der puristischere und stabilere Weg.

                                        M 1 Reply Last reply Reply Quote 0
                                        • M
                                          Marco 3 @syssi last edited by Marco 3

                                          @syssi
                                          Danke, sehr viel herraus genommen.
                                          nur bei number meckert es beim komplieren
                                          immer wenn ich den

                                          number:

                                          Bereich lösche.

                                          |-- ArduinoJson @ 6.18.5
                                          *** [.pioenvs/bms1/src/esphome/components/jk_bms_ble/number/jk_number.o] Source `src/esphome/components/jk_bms_ble/number/jk_number.cpp' not found, needed by target `.pioenvs/bms1/src/esphome/components/jk_bms_ble/number/jk_number.o'.
                                          
                                          syssi 1 Reply Last reply Reply Quote 0
                                          • syssi
                                            syssi @Marco 3 last edited by

                                            Ein Clean-Build wird das Problem lösen:

                                            ~/.local/bin/esphome clean esp32-ble-example.yaml
                                            ~/.local/bin/esphome run esp32-ble-example.yaml
                                            
                                            M 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            683
                                            Online

                                            31.6k
                                            Users

                                            79.5k
                                            Topics

                                            1.3m
                                            Posts

                                            arduino esphome iobroker jk-bms
                                            11
                                            94
                                            11519
                                            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