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

SmartBatterySense? #35

Closed mogliasi closed 8 months ago

mogliasi commented 8 months ago

Hello! What about SmartBatterySense? Following this doc the item exports TEMPERATURE and BATTERY VOLTAGE by Instant readout. Is it possible to add it?

Fabian-Schmidt commented 8 months ago

Have you tried using the sensor of type TEMPERATURE and BATTERY_VOLTAGE? I assume a Smart Battery sense is producing Battery monitor messages. So all sensor from the column Battery monitor should just work. Is it working? If not can you please provide a log output of the ESP Home device in verbose mode?

mogliasi commented 8 months ago

Hi Fabian, this is the output from EspHome HA yaml validate

INFO ESPHome 2023.11.6
INFO Reading configuration /config/esphome/testing.yaml...
Failed config

text_sensor.victron_ble: [source /config/esphome/testing.yaml:103]
  platform: victron_ble
  victron_ble_id: MySmartBatterySense
  name: Voltage Battery

  Unknown value 'BATTERY_VOLTAGE', valid options are 'ALARM', 'ACTIVE_AC_IN', 'ALARM_REASON', 'CHARGER_ERROR', 'DEVICE_STATE', 'ERROR_CODE', 'OFF_REASON', 'WARNING_REASON', 'BALANCER_STATUS'.
  type: BATTERY_VOLTAGE
text_sensor.victron_ble: [source /config/esphome/testing.yaml:107]
  platform: victron_ble
  victron_ble_id: MySmartBatterySense
  name: Temperature

  Unknown value 'TEMPERATURE', valid options are 'ALARM', 'ACTIVE_AC_IN', 'ALARM_REASON', 'CHARGER_ERROR', 'DEVICE_STATE', 'ERROR_CODE', 'OFF_REASON', 'WARNING_REASON', 'BALANCER_STATUS'.
  type: TEMPERATURE

This is the custom code I added

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

Probabilly the problem is to use a new custom "victron_ble_id" that does not exsit in your code. Is it?

mogliasi commented 8 months ago

Hello, you're right! It's my fault. The sensor was dropped in wrong section (text_sensor) insted of (sensor).