Victron Energy VEDirect Bluetooth

Thanks for the suggestion. I left the ground as most above said not to ground it but will try tomorrow. Here is my ESP code

substitutions:
  name: victron-mppt
  external_components_source: github://KinDR007/VictronMPPT-ESPHOME@main

esphome:
  name: ${name}
  platform: ESP8266
  board: d1_mini

external_components:
  - source: ${external_components_source}
    refresh: 0s

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

ota:
api:

logger:
  baud_rate: 0
  esp8266_store_log_strings_in_flash: false

#mqtt:
#  broker: !secret mqtt_host
#  username: !secret mqtt_username
#  password: !secret mqtt_password
#  id: mqtt_client

uart:
  id: uart_0
  tx_pin: D8  # Not connected! The communication is read-only
  rx_pin: D7  # Connect this this GPIO and GND to the MPPT charger
  baud_rate: 19200
  rx_buffer_size: 256

victron:
  uart_id: uart_0
  id: victron0
  throttle: 30s

sensor:
  - platform: victron
    victron_id: victron0
    max_power_yesterday:
      name: "${name} max power yesterday"
    max_power_today:
      name: "${name} max power today"
    yield_total:
      name: "${name} yield total"
    yield_yesterday:
      name: "${name} yield yesterday"
    yield_today:
      name: "${name} yield today"
    panel_voltage:
      name: "${name} panel voltage"
    panel_power:
      name: "${name} panel power"
    battery_current:
      name: "${name} panel current"
    battery_voltage:
      name: "${name} battery voltage"
    day_number:
      name: "${name} day number"
    charging_mode_id:
      name: "${name} charging mode id"
    error_code:
      name: "${name} error code"
    tracking_mode_id:
      name: "${name} tracking mode id"
    load_current:
      name: "${name} load current"

text_sensor:
  - platform: victron
    victron_id: victron0
    charging_mode:
      name: "${name} charging mode"
    error:
      name: "${name} error"
    tracking_mode:
      name: "${name} tracking mode"
    firmware_version:
      name: "${name} firmware version"
    device_type:
      name: "${name} device type"
    serial_number:
      name: "${name} serial number"

binary_sensor:
  - platform: victron
    victron_id: victron0
    load_state:
      name: "${name} load state"
    relay_state:
      name: "${name} relay state"

Here again I saw some weird errors.

I could not wait until tomorrow (even in this freezing weather - South Africa) so I added a ground to the ESP and to the Victron unit and now all is perfect. No more errors. Thank you for the suggestion and to anyone else that is getting weird errors, try adding the ground. Once again thank you so much for the assistance.

I connected my Victron Smartshunt to Home-Assistant using an ESP32 with ESPHome in combination with this library: GitHub - Fabian-Schmidt/esphome-victron_ble: Use official Victron BLE endpoint for fetching data from Victron devices via Bluetooth LE via ESPHome.

After getting the authentication key using a Laptop with a bootable Ubuntu stick, this library worked flawlessly to obtain data from my smartshunt.
A few notes on how to obtain the authentication key:

One more thing: My Windows installation uses bitlocker for disk encryption. For some reason I had to enter my decryption key to get access to my Windows installation again, after using the Ubunti-stick. So just to be sure, make sure you have a copy of that decryption key somewhere safe where you can access it anytime (which is a smart thing anyway).

1 Like

Hi,

Iā€™ve got the authentication keys and the values are successfully read in the logs of esp home using victron-ble lib from above, but devices are not populated by the victron ble custom component.

Any ideas, Iā€™m out of mine.

Thanks, B.

Iā€™m a bit confused, which custom component are you referring to? My Victron sensors showed up in the ESPhome integration, as past of the ESPhome device.

Iā€™m sorry I missed your reply.

Everything is working now, but maybe I should explain what I did and what I possibly misunderstood.

Perhaps it might help somebody else going through the process that took me to long in my opinion.

I have three Victron devices installed in my vehicle:
DCDC converter (Orion Smart), MPPT regulator (Smart Solar) and battery monitor (BMV 712).

I am running HA OS on RPi 400 in that same vehicle, not far from the other devices.

I was folllowing the described procedures using the notebook running Ubuntu with Victron Connect image installed (and bluetoothctl to force enter PIN) to acquire the three authentication keys.

Next I have added Victron BLE custom integration to HA (GitHub - keshavdv/victron-hacs: Home Assistant plug-in for Victron Instant Readout compatible devices)

Since the RPi supports BLE, initially all three devices cropped up and in the Settings/Devices and Services. I entered the authentication keys and one of them (DCDC) was soon populated by entities.

After some time the other one got populated as well (MPPT), but in both cases there was a tendency that the entities would become unavailable in time, but maybe reconnected again in a while.

I thought that the signal reception is not good/stable enough and decided to install ESPHome and add a Bloototh proxy that I could configure a bit more. There was no improvement.

Then I found the (GitHub - Fabian-Schmidt/esphome-victron_ble: Use official Victron BLE endpoint for fetching data from Victron devices via Bluetooth LE via ESPHome.) and configured and installed that component (the part that refers to Victron BLE integration) and also checked the logs which were promising (the data was parsed successfully), but no entities were added, not in ESPHome not at the previously added devices. By analysing the logs I found the naming conflict between the Victron BLE HACS installation and ESPHome device. After resolving that the entities were finally added to ESPHome device.

Everyhing seems stable now, but I think that the devices that are found in Victron BLE integration should better be disabled.

I hope this makes sense.

Many thanks to all contributors.

hi,
having the same issue here ā€¦ how exactly did you ā€œresolve the mentioned naming conflictsā€ ? could you describe in more detail what you did ?
thanx in advance
lg
g

Hi,

I think my logs at the time showed that entities with the names I wanted to add through the ESP Home have already existed, I believe that was due to my prior experiments with different integrations. I deleted those and then they appeared in ESP Home device - you could also try different naming schemes in ESP Home code.

As far as I remember that was the last step in otherwise frustrating - and finally rewarding - experienceā€¦

Everything still works perfectly ever since and connections are solid.

KR, B.

Hello,
i also want to connect my Victron Device with ESP32 Ble to Home Assistant. @bvovk can you explain exactly the way to install the Github from Fabian-Schmidt ? I try this for hours, no chance to run this. My english ist bad, i am german. thank you for your help.

Awesome!

Howā€™s this been working for you?

The post you linked to outlining this has been deleted, any chance you could explain how to connect HA to victron gear via BLE?

This is working perfectly:

1 Like

I used GitHub - softwarecrash/Victron2MQTT: Little Program for ESP82XX to get the Victron data to web and MQTT on a Wemos D1 mini.

No need to compile as the img file can be flashed with tasmotiser directly.
Only suitable if your victron has an vedirect port.

Latest version has hassio discovery and code owner is actively working on new features
Possible to buy complete modules and pcbā€™s to connect to your victron.

Works perfectly. You can get the code straight from the app now, so it couldnā€™t be easier!

Could you elaborate how you did that? I try to get an MPPT and a shunt work on one esp8266.

hi i have one MPPT 100/20 working like a charm with esphome.
i wanr to add one more mppt to improve the charge of my batterie , was it possible to synchronise the two mppt like it could with ve.smart ?