syssi / esphome-tianpower-bms

ESPHome component to monitor a Tianpower Battery Management System via BLE
Apache License 2.0
8 stars 0 forks source link

2 Basen battery #21

Closed italodl closed 3 months ago

italodl commented 4 months ago

hi, I have 2 basen batteries and two esp32. I can't configure the second battery. the sensors have the same name and do not work. Is it possible to make both work?

syssi commented 4 months ago

Could you increase the log level

logger:
  level: VERY_VERBOSE
  logs:
    esp32_ble: DEBUG
    esp32_ble_tracker: VERY_VERBOSE
    tianpower_bms_ble: VERY_VERBOSE
    scheduler: DEBUG
    component: DEBUG
    sensor: DEBUG
    mqtt: INFO
    mqtt.idf: INFO
    mqtt.component: INFO
    mqtt.sensor: INFO
    mqtt.switch: INFO
    api.service: INFO
    api: INFO

and provide some logs of both batteries?

syssi commented 4 months ago

Could you provide some more details? For example are the ESP32 models different? It looks like ESP32S and ESP32-C3 models doesn't to a good job on Bluetooth at the moment.

syssi commented 4 months ago

If the naming of the sensors the only issue and the data arrives properly already you have to make sure the ESPHome nodes has different names:

# first node

substitutions:
  name: tianpower-bms-ble

# ...

sensor:
    total_voltage:
      name: "${name} total voltage"
    current:
      name: "${name} current"
    power:
      name: "${name} power"
# second node

substitutions:
  name: tianpower-bms-ble2

# ...

sensor:
    total_voltage:
      name: "${name} total voltage"
    current:
      name: "${name} current"
    power:
      name: "${name} power"

The name is part of the entities.

italodl commented 4 months ago

I used the same version of eps32 but I used the same name. I will use different names in the next tests and I will let you know the outcome

syssi commented 3 months ago

Let's close the issue. Feel free to re-open the issue if it still doesn't work.

italodl commented 3 months ago

hi, I tried changing the name and now the two batteries are monitored perfectly, each with the respective esp32 thanks very much

syssi commented 3 months ago

Awesome! Have fun!