Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smart Battery sense works but Blue Smart Charger IP22 12/15 don't - why??? #79

Open
FloX5E70 opened this issue Dec 22, 2024 · 9 comments

Comments

@FloX5E70
Copy link

I despair of setting up the Blue Smart Charger and have already invested way too much time. Do any of you have an idea? MAC and Passkey are certainly correct, I have reset the device, tried new BT pin, another ESP32... Can't get any further. Setting up the Smart Battery Sense worked immediately. Here is my yaml:

esphome:
  name: victron-ble
  friendly_name: Victron BLE

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "my_key"

ota:
  - platform: esphome
    password: "ota_password"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Victron-Ble Fallback Hotspot"
    password: "secret!"

captive_portal:
external_components:
  - source: github://Fabian-Schmidt/esphome-victron_ble

esp32_ble_tracker:
  scan_parameters:
    #interval: 160ms #the default is 320ms and you want to shorten it, try half
    #window: 60ms #the default is 30ms so try doubling it
    interval: 1100ms
    window: 1100ms
    # We currently use the defaults to ensure Bluetooth
    # can co-exist with WiFi In the future we may be able to
    # enable the built-in coexistence logic in ESP-IDF
    active: true

victron_ble:
  - id: BlueSmartCharger
    mac_address: "e5c60fa2e5d2"    
    bindkey: "7b22e5fc6a96f3..."
  - id: battery_sense_1
    mac_address: "c04b244a122d"
    bindkey: "3d42334b3..."

sensor:
  # BlueSmartCharger
  - platform: victron_ble
    victron_ble_id: BlueSmartCharger
    name: "Battery Voltage"
    type: BATTERY_VOLTAGE
  - platform: victron_ble
    victron_ble_id: BlueSmartCharger
    name: "blue_smart_battery_current"
    type: BATTERY_CURRENT
  - platform: victron_ble
    victron_ble_id: BlueSmartCharger
    name: "Temperatur"
    type: TEMPERATURE

  # battery_sense_1
  - platform: victron_ble
    victron_ble_id: battery_sense_1
    name: "Battery Voltage SBS"
    type: BATTERY_VOLTAGE
  - platform: victron_ble
    victron_ble_id: battery_sense_1
    name: "Battery Temperature SBS"
    type: TEMPERATURE

binary_sensor:
  - platform: victron_ble
    victron_ble_id: BlueSmartCharger
    name: "Bulk"
    type: DEVICE_STATE_BULK
  - platform: victron_ble
    victron_ble_id: BlueSmartCharger
    name: "Absoption"
    type: DEVICE_STATE_ABSORPTION
  - platform: victron_ble
    victron_ble_id: BlueSmartCharger
    name: "Float"
    type: DEVICE_STATE_FLOAT
  - platform: victron_ble
    victron_ble_id: BlueSmartCharger
    name: "Storage"
    type: DEVICE_STATE_STORAGE
text_sensor:
  - platform: victron_ble
    victron_ble_id: BlueSmartCharger
    name: "Error"
    type: CHARGER_ERROR
  - platform: victron_ble
    victron_ble_id: BlueSmartCharger
    name: "State"
    type: DEVICE_STATE
@HBK1
Copy link

HBK1 commented Dec 22, 2024

Blue smart charger must have Firmware version v3.61, do yours?
Also Check:
#62

@FloX5E70
Copy link
Author

It's on v3.61 and the victron app shows the BLE-Data on the first page. So, the BLE Data is on air.
The user @BikeAtor has no problems with IP22-Charger with Fabians solution:
keshavdv/victron-hacs#129 (comment)

@HBK1
Copy link

HBK1 commented Dec 22, 2024

Have you tried to refresh ?
external_components:

  • source: github://Fabian-Schmidt/esphome-victron_ble
    refresh: 0s

@FloX5E70
Copy link
Author

Added without success. What does it do?
Thanks for your support!

external_components:
  - source: github://Fabian-Schmidt/esphome-victron_ble
    refresh: 0s

@HBK1
Copy link

HBK1 commented Dec 22, 2024

It makes sure you are using the latest version. Upload a log from when you start the ESP so it is easier to understand what is missing.

@FloX5E70
Copy link
Author

Log from ESPHome:

INFO ESPHome 2024.12.2
INFO Reading configuration /config/esphome/esphome-web-8534f8.yaml...
INFO Updating https://github.com/Fabian-Schmidt/esphome-victron_ble.git@None
INFO Starting log output from 192.168.1.152 using esphome API
INFO Successfully connected to victron-ble @ 192.168.1.152 in 0.049s
INFO Successful handshake with victron-ble @ 192.168.1.152 in 0.115s
[13:44:48][I][app:100]: ESPHome version 2024.12.2 compiled on Dec 22 2024, 12:39:31
[13:44:48][C][wifi:600]: WiFi:
[13:44:48][C][wifi:428]:   Local MAC: CC:64:C8:85:47:AC
[13:44:48][C][wifi:433]:   SSID: [redacted]
[13:44:48][C][wifi:436]:   IP Address: 192.168.1.152
[13:44:48][C][wifi:440]:   BSSID: [redacted]
[13:44:48][C][wifi:441]:   Hostname: 'victron-ble'
[13:44:48][C][wifi:443]:   Signal strength: -84 dB ▂▄▆█
[13:44:48][C][wifi:447]:   Channel: 1
[13:44:48][C][wifi:448]:   Subnet: 255.255.255.0
[13:44:48][C][wifi:449]:   Gateway: 192.168.1.1
[13:44:48][C][wifi:450]:   DNS1: 192.168.1.1
[13:44:48][C][wifi:451]:   DNS2: 0.0.0.0
[13:44:48][C][logger:185]: Logger:
[13:44:48][C][logger:186]:   Level: DEBUG
[13:44:48][C][logger:188]:   Log Baud Rate: 115200
[13:44:48][C][logger:189]:   Hardware UART: UART0
[13:44:48][C][victron_ble:014]: Victron BLE:
[13:44:48][C][victron_ble:015]:   Address: E4:E6:0E:A1:E5:B2
[13:44:48][C][victron_ble:014]: Victron BLE:
[13:44:48][C][victron_ble:015]:   Address: C0:BB:65:6A:12:2D
[13:44:48][C][victron_ble.sensor:010]: Victron Sensor 'Battery Voltage'
[13:44:48][C][victron_ble.sensor:010]:   Device Class: 'voltage'
[13:44:48][C][victron_ble.sensor:010]:   State Class: 'measurement'
[13:44:48][C][victron_ble.sensor:010]:   Unit of Measurement: 'V'
[13:44:48][C][victron_ble.sensor:010]:   Accuracy Decimals: 2
[13:44:48][C][victron_ble.sensor:010]:   Unit of Measurement: 'A'
[13:44:48][C][victron_ble.sensor:010]:   Accuracy Decimals: 3
[13:44:48][C][victron_ble.sensor:010]:   Icon: 'mdi:battery'
[13:44:48][C][victron_ble.sensor:011]:   Type 'BATTERY_CURRENT'
[13:44:48][C][victron_ble.sensor:010]: Victron Sensor 'Temperatur'
[13:44:48][C][victron_ble.sensor:010]:   Device Class: 'temperature'
[13:44:48][C][victron_ble.sensor:010]:   State Class: 'measurement'
[13:44:48][C][victron_ble.sensor:010]:   Unit of Measurement: '°C'
[13:44:48][C][victron_ble.sensor:010]:   Accuracy Decimals: 2
[13:44:48][C][victron_ble.sensor:010]:   Icon: 'mdi:thermometer'
[13:44:48][C][victron_ble.sensor:011]:   Type 'TEMPERATURE'
[13:44:48][C][victron_ble.sensor:010]: Victron Sensor 'Battery Voltage SBS'
[13:44:48][C][victron_ble.sensor:010]: Victron Sensor 'Battery Temperature SBS'
[13:44:48][C][victron_ble.sensor:010]:   Device Class: 'temperature'
[13:44:48][C][victron_ble.sensor:010]:   State Class: 'measurement'
[13:44:48][C][victron_ble.sensor:010]:   Unit of Measurement: '°C'
[13:44:48][C][victron_ble.sensor:010]:   Accuracy Decimals: 2
[13:44:48][C][victron_ble.sensor:010]:   Icon: 'mdi:thermometer'
[13:44:48][C][victron_ble.sensor:011]:   Type 'TEMPERATURE'
[13:44:49][C][victron_ble.binary_sensor:010]: Victron Binary Sensor 'Bulk'
[13:44:49][C][victron_ble.binary_sensor:011]:   Type 'DEVICE_STATE_STORAGE'
[13:44:49][C][victron_ble.text_sensor:010]: Victron Text Sensor 'Error'
[13:44:49][C][victron_ble.text_sensor:011]:   Type 'CHARGER_ERROR'
[13:44:49][C][victron_ble.text_sensor:010]: Victron Text Sensor 'State'
[13:44:49][C][victron_ble.text_sensor:011]:   Type 'DEVICE_STATE'
[13:44:49][C][esp32_ble:418]: ESP32 BLE:
[13:44:49][C][esp32_ble:420]:   MAC address: CC:64:39:85:47:BE
[13:44:49][C][esp32_ble:421]:   IO Capability: none
[13:44:49][C][esp32_ble_tracker:661]: BLE Tracker:
[13:44:49][C][esp32_ble_tracker:662]:   Scan Duration: 300 s
[13:44:49][C][esp32_ble_tracker:663]:   Scan Interval: 1100.0 ms
[13:44:49][C][esp32_ble_tracker:664]:   Scan Window: 1100.0 ms
[13:44:49][C][esp32_ble_tracker:665]:   Scan Type: ACTIVE
[13:44:49][C][esp32_ble_tracker:666]:   Continuous Scanning: True
[13:44:49][C][captive_portal:089]: Captive Portal:
[13:44:49][C][mdns:116]: mDNS:
[13:44:49][C][mdns:117]:   Hostname: victron-ble
[13:44:49][C][esphome.ota:073]: Over-The-Air updates:
[13:44:49][C][esphome.ota:074]:   Address: victron-ble.local:3232
[13:44:49][C][esphome.ota:075]:   Version: 2
[13:44:49][C][esphome.ota:078]:   Password configured
[13:44:49][C][safe_mode:018]: Safe Mode:
[13:44:49][C][safe_mode:020]:   Boot considered successful after 60 seconds
[13:44:49][C][safe_mode:021]:   Invoke after 10 boot attempts
[13:44:49][C][safe_mode:023]:   Remain in safe mode for 300 seconds
[13:44:49][C][api:140]: API Server:
[13:44:49][C][api:141]:   Address: victron-ble.local:6053
[13:44:49][C][api:143]:   Using noise encryption: YES

@Fabian-Schmidt
Copy link
Owner

Fabian-Schmidt commented Dec 26, 2024

@FloX5E70 Does the log contain any messages afterwards? Theses messages are just the status messages logged on start as overview. They don't indicate any issue.

Only odd thing is are your scan paramter. Can you please try the default ones (remove them) or the following:

esp32_ble_tracker:
  scan_parameters:
    interval: 10ms
    window: 10ms
    active: false

Thanks

@FloX5E70
Copy link
Author

Hello Fabian, thaks for your support. Without changing anything except the position of the wifi accesspoint, the integration works fine. Don't really understand why, but I don't have any issues. Maybe a problem with my ESP32.

@Fabian-Schmidt
Copy link
Owner

Can I close this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants