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: Battery Sense and Orion Smart DCDC is working #20

Closed HBK1 closed 1 year ago

HBK1 commented 1 year ago

Victron Battery Sense reports as Battery Monitor and presents BATTERY_VOLTAGE and TEMPERATURE. Orion Smart DCDC needs a filter on OUTPUT_VOLTAGE since it reports 0x7FFF=32767 when engine is off=Unavalible. Both are working ok together with a Smartshunt and MPPT on the same ESP32.

See below config for DCDC and Battery Sense:

victron_ble:
  - id: MySmartDcdc
    mac_address: ${smart_dcdc_mac_address}
    bindkey: ${smart_dcdc_encryption_key}
  - id: MySmartBS
    mac_address: ${smart_bs_mac_address}
    bindkey: ${smart_bs_encryption_key}

sensor:
  # MySmartDcdc
  - platform: victron_ble
    victron_ble_id: MySmartDcdc
    name: "DCDC Input Voltage"
    type: INPUT_VOLTAGE
  - platform: victron_ble
    victron_ble_id: MySmartDcdc
    name: "DCDC Output Voltage"
    type: OUTPUT_VOLTAGE
   # DCDC reports 0x7FFF=32767 when off=Unavalible 
    filters:
      - filter_out: 327.67

  # MySmartBS
  - platform: victron_ble
    victron_ble_id: MySmartBS
    name: "BS voltage"
    type: BATTERY_VOLTAGE
  - platform: victron_ble
    victron_ble_id: MySmartBS
    name: "BS temperature"
    type: TEMPERATURE

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

text_sensor:
  - platform: victron_ble
    victron_ble_id: MySmartDcdc
    name: "DCDC state"
    type: DEVICE_STATE
  - platform: victron_ble
    victron_ble_id: MySmartDcdc
    name: "DCDC Error reason"
    type: CHARGER_ERROR
  - platform: victron_ble
    victron_ble_id: MySmartDcdc
    name: "DCDC Off reason"
    type: OFF_REASON
benderl commented 1 year ago

Similar results here with an OrionSmart DC-DC charger. If the charger is off, the output voltage is shown as 327.67 V. This should be filtered.

Everything else, including data from my SmartSolar 75-15, is displayed as expected. Great Work!

Fabian-Schmidt commented 1 year ago

Should the component submit no value (like your filter), 0.0 or NAN in this scenario? I am unsure what would work best.

HBK1 commented 1 year ago

My filter is causing HA to keep the last value which may not be so good. I would rather prefer 0.0 as this is the real value and what keshavdv does. NAN will present Unavalible in HA and may disturb further calculations of energy.

Fabian-Schmidt commented 1 year ago

Hi @HBK1, can you please test the changes? You might need to add refresh: 0s to the external_components to ensure you use the latest version for testing.

HBK1 commented 1 year ago

It is working ok with 0.0V , Thanks!

There is a warning in the log, is this anything to be worried about?

[15:30:27][D][sensor:094]: 'SH Time remaining': Sending state 65535.00000 min with 0 decimals of accuracy
[15:30:27][D][sensor:094]: 'SH Battery voltage': Sending state 13.34000 V with 2 decimals of accuracy
[15:30:27][D][sensor:094]: 'SH Starter Battery': Sending state 12.77000 V with 2 decimals of accuracy
[15:30:27][D][sensor:094]: 'SH Current': Sending state 0.11400 A with 3 decimals of accuracy
[15:30:27][D][sensor:094]: 'SH Consumed Ah': Sending state -3.90000 Ah with 1 decimals of accuracy
[15:30:27][D][sensor:094]: 'SH State of charge': Sending state 98.60000 % with 1 decimals of accuracy
[15:30:27][D][text_sensor:064]: 'SH Battery Alarm reason': Sending state ''
[15:30:27][W][component:204]: Component victron_ble took a long time for an operation (0.06 s).
[15:30:27][W][component:205]: Components should block for at most 20-30ms.
[15:30:28][D][victron_ble:247]: [F2:F0:E7:44:35:3D] Recieved BATTERY_MONITOR message.
[15:30:28][D][victron_ble:247]: [C3:9C:38:27:0A:0A] Recieved BATTERY_MONITOR message.
[15:30:28][D][victron_ble:247]: [C3:9C:38:27:0A:0A] Recieved BATTERY_MONITOR message.
[15:30:29][D][sensor:094]: 'MPPT Battery Voltage': Sending state 13.35000 V with 2 decimals of accuracy
[15:30:29][D][sensor:094]: 'MPPT Battery Current': Sending state 1.10000 A with 3 decimals of accuracy
[15:30:29][D][sensor:094]: 'MPPT Yield Today': Sending state 0.11000 kWh with 2 decimals of accuracy
[15:30:29][D][sensor:094]: 'MPPT PV Power': Sending state 15.00000 W with 0 decimals of accuracy
[15:30:29][D][sensor:094]: 'MPPT Load Current': Sending state -0.00000 A with 1 decimals of accuracy
[15:30:29][D][text_sensor:064]: 'MPPT state': Sending state 'Float'
[15:30:29][D][text_sensor:064]: 'MPPT Error reason': Sending state ''
[15:30:29][W][component:204]: Component victron_ble took a long time for an operation (0.05 s).
[15:30:29][W][component:205]: Components should block for at most 20-30ms.
[15:30:29][D][victron_ble:247]: [F2:F0:E7:44:35:3D] Recieved BATTERY_MONITOR message.
[15:30:29][D][victron_ble:247]: [C3:9C:38:27:0A:0A] Recieved BATTERY_MONITOR message.
Fabian-Schmidt commented 1 year ago

The warning is because EspHome changed the log level of this message from verbose to warn. Tracking this warning in a seperate issue #22.