neey

mail@pastecode.io avatar
unknown
yaml
a year ago
6.6 kB
35
Indexable
Never
substitutions:
  name: neey-balancer
  device_description: "Monitoraggio e controllo del bilanciatore NEEY 4A tramite bluetooth"
  external_components_source: github://syssi/esphome-jk-bms@main
  mac_address: 00:E4:4C:21:D7:4C

esphome:
  name: ${name}
  comment: ${device_description}
  project:
    name: "syssi.esphome-jk-bms"
    version: 1.5.0

esp32:
  board: az-delivery-devkit-v4
  framework:
    type: esp-idf

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

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

ota:

logger:
  level: DEBUG

# If you don't use Home Assistant please remove this `api` section and uncomment the `mqtt` component!
api:

# mqtt:
#   broker: !secret mqtt_host
#   username: !secret mqtt_username
#   password: !secret mqtt_password
#   id: mqtt_client

esp32_ble_tracker:
  on_ble_advertise:
    then:
      - lambda: |-
          if (x.get_name().rfind("GW-", 0) == 0) {
            ESP_LOGI("ble_adv", "Nuovo Bilanciatore NEEY Trovato");
            ESP_LOGI("ble_adv", "  Name: %s", x.get_name().c_str());
            ESP_LOGI("ble_adv", "  MAC address: %s", x.address_str().c_str());
            ESP_LOGD("ble_adv", "  Advertised service UUIDs:");
            for (auto uuid : x.get_service_uuids()) {
              ESP_LOGD("ble_adv", "    - %s", uuid.to_string().c_str());
            }
          }

ble_client:
  - mac_address: ${mac_address}
    id: client0

heltec_balancer_ble:
  - ble_client_id: client0
    throttle: 5s
    id: bms0

binary_sensor:
  - platform: heltec_balancer_ble
    balancing:
      name: "Bilanciatore"
    online_status:
      name: "${name} online status"

button:
  - platform: heltec_balancer_ble
    retrieve_settings:
      name: "${name} retrieve settings"
      id: retrieve_settings_button
    retrieve_device_info:
      name: "${name} retrieve device info"
    retrieve_factory_defaults:
      name: "${name} retrieve factory defaults"

number:
  - platform: heltec_balancer_ble
    cell_count:
      name: "${name} cell count"
    balance_trigger_voltage:
      name: "${name} balance trigger voltage"
    max_balance_current:
      name: "${name} max balance current"
    balance_sleep_voltage:
      name: "${name} balance sleep voltage"
    balance_start_voltage:
      name: "${name} balance start voltage"
    nominal_battery_capacity:
      name: "${name} nominal battery capacity"

sensor:
  - platform: heltec_balancer_ble
    min_cell_voltage:
      icon: "mdi:gauge-empty"
      name: "Minimo"
    max_cell_voltage:
      icon: "mdi:gauge-full"
      name: "Massimo"
    min_voltage_cell:
      icon: "mdi:battery-charging-10"
      name: "C. Bassa"
    max_voltage_cell:
      icon: "mdi:battery-charging-90"
      name: "C. Alta"
    delta_cell_voltage:
      icon: "mdi:all-inclusive"
      name: "Delta"
    average_cell_voltage:
      icon: "mdi:all-inclusive"
      name: "Media"
    cell_voltage_1:
      icon: "mdi:battery-70"
      name: "cella 1"
    cell_voltage_2:
      icon: "mdi:battery-70"
      name: "cella 2"
    cell_voltage_3:
      icon: "mdi:battery-70"
      name: "cella 3"
    cell_voltage_4:
      icon: "mdi:battery-70"
      name: "cella 4"
    cell_voltage_5:
      icon: "mdi:battery-70"
      name: "cella 5"
    cell_voltage_6:
      icon: "mdi:battery-70"
      name: "cella 6"
    cell_voltage_7:
      icon: "mdi:battery-70"
      name: "cella 7"
    cell_voltage_8:
      icon: "mdi:battery-70"
      name: "cella 8"
    cell_voltage_9:
      icon: "mdi:battery-70"
      name: "cella 9"
    cell_voltage_10:
      icon: "mdi:battery-70"
      name: "cella 10"
    cell_voltage_11:
      icon: "mdi:battery-70"
      name: "cella 11"
    cell_voltage_12:
      icon: "mdi:battery-70"
      name: "cella 12"
    cell_voltage_13:
      icon: "mdi:battery-70"
      name: "cella 13"
    cell_voltage_14:
      icon: "mdi:battery-70"
      name: "cella 14"
    cell_voltage_15:
      icon: "mdi:battery-70"
      name: "cella 15"
    cell_voltage_16:
      icon: "mdi:battery-70"
      name: "cella 16"
    cell_resistance_1:
      name: "Resistenza cella 1"
    cell_resistance_2:
      name: "Resistenza cella 2"
    cell_resistance_3:
      name: "Resistenza cella 3"
    cell_resistance_4:
      name: "Resistenza cella 4"
    cell_resistance_5:
      name: "Resistenza cella 5"
    cell_resistance_6:
      name: "Resistenza cella 6"
    cell_resistance_7:
      name: "Resistenza cella 7"
    cell_resistance_8:
      name: "Resistenza cella 8"
    cell_resistance_9:
      name: "Resistenza cella 9"
    cell_resistance_10:
      name: "Resistenza cella 10"
    cell_resistance_11:
      name: "Resistenza cella 11"
    cell_resistance_12:
      name: "Resistenza cella 12"
    cell_resistance_13:
      name: "Resistenza cella 13"
    cell_resistance_14:
      name: "Resistenza cella 14"
    cell_resistance_15:
      name: "Resistenza cella 15"
    cell_resistance_16:
      name: "Resistenza cella 16"
    total_voltage:
      icon: "mdi:auto-mode"
      name: "Totale V"
    temperature_sensor_1:
      name: "Temperatura sensore 1"
    temperature_sensor_2:
      name: "Temperatura sensore 2"
    total_runtime:
      name: "Durata totale grz"
    balancing_current:
      name: "Corrente bilanciabile"
    # Not implemented
    # errors_bitmask:
    #   name: "${name} errors bitmask"
    cell_detection_failed_bitmask:
      name: "${name} cell detection failed bitmask"
    cell_overvoltage_bitmask:
      name: "${name} cell overvoltage bitmask"
    cell_undervoltage_bitmask:
      name: "${name} cell undervoltage bitmask"
    cell_polarity_error_bitmask:
      name: "${name} cell polarity error bitmask"
    cell_excessive_line_resistance_bitmask:
      name: "${name} cell excessive line resistance bitmask"

switch:
  - platform: heltec_balancer_ble
    balancer:
      name: "${name} balancer"

text_sensor:
  - platform: heltec_balancer_ble
    # Not implemented
    # errors:
    #   name: "${name} errors"
    operation_status:
      name: "Stato Bilanciatore"
    total_runtime_formatted:
      name: "Durata totale"
    buzzer_mode:
      name: "${name} buzzer mode"
    battery_type:
      name: "${name} battery type"
interval:
  - interval: 30min
    then:
      - button.press: retrieve_settings_button