Victron als integration

Hallo ich hatte noch keine Erfolg.
Hatte keine Mac-Adresse gefunde von meinem Victron und mein HA startete nicht mehr.
Ich mache diese Woche Weiter
Wenn ich richtig gelesen habe, muss ich nur die Mac-Adresse und den Bindkey wechseln.
Wobei ich auch den Bindkey nicht gefunden habe.

Hast du die Victron Connect App nicht auf deinem Smartphone? Dann installiere sie kurz. Du musst nur in der Nähe deines MPPTs sein, die App starten und auf die Daten zugreifen.

Hallo das
Das habe ich gemacht aber nichts gefunden.
ich habe die V6.19
Ausedem habe ich Victron wegen der MAC-Adresse kontaktiert.
Es meldete sich der Händler bei dem ich meinen mppt 100/30 Bluetooth gekauft habe, mit keinen Ergebniss.
Wo bekomme ich MAC und Bindkey her?

Hallo,

diese infomationen findest du eigentlich sehr schnell auf der Gihubseite.

Asche auf mein Haupt, hätte ja auch erst einmal lesen können.

OK habe es gefunden
Eine Frage: Die Mac.-Adresse bei Victron ist ohne Trennzeichen
wird die auch in einer Zahl in die Yaml eingetragen (also ohne Doppelpunkt nach 2 Zahlen)

was bedeutet das?

Failed config

api: [source /config/esphome/esp32-bluetooth-proxy-89a294.yaml:69]
  encryption: 
    
    Invalid key format, please check it's using base64.
    key: xxxxxx

das Verstehe ich nicht. Wird beim Erstellen eines Gerätes vergeben

:pencil2: by tarag: Formatierung korrigiert und Beiträge zusammengeführt.

Morgen, das bedeutet du hast im Code irgenwo die XXXXX wo ich als Platzhalter für den key drin habe nicht gegen deine oder andere erstzt.

Ich hab di rnoch mal den YAML Code ohne Platzhalter:

substitutions:
  ## device settings
  device_name_short: "solarladeregler-ble-gatway"
  device_description: "ESP32 Super Mini BLE Gatway für Victron BLE und  BLE Sensoren"
  projectname: "Stückle.Solarladeregler"
  friendly_name: "Solarladeregler"
  appversion: "✅1.0.4✅"


esphome:
  name: ${device_name_short}
  comment: ${device_description}
  friendly_name: ${friendly_name}
  # Automatically add the mac address to the name
  # so you can use a single firmware for all devices
  name_add_mac_suffix: false
  project:
    name: ${projectname}
    version: ${appversion}
  build_path: ./build/${device_name_short}
  on_boot:
    then:
      - globals.set:
          id: boot_counter
          value: !lambda "return id(boot_counter)+=1;"
      - logger.log:
          level: INFO
          tag: "system"
          format: "BOOTMESSAGE:${device_name_short} API is connected, Device ready!"
      - component.update: bootcounter
      - delay: 30s
      - text_sensor.template.publish:
          id: programm_version
          state: "${appversion}"
  on_shutdown:
    then:
      - logger.log:
          level: ERROR
          tag: "system"
          format: "BOOTMESSAGE:${device_name_short} is down!"
      
esp32:
  board: esp32-c3-devkitm-1
  variant: ESP32C3
  framework:
    #type: arduino
    type: esp-idf    #oder   type: esp-idf
    version: latest
    
    
#Externe Quellle
external_components:
  - source: github://Fabian-Schmidt/esphome-victron_ble
    refresh: always


#Enable logging
logger:
  level: INFO          # Keine [D]-Meldungen mehr, nur noch [I], [W], [E]
  baud_rate: 0         # Deaktiviert serielle Ausgabe, wenn nicht gebraucht
  logs:
    victron_ble: WARN  # BLE-Telegramme nur bei Warnungen loggen
    sensor: INFO       # Sensorwerte zeigen (z. B. Spannungen, Strom etc.)
    text_sensor: WARN  # MPPT-Zustände nur bei Änderungen mit Relevanz
    component: ERROR   # Nur kritische Fehler aus Komponenten

