Skip to content
Edit this page

Battery monitor (SmartShunt / BMV)

SmartShunt and BMV battery monitors.

What it shows

  • State of charge, consumed Ah, time to go, instantaneous power
  • Main, auxiliary and midpoint voltage, battery temperature
  • History: discharge depths, charge cycles, min/max voltages, alarm counters, charged and discharged energy
  • Alarm, alarm reason and relay state
  • Model, firmware, serial number and DC monitor mode

Configuration

Source: smartshunt-esp8266-example.yaml

smartshunt-esp8266-example.yaml
substitutions:
  name: victron-smartshunt
  external_components_source: github://KinDR007/VictronMPPT-ESPHOME@main

esphome:
  name: ${name}
  friendly_name: ${name}
  project:
    name: "KinDR007.VictronMPPT-ESPHOME"
    version: 2.0.0

esp8266:
  board: d1_mini

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

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

ota:
  platform: esphome

logger:
  baud_rate: 0
  esp8266_store_log_strings_in_flash: false

# If you use Home Assistant please remove this `mqtt` section and uncomment the `api` component!
# The native API has many advantages over MQTT: https://esphome.io/components/api.html#advantages-over-mqtt
mqtt:
  broker: !secret mqtt_host
  username: !secret mqtt_username
  password: !secret mqtt_password
  id: mqtt_client

# api:

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

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

sensor:
  - platform: victron
    victron_id: victron0
    battery_voltage:
      name: "battery voltage"
    auxiliary_battery_voltage:
      name: "auxiliary battery voltage"
    midpoint_voltage_of_the_battery_bank:
      name: "midpoint voltage of the battery bank"
    midpoint_deviation_of_the_battery_bank:
      name: "midpoint deviation of the battery bank"
    battery_current:
      name: "battery current"
    battery_temperature:
      name: "battery temperature"
    instantaneous_power:
      name: "instantaneous power"
    consumed_amp_hours:
      name: "consumed amp hours"
    state_of_charge:
      name: "state of charge"
    time_to_go:
      name: "time to go"
    depth_of_the_deepest_discharge:
      name: "depth of the deepest discharge"
    depth_of_the_last_discharge:
      name: "depth of the last discharge"
    depth_of_the_average_discharge:
      name: "depth of the average discharge"
    number_of_charge_cycles:
      name: "number of charge cycles"
    number_of_full_discharges:
      name: "number of full discharges"
    cumulative_amp_hours_drawn:
      name: "cumulative amp hours drawn"
    min_battery_voltage:
      name: "min battery voltage"
    max_battery_voltage:
      name: "max battery voltage"
    last_full_charge:
      name: "last full charge"
    number_of_automatic_synchronizations:
      name: "number of automatic synchronizations"
    number_of_low_main_voltage_alarms:
      name: "number of low main voltage alarms"
    number_of_high_main_voltage_alarms:
      name: "number of high main voltage alarms"
    number_of_low_auxiliary_voltage_alarms:
      name: "number of low auxiliary voltage alarms"
    number_of_high_auxiliary_voltage_alarms:
      name: "number of high auxiliary voltage alarms"
    min_auxiliary_battery_voltage:
      name: "min auxiliary battery voltage"
    max_auxiliary_battery_voltage:
      name: "max auxiliary battery voltage"
    amount_of_discharged_energy:
      name: "amount of discharged energy"
    amount_of_charged_energy:
      name: "amount of charged energy"
    dc_monitor_mode_id:
      name: "dc monitor mode id"

text_sensor:
  - platform: victron
    victron_id: victron0
    alarm_condition_active:
      name: "alarm condition active"
    alarm_reason:
      name: "alarm reason"
    model_description:
      name: "model description"
    firmware_version:
      name: "firmware version"
    device_type:
      name: "device type"
    serial_number:
      name: "serial number"
    dc_monitor_mode:
      name: "dc monitor mode"

binary_sensor:
  - platform: victron
    victron_id: victron0
    relay_state:
      name: "relay state"

Run it

esphome run smartshunt-esp8266-example.yaml

See Build & flash for details and the secrets the example needs.