ich möchte die Daten eines BMS mit einem Wemos D1 abfragen und an HA senden.
Ich habe dazu eine “fertig” .yaml mit dem API-Key, den WLAN-Infos usw. gefüttert und wollte diese dann mit “Install” → “Manual Download” die erzeugte .bin speichern um diese dann im Anschluss per ESPHome Web auf den Wemos zu schreiben.
Leider gelingt es mir nicht an die fertige .bin zu kommen.
Ich erhalte folgende Fehlermeldung und ich komme nicht weiter.
Ich versuche es mal zu erklären wie ich es versuche und aktuell auch per OTA scheitere.
Neues Device
den Key und den yaml Code kopieren.
ich nehme diesen Code:
substitutions:
name: jk-bms
device_description: "Monitor and control a JK-BMS via bluetooth"
external_components_source: github://syssi/esphome-jk-bms@main
mac_address: C8:47:8C:E1:E2:AA
# Please use "JK02_24S" if you own a old JK-BMS < hardware version 11.0 (hardware version >= 6.0 and < 11.0)
# Please use "JK02_32S" if you own a new JK-BMS >= hardware version 11.0 (f.e. JK-B2A8S20P hw 11.XW, sw 11.26)
# Please use "JK04" if you have some old JK-BMS <= hardware version 3.0 (f.e. JK-B2A16S hw 3.0, sw. 3.3.0)
protocol_version: JK02_24S
esphome:
name: ${name}
comment: ${device_description}
min_version: 2024.6.0
project:
name: "syssi.esphome-jk-bms"
version: 2.1.0
esp32:
board: wemos_d1_mini32
framework:
type: esp-idf
external_components:
- source: ${external_components_source}
refresh: 0s
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ota:
platform: esphome
on_begin:
then:
- switch.turn_off: ble_client_switch0
- logger.log: "BLE connection suspended for OTA update"
logger:
level: DEBUG
logs:
esp32_ble_tracker: INFO
esp32_ble_client: INFO
# 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
esp32_ble_tracker:
scan_parameters:
active: false
ble_client:
- mac_address: ${mac_address}
id: client0
jk_bms_ble:
- ble_client_id: client0
protocol_version: ${protocol_version}
throttle: 5s
id: bms0
binary_sensor:
- platform: jk_bms_ble
balancing:
name: "${name} balancing"
charging:
name: "${name} charging"
discharging:
name: "${name} discharging"
heating:
name: "${name} heating"
online_status:
name: "${name} online status"
button:
- platform: jk_bms_ble
retrieve_settings:
name: "${name} retrieve settings"
retrieve_device_info:
name: "${name} retrieve device info"
number:
- platform: jk_bms_ble
jk_bms_ble_id: bms0
balance_trigger_voltage:
name: "${name} balance trigger voltage"
cell_count:
name: "${name} cell count"
total_battery_capacity:
name: "${name} total battery capacity"
cell_voltage_overvoltage_protection:
name: "${name} cell voltage overvoltage protection"
cell_voltage_overvoltage_recovery:
name: "${name} cell voltage overvoltage recovery"
cell_voltage_undervoltage_protection:
name: "${name} cell voltage undervoltage protection"
cell_voltage_undervoltage_recovery:
name: "${name} cell voltage undervoltage recovery"
balance_starting_voltage:
name: "${name} balance starting voltage"
voltage_calibration:
name: "${name} voltage calibration"
current_calibration:
name: "${name} current calibration"
power_off_voltage:
name: "${name} power off voltage"
max_balance_current:
name: "${name} max balance current"
max_charge_current:
name: "${name} max charge current"
max_discharge_current:
name: "${name} max discharge current"
charge_overcurrent_protection_delay:
name: "${name} charge overcurrent protection delay"
charge_overcurrent_protection_recovery_time:
name: "${name} charge overcurrent protection recovery time"
discharge_overcurrent_protection_delay:
name: "${name} discharge overcurrent protection delay"
discharge_overcurrent_protection_recovery_time:
name: "${name} discharge overcurrent protection recovery time"
short_circuit_protection_delay:
name: "${name} short circuit protection delay"
short_circuit_protection_recovery_time:
name: "${name} short circuit protection recovery time"
charge_overtemperature_protection:
name: "${name} charge overtemperature protection"
charge_overtemperature_protection_recovery:
name: "${name} charge overtemperature protection recovery"
discharge_overtemperature_protection:
name: "${name} discharge overtemperature protection"
discharge_overtemperature_protection_recovery:
name: "${name} discharge overtemperature protection recovery"
charge_undertemperature_protection:
name: "${name} charge undertemperature protection"
charge_undertemperature_protection_recovery:
name: "${name} charge undertemperature protection recovery"
power_tube_overtemperature_protection:
name: "${name} power tube overtemperature protection"
power_tube_overtemperature_protection_recovery:
name: "${name} power tube overtemperature protection recovery"
sensor:
- platform: jk_bms_ble
jk_bms_ble_id: bms0
min_cell_voltage:
name: "${name} min cell voltage"
max_cell_voltage:
name: "${name} max cell voltage"
min_voltage_cell:
name: "${name} min voltage cell"
max_voltage_cell:
name: "${name} max voltage cell"
delta_cell_voltage:
name: "${name} delta cell voltage"
average_cell_voltage:
name: "${name} average cell voltage"
cell_voltage_1:
name: "${name} cell voltage 1"
cell_voltage_2:
name: "${name} cell voltage 2"
cell_voltage_3:
name: "${name} cell voltage 3"
cell_voltage_4:
name: "${name} cell voltage 4"
cell_voltage_5:
name: "${name} cell voltage 5"
cell_voltage_6:
name: "${name} cell voltage 6"
cell_voltage_7:
name: "${name} cell voltage 7"
cell_voltage_8:
name: "${name} cell voltage 8"
total_voltage:
name: "${name} total voltage"
current:
name: "${name} current"
power:
name: "${name} power"
charging_power:
name: "${name} charging power"
discharging_power:
name: "${name} discharging power"
temperature_sensor_1:
name: "${name} temperature sensor 1"
temperature_sensor_2:
name: "${name} temperature sensor 2"
# temperature_sensor_3:
# name: "${name} temperature sensor 3"
# temperature_sensor_4:
# name: "${name} temperature sensor 4"
power_tube_temperature:
name: "${name} power tube temperature"
balancing:
name: "${name} balancing"
state_of_charge:
name: "${name} state of charge"
capacity_remaining:
name: "${name} capacity remaining"
total_battery_capacity_setting:
name: "${name} total battery capacity setting"
charging_cycles:
name: "${name} charging cycles"
total_charging_cycle_capacity:
name: "${name} total charging cycle capacity"
total_runtime:
name: "${name} total runtime"
balancing_current:
name: "${name} balancing current"
errors_bitmask:
name: "${name} errors bitmask"
switch:
- platform: jk_bms_ble
charging:
name: "${name} charging"
discharging:
name: "${name} discharging"
balancer:
name: "${name} balancer"
- platform: ble_client
ble_client_id: client0
id: ble_client_switch0
name: "${name} enable bluetooth connection"
text_sensor:
- platform: jk_bms_ble
errors:
name: "${name} errors"
total_runtime_formatted:
name: "${name} total runtime formatted"
und passe dort die Dinge wie “mac-adress”,“api”, “ota”, “wifi”, “esp32” aus der am Anfang erstellten yaml an.
Und versuche dann diesen Code auf den ESP32 zu bringen…leider erfolglos.
Wenn ich USB wähle, erhalte ich die Fehlermeldung, dass kein Device gefunden wurde und bei OTA ist das erzeugte Device direkt Offline.
Ich weiß nicht, wieviele Versuche ich schon gemacht habe.
Bist du sicher, dass die Angabe deiner externen Quelle OK ist?
Vielleicht
und es geht mit
external_components:
- source:
type: git
url: https://github.com/syssi/esphome-jk-bms
ref: main
besser.
Bei “Manual Download” landet die bin Datei bei mir einfach im Download-Verzeichnis des Browsers.
Kannst du für irgendetwas Kleines ohne die externe Resource eine Bin-Datei erzeugen?
Kann es sein, dass etwas Text in deinem Beitrag verloren gegangen ist?
Zwischen “Vielleicht” und “und es geht mit” scheint etwas zu fehlen.
Danke für den Tipp, das werde ich mal versuchen.
Ja, bei “Manual Download” funktioniert es bei mir auch so, wenn ich den Code aus dem neu erstellten Device sichere, aber sobald ich den Code verändert habe, funktioniert es nicht mehr und ich erhalte die Fehlermeldung.
Allerdings funktioniert das kompilieren fehlerfrei. Das verstehe ich nicht und finde keine Erklärung dazu.
Den Code für “external_components:” zu ändern brachte den Erfolg.
Vielen Dank für die Hilfe.
Nun kann ich die .bin auch fehlerfrei erzeugen und speichern.
Ich habe noch eine Frage zur secrets Konfiguration, denn ich kämpfe gerade noch etwas mit der WLAN-Verbindung. Aber ich will dazu keinen extra Thread eröffnen.
Ich habe 3 AP mit unterschiedlicher SSID und unterschiedlichen PW für die Verbindung.
Also möchte ich alle 3 AP in den Code mit Secrets einbauen.
Ich stolpere allerdings immer wieder über unterschiedliche Schreibweisen:
Manchmal stehen die SSID und das PW in “” und mal ohne.
Ist das tatsächlich egal oder hat das einen Grund?
Also wie muss es in der secrets.yaml aussehen?
So:
# Your Wi-Fi SSID and password
1_wifi_ssid: "xxxxxx"
1_wifi_password: "xxxxxxx"
2_wifi_ssid: "xxxxxxx"
2_wifi_password: "xxxxxxx"
3_wifi_ssid: "xxxxxxx"
3_wifi_password: "xxxxxx"
oder doch so:
# Your Wi-Fi SSID and password
1_wifi_ssid: xxxxxx
1_wifi_password: xxxxxxx
2_wifi_ssid: xxxxxxx
2_wifi_password: xxxxxxx
3_wifi_ssid: xxxxxxx
3_wifi_password: xxxxxx