# Enable Home Assistant API
api:
  encryption:
    key: "Sb/U5vbC4wOto9O/svkFVDwk4h9SJ3Hk7A64Wp5tkF8="

ota:
  - platform: esphome
    password: "96733fdbfdcab9565e02f8b83a0a6391"

wifi:
  ssid: Apfelbaum
  password: !secret wifi_password
  reboot_timeout: 5min
  fast_connect: true
  output_power: 10dB
  manual_ip:
    static_ip: 192.168.2.5
    gateway: 192.168.2.1
    subnet: 255.255.255.0

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Solarladeregler Fallback Hotspot"
    password: "FfzoZSnkf22r"

captive_portal:

web_server:
  port: 80
  version: 3
  local: true
#  auth:
#    username: !secret web_server_username
#    password: !secret web_server_password

globals:
  - id: boot_counter
    type: int
    restore_value: yes
    initial_value: "0"

button:
  # reset boot counter value
  - platform: template
    name: Device Boot Counter reset
    entity_category: "diagnostic"
    icon: mdi:counter
    on_press:
      then:
        - lambda: |-
            id(boot_counter) = 0;
            id(bootcounter).publish_state(id(boot_counter));
        - logger.log:
            level: WARN
            tag: "system"
            format: "${device_name_short} reset boot counter o.k!"
        - component.update: bootcounter

#  - platform: safe_mode
#    name: "Device Restart (Safe Mode)"
#    icon: mdi:safety-goggles
#    entity_category: "diagnostic"

  - platform: restart
    name: "Restart"
    icon: mdi:restart
    id: restart_switch
    entity_category: "diagnostic"

# 💥 Automatischer Neustart bei Instabilität
interval:
  - interval: 10min
    then:
      - lambda: |-
          if (id(wifi_signal_db).state < -85) {
            ESP_LOGW("main", "WLAN-Signal zu schwach – Neustart...");
            esp_restart();
          }
 
 
bluetooth_proxy:
  active: true

esp32_ble_tracker:
  scan_parameters:  
    interval: 60000ms
    window: 5000ms
    active: false

# 🕓 Uhrzeit und Zeitzone
time:
  - platform: homeassistant
    id: ha_time
    

victron_ble:
  - id: MySmartSolar
    mac_address: f87868d67bf1
    bindkey: 44d03e6b7663a565c62d35dc7b8df8c0


sensor:

  # device boot counter
  - platform: template
    name: Device Boot counter
    id: bootcounter
    icon: mdi:counter
    accuracy_decimals: 0
    state_class: "measurement"
    entity_category: "diagnostic"
    lambda: return (id(boot_counter));

  # MySmartSolar
  - platform: victron_ble
    victron_ble_id: MySmartSolar
    name: "Batterie Spannung"
    icon: mdi:battery-charging
    id: batterie_spannung
    type: BATTERY_VOLTAGE
    filters:
    - throttle_average: 60s

  - platform: victron_ble
    victron_ble_id: MySmartSolar
    name: "Batterie Strom"
    type: BATTERY_CURRENT
    filters:
    - throttle_average: 60s

  - platform: victron_ble
    victron_ble_id: MySmartSolar
    name: "Batterie Power"
    type: BATTERY_POWER
    filters:
    - throttle_average: 60s

  - platform: victron_ble
    victron_ble_id: MySmartSolar
    name: "Erzeug heute"
    type: YIELD_TODAY
    icon: mdi:calendar-today
    filters:
    - throttle_average: 60s

  - platform: victron_ble
    victron_ble_id: MySmartSolar
    name: "Solar Power"
    icon: mdi:solar-power
    type: PV_POWER
    filters:
    - throttle_average: 60s

  - platform: victron_ble
    victron_ble_id: MySmartSolar
    name: "Statusnummer"
    type: DEVICE_STATE
    icon: mdi:scan-helper
    filters:
    - throttle_average: 60s

  - platform: victron_ble
    victron_ble_id: MySmartSolar
    name: "Fehler"
    icon: mdi:alert-circle
    type: CHARGER_ERROR
    filters:
    - throttle_average: 60s

#CPU Temperatur
  - platform: internal_temperature
    name: CPU Temperatur
    id: cpu
    icon: mdi:temperature-celsius
    entity_category: diagnostic

#Wlan Empfang dB
  - platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB
    name: "WiFi Signal dB"
    id: wifi_signal_db
    icon: mdi:wifi
    update_interval: 30s
    filters:
    - throttle_average: 120s
    entity_category: "diagnostic"
#Wlan Empfang %
  - platform: copy # Reports the WiFi signal strength in %
    source_id: wifi_signal_db
    name: "WiFi Signal %"
    icon: mdi:wifi
    filters:
      - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
    unit_of_measurement: "% Signal "
    entity_category: "diagnostic"
    device_class: ""


#Betriebszeit
  - platform: uptime
    name: "ESP32 Uptime Sekunden"
    id: uptime_sensor
    update_interval: 60s
    icon: mdi:clock-start
    entity_category: "diagnostic"

binary_sensor:
  - platform: victron_ble
    victron_ble_id: MySmartSolar
    name: "MPPT is in Fault state"
    type: DEVICE_STATE_FAULT
    icon: mdi:message-reply

  - platform: victron_ble
    victron_ble_id: MySmartSolar
    name: "Status-MPPT has Error"
    type: CHARGER_ERROR
    icon: mdi:message-reply

  - platform: victron_ble
    victron_ble_id: MySmartSolar
    name: "Status-BULK"
    type: DEVICE_STATE_BULK
    icon: mdi:message-reply

  - platform: victron_ble
    victron_ble_id: MySmartSolar
    name: "Status-ABSORPTION"
    type: DEVICE_STATE_ABSORPTION
    icon: mdi:message-reply

  - platform: victron_ble
    victron_ble_id: MySmartSolar
    name: "Status-FLOAT"
    type: DEVICE_STATE_FLOAT
    icon: mdi:message-reply

  - platform: victron_ble
    victron_ble_id: MySmartSolar
    name: "Status-Hochfahren"
    type: DEVICE_STATE_STARTING_UP

#Status
  - platform: status
    name: "Verbunden mit HA"
    icon: mdi:connection



text_sensor:

  - platform: victron_ble
    victron_ble_id: MySmartSolar
    name: "MPPT state"
    type: DEVICE_STATE
    icon: mdi:alert-circle

  - platform: victron_ble
    victron_ble_id: MySmartSolar
    name: "MPPT Error reason"
    type: CHARGER_ERROR
    icon: mdi:alert-circle
    
  - platform: template
    name: "Programm Version"
    id: programm_version
    lambda: |-
      return {};
    update_interval: never
    icon: mdi:alpha-v-box
    entity_category: "diagnostic"

 # 📦 Automatische Software-Infos
  - platform: version
    name: "ESPHome Version"


  - platform: template
    name: "ESP32 Uptime formatiert"
    icon: mdi:clock-outline
    lambda: |-
      uint32_t seconds = (uint32_t)id(uptime_sensor).state;
      uint32_t days = seconds / 86400;
      uint32_t hours = (seconds % 86400) / 3600;
      uint32_t minutes = (seconds % 3600) / 60;
      uint32_t secs = seconds % 60;
      char buffer[32];
      snprintf(buffer, sizeof(buffer), "%ud %02uh %02um %02us", days, hours, minutes, secs);
      return std::string(buffer);
    update_interval: 60s
    entity_category: "diagnostic"


#
##CPU Frequenz
#
#  - platform: template
#    name: "ESP32 CPU Frequenz"
#    lambda: |-
#      return to_string(getCpuFrequencyMhz()) + " MHz";
#    update_interval: 60s
#    icon: mdi:cpu-64-bit
#    entity_category: "diagnostic"
#


# IP Infos
  - platform: wifi_info
    ip_address:
      name: ESP IP Address
      icon: mdi:ip
    ssid:
      name: ESP Connected SSID
      icon: mdi:wifi-check
    mac_address:
      name: ESP Mac Wifi Address
    scan_results:
      name: ESP Latest Scan Results
      icon: mdi:wifi-refresh
    dns_address:
      name: ESP DNS Address
      icon: mdi:dns



Gruß

soweit ging es

======================== [SUCCESS] Took 2767.51 seconds ========================
INFO Successfully compiled program.
INFO Connecting to 192.168.177.140 port 3232...
INFO Connected to 192.168.177.140
INFO Uploading /data/./build/solarladeregler-ble-gatway/.pioenvs/solarladeregler-ble-gatway/firmware.bin (1711360 bytes)
Uploading: [============================================================] 100% Done...

INFO Upload took 19.79 seconds, waiting for result...
ERROR Error Update end: Error: Finishing update failed. See the MQTT/USB logs for more information.

Was muss ich tun bei Programmtext?

Flash du ihn Wireless oder über USB Kabel.

Benutze beim ersten Flashen aufjeden Fall das USB Kabel und den ESPHome Flasher: https://web.esphome.io/
Du brauchst die *.bin Datei zum Flashen über den Webbrowser.
Bekommst du in dem du klickst beim Flashen nicht Wireless sonder ESP ist an diesem Computer angeschlossen.

Du kommst aber dem Ziel näher.

Noch was! Hast du deine MAC Adresse und Key eingetragen und meinen gelöscht?

Ich hatte per Wlan geflasht und meine Daten eigetragen .
OK dann probiere ich es nochmal per PC.
kann ich aber erst heute Abend machen .
Was passier wen das klappt? in HA
Batterieanzeige Bleibt? und wie zeigt das Victron an?

Ausedem vergesse ich immer wieder wie Programmtext gepostet wird?
Mit Vormatierter Text?

Bekommst du in dem du klickst beim Flashen nicht Wireless sonder ESP ist an diesem Computer angeschlossen.

mit was soll ich Flashen? ESP Home Builder und dan per USB?

Nachtrag:
Hallo
Nun ja die Yaml funktioniert .
Nur das mit dem Flashen ist mir unklar.

:crayon:by HarryP: Zusammenführung Mehrfachpost (bei Änderungen oder hinzufügen von Inhalten bitte die „Bearbeitungsfunktion“ anstatt „Antworten“ zu nutzen)

Irgend wie komme ich nicht weiter.
Da mein HA auf einen NAS läuft komme ich nicht zum flaschen über com im HA.
Kann ich die Fertige yaml auch mit dem Webtool von ESP32 auf den ESP32 flashen?
Bin wird mir ja angeboten.
Kann mann yaml zu Bin konvertieren?
Bitte um Hilfe

Oder geht vieleicht ein Raspi mit HA und Flahen über USB besser?

Moin

ich stehe auch vor dem Problem, wie komme ich am besten an die Daten meines Multiplus5000.

Ich habe die Victron HACS Integration installiert. Geht auch gut und ich bekomme jede Menge Daten. Allerdings nur angezeigt! Ich würde aber gerne einige Parameter via HA Automation ändern. Z.B. die Ladeleistung an den Tagesverlauf anpassen (wegen Geräuschentwicklung).

Geht sowas mit der beschriebenen Installation via ESP32? Einen BT Proxy (ebenfalls ESP32) habe ich bereits im Einsatz und komme damit an die Daten meiner Batterie (JK BMS).

Könnte ich diese ESP Installation auch für den Zugriff auf den WR nutzen? Quasi 2 BT Geräte über einen ESP auswerten? Die beschriebene Victron yaml zur bestehenden hinzufügen.

Gruss

Hajot