Fabian-Schmidt / esphome-victron_ble

Use official Victron BLE endpoint for fetching data from Victron devices via Bluetooth LE via ESPHome.
GNU General Public License v3.0
152 stars 15 forks source link

Feedback for Phoenix inverter with dongle & MPPT #17

Closed cainslie closed 1 year ago

cainslie commented 1 year ago

Just to let you know, the following code works partially with a 12/500 Phoenix inverter with dongle as well as with a 75/10 MPPT

AC Current - not sure if that's correct. It's showing 0.2A when inverter is running at about 20% load AC Power is showing -1VA AC Voltage is showing -97.8V (I am in a 220V country) Battery Current is showing "Unknown" Battery Voltage is correct.

esphome:
  name: victron-ble
  friendly_name: victron-ble

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

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

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

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: ""

esp32_ble_tracker:

victron_ble:
  - id: MyInverter
    mac_address: "-"    
    bindkey: "-"
  - id: MyMPPT
    mac_address: "-"
    bindkey: "-"

sensor:
  # MySmartShunt
  - platform: victron_ble
    victron_ble_id: MyInverter
    name: "Battery voltage"
    type: BATTERY_VOLTAGE
  - platform: victron_ble
    victron_ble_id: MyInverter
    name: "AC Power"
    type: AC_APPARENT_POWER
  - platform: victron_ble
    victron_ble_id: MyInverter
    name: "AC Current"
    type: AC_CURRENT
  - platform: victron_ble
    victron_ble_id: MyInverter
    name: "AC Voltage"
    type: AC_VOLTAGE

  - platform: victron_ble
    victron_ble_id: MyMPPT
    name: "MPPT"
    type: BATTERY_VOLTAGE
  - platform: victron_ble
    victron_ble_id: MyMPPT
    name: "Battery Current"
    type: BATTERY_CURRENT
  - platform: victron_ble
    victron_ble_id: MyMPPT
    name: "Yield Today"
    type: YIELD_TODAY
  - platform: victron_ble
    victron_ble_id: MyMPPT
    name: "PV Power"
    type: PV_POWER
  - platform: victron_ble
    victron_ble_id: MyMPPT
    name: "Load Current"
    type: LOAD_CURRENT

binary_sensor:
  - platform: victron_ble
    victron_ble_id: MyMPPT
    name: "MPPT is in Fault state"
    type: DEVICE_STATE_FAULT
  - platform: victron_ble
    victron_ble_id: MyMPPT
    name: "MPPT has Error"
    type: CHARGER_ERROR

text_sensor:
  - platform: victron_ble
    victron_ble_id: MyMPPT
    name: "MPPT state"
    type: DEVICE_STATE
  - platform: victron_ble
    victron_ble_id: MyMPPT
    name: "MPPT Error reason"
    type: CHARGER_ERROR
Fabian-Schmidt commented 1 year ago

I pushed an update to the Repo to fix some of the issues.

The following fields used the wrong type AC_APPARENT_POWER, AC_CURRENT and AC_VOLTAGE. About the issue with the BATTERY_CURRENT field I am unsure as I got an MPPT 75/15 and it is working. If the issue persists I would need an additional log output and what value is shown in the Victron App on the Device list page.

Can you please change the external component to load the new version and retest?

external_components:
  - source: github://Fabian-Schmidt/esphome-victron_ble
    refresh: always
cainslie commented 1 year ago

Thanks @Fabian-Schmidt, I have reinstalled with the new version. Ignore my (incorrect) comment about BATTERY_CURRENT, I misread that.

With the new update I am seeing AC_VOLTAGE correctly now. AC_CURRENT appears to be correct, I will need to double check.

AC_APPARENT_POWER is showing a value of 65535 which we know isn't correct.

cainslie commented 1 year ago

Actually, it looks like both AC_CURRENT and AC_APPARENT_POWER are never going to be particularly accurate for this inverter, based on the accepted answer here: https://community.victronenergy.com/questions/22475/no-power-or-efficiency-information-in-victronconne.html

So thanks @Fabian-Schmidt for an excellent library, I'm very happy with what it does.

Fabian-Schmidt commented 1 year ago

AC_APPARENT_POWER of 65535 means the value is NA (Not available).

Thanks for testing and feedback.