M5nanoc6 flash

Hello, I am trying to flash a M5NanoC6 and this is not working at all. Here is the code I am using

substitutions:
  esphome_name: espteslakey
  esphome_comment: Tesla eKey
  esphome_project_name: "Tesla.eKey Project"
  esphome_project_version: "tesla_e_key_2025_10_29_14_30"
  device_name: teslaekey
  friendly_name: "Tesla eKey"
  global_update_interval: 15min
  wifi_update_interval: 24h

esphome:
  name: ${device_name}
  friendly_name: ${friendly_name}
  comment: ${esphome_comment}
  project:
    name: ${esphome_project_name}
    version: ${esphome_project_version}
  platformio_options:
    # Use official PlatformIO registry
    platform: [email protected]
    lib_ldf_mode: deep+
    lib_deps:
      - git+https://github.com/PedroKTFC/tesla-ble.git#main

esp32:
  variant: esp32c6
  board: esp32-c6-devkitc-1
  framework:
    type: esp-idf
    # ESPHome when pinning:
    version: 5.2.1
    platform_version: 6.6.0

logger:
  level: INFO

api:
  encryption:
    key: !secret api_encryption_key

ota:
  - platform: esphome

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  fast_connect: true
  power_save_mode: none
  ap:
    ssid: "${friendly_name} Fallback"

# BLE scanner + BLE client (Tesla MAC)
esp32_ble_tracker:

ble_client:
  - mac_address: !secret tesla_ble_mac
    id: tesla_vcsec

external_components:
  - source: github://PedroKTFC/esphome-tesla-ble
    components: [tesla_ble_vehicle]

# Pedro fork requires these polling fields present
tesla_ble_vehicle:
  ble_client_id: tesla_vcsec
  vin: !secret tesla_vin
  update_interval: 10s        # duration with unit
  post_wake_poll_time: 300    # integers (seconds) for the rest
  poll_data_period: 60
  poll_asleep_period: 120
  poll_charging_period: 10
  ble_disconnected_min_time: 300
  fast_poll_if_unlocked: 0
  wake_on_boot: false

# Diagnostics: BLE signal, Wi-Fi, uptime, status
sensor:
  - platform: ble_client
    type: rssi
    ble_client_id: tesla_vcsec
    id: tesla_ble_rssi
    name: "Tesla BLE RSSI"
    update_interval: 5s
    filters:
      - sliding_window_moving_average:
          window_size: 10
          send_every: 1

  - platform: template
    id: tesla_ble_signal_pct
    name: "Tesla BLE Signal (%)"
    unit_of_measurement: "%"
    update_interval: 5s
    lambda: |-
      if (isnan(id(tesla_ble_rssi).state)) return NAN;
      const float rssi = id(tesla_ble_rssi).state;  // ~ -90..-30 dBm
      float pct = (rssi + 90.0f) * (100.0f / 60.0f); // -90→0%, -30→100%
      if (pct < 0) pct = 0;
      if (pct > 100) pct = 100;
      return pct;

  - platform: wifi_signal
    name: "ESP Wi-Fi RSSI"
    update_interval: ${wifi_update_interval}

  - platform: uptime
    name: "ESP Uptime"

binary_sensor:
  - platform: status
    name: "ESP Online"

switch:
  - platform: restart
    name: "${device_name} Restart"

and here is the error I get:

INFO ESPHome 2025.10.3
INFO Reading configuration /config/esphome/tesla-key-ble.yaml...
WARNING The selected framework version is not the recommended one. If there are connectivity or build issues please remove the manual version.
WARNING The selected platform version is not the recommended one. If there are connectivity or build issues please remove the manual version.
WARNING The selected framework version is not the recommended one. If there are connectivity or build issues please remove the manual version.
WARNING The selected platform version is not the recommended one. If there are connectivity or build issues please remove the manual version.
INFO Generating C++ source...
INFO Compiling app...
Processing teslaekey (board: esp32-c6-devkitc-1; framework: espidf; platform: [email protected])
--------------------------------------------------------------------------------
Tool Manager: Installing https://github.com/pioarduino/esp-idf/releases/download/v5.2.1/esp-idf-v5.2.1.zip
INFO Installing https://github.com/pioarduino/esp-idf/releases/download/v5.2.1/esp-idf-v5.2.1.zip
WARNING Package download failed: Got the unrecognized status code '404' when downloaded https://github.com/pioarduino/esp-idf/releases/download/v5.2.1/esp-idf-v5.2.1.zip. Retrying... (attempt 1/3)
WARNING Package download failed: Got the unrecognized status code '404' when downloaded https://github.com/pioarduino/esp-idf/releases/download/v5.2.1/esp-idf-v5.2.1.zip. Retrying... (attempt 2/3)
PackageException: Got the unrecognized status code '404' when downloaded https://github.com/pioarduino/esp-idf/releases/download/v5.2.1/esp-idf-v5.2.1.zip

Framework and platform are optional.
Try without

Actually, 404 means it can’t download package. Is esphome device builder able to access internet. Is that weblink correct? Thats the failure

Is that chip suppprted by that idf yet?

Any reason you are specifying specific versions? Latest is often the best.

Have there been any updates? The versions you are pointing to may have been superseded and archived, hence the URL is not valid any more (the 404 not found error).

Have you cleared your ESPHome build cache before recompiling?

ESPhome have access, yes. I am running other devices. But I tried to access it via the webbrowser, it is not working. Do I have the wrong link? See screenshot

Yep, 404 not found means it wasnt found. Keep looking.
The search button on Github may prove fruitful, or just go up a few levels to see where the latest code can be foind.

The github mentions tests done with it, so I supposed it is a yes. No reason for the version, but I can remove it.
I realized the 404 but I am not sure I see other docs there or how I could manage it.
Before recompiling, i am restarting the esphome, does that clear the cache?

No, select the three dots at the bottom right corner of your ESPHome device and select Clean Build Files from the menu. This will purge the existing files that may have become corrupt or have intermingled versions and cause a fresh download of the current files on your next compile which can cure some extremely frustrating problems hard to troubleshoot.

Yes, that fresh compile will take a few seconds longer, but you will have assurance of integrity of your build code.

Always do this when switching esp-idf and arduino platforms in ESPHome.

GitHub, by its very nature, can be very dynamic. Everybody loves to update code. What was current a few seconds ago is now superseded. You spotted a bug, a spelling mistake, a missing comma, added a comment for better understanding of code flow and algorithms, thought of a better way to solve a problem, so you fixed it and updated your repositary. Unless you have very good reason to stick with an older version, the latest is usually the better one to use. You have to trust the developer knows their software best. Such is the nature and power of open source software.

This is why I usually recommend updating to the latest version of software.

For instance, the software version of the esp idf aoftware you are trying to download (and consistently failing), version 5.2.1 is now up to 5.5.1 as of a few seconds ago. Are you sure you want obsolete code running on your device, especially if the changes have fixed a problem you may be experiencing? The change logs and diff files may prove interesting reading to confirm this.

1 Like

change the code to this, but now the other issue is I cannot get the sensors displayed… See code and screenshot results

substitutions:
  esphome_name: espteslakey
  esphome_comment: Tesla eKey
  esphome_project_name: "Tesla.eKey Project"
  esphome_project_version: "tesla_e_key_2025_10_31"
  device_name: teslaekey_nano_c6
  friendly_name: "Tesla eKey"
  global_update_interval: 15min
  wifi_update_interval: 24h

esphome:
  name: ${device_name}
  friendly_name: ${friendly_name}
  comment: ${esphome_comment}
  project:
    name: ${esphome_project_name}
    version: ${esphome_project_version}
  platformio_options:
    lib_ldf_mode: deep+
    lib_deps:
      - nanopb/[email protected]
      - https://github.com/PedroKTFC/tesla-ble.git#main   # provides car_server.pb.h, etc.

esp32:
  variant: esp32c6
  board: esp32-c6-devkitc-1   # stable choice for ESPHome/PlatformIO on C6
  framework:
    type: esp-idf              # to avoid toolchain loops

logger:
  level: INFO

api:
  encryption:
    key: !secret api_encryption_key

ota:
  - platform: esphome

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  fast_connect: true
  power_save_mode: none
  ap:
    ssid: "${friendly_name} Fallback"

# BLE scan base + VCSEC BLE client
esp32_ble_tracker:

ble_client:
  - mac_address: !secret tesla_ble_mac
    id: tesla_vcsec

external_components:
  - source: github://PedroKTFC/esphome-tesla-ble
    components: [tesla_ble_vehicle]

# Fork expects these polling params
tesla_ble_vehicle:
  ble_client_id: tesla_vcsec
  vin: !secret tesla_vin
  update_interval: 10s
  post_wake_poll_time: 300
  poll_data_period: 60
  poll_asleep_period: 120
  poll_charging_period: 10
  ble_disconnected_min_time: 300
  fast_poll_if_unlocked: 0
  wake_on_boot: false

# Diagnostics
sensor:
  - platform: ble_client
    type: rssi
    ble_client_id: tesla_vcsec
    id: tesla_ble_rssi
    name: "Tesla BLE RSSI"
    update_interval: 5s
    filters:
      - sliding_window_moving_average:
          window_size: 10
          send_every: 1

  - platform: template
    id: tesla_ble_signal_pct
    name: "Tesla BLE Signal (%)"
    unit_of_measurement: "%"
    update_interval: 5s
    lambda: |-
      if (isnan(id(tesla_ble_rssi).state)) return NAN;
      const float rssi = id(tesla_ble_rssi).state;  // ~ -90..-30 dBm
      float pct = (rssi + 90.0f) * (100.0f / 60.0f); // -90→0%, -30→100%
      if (pct < 0) pct = 0;
      if (pct > 100) pct = 100;
      return pct;

  - platform: wifi_signal
    name: "ESP Wi-Fi RSSI"
    update_interval: ${wifi_update_interval}

  - platform: uptime
    name: "ESP Uptime"

# Pull in text_sensor headers
text_sensor:
  - platform: template
    id: _ts_placeholder
    name: "TS Placeholder"
    internal: true
    lambda: |-
      return std::string("");

binary_sensor:
  - platform: status
    name: "ESP Online"

switch:
  - platform: restart
    name: "${device_name} Restart"

It says “esp disconnected”

Lets look at what is happening behind the scenes:

Update HomeAssistant to the latest.
Update your ESPHome to the latest.
Clear the ESPHome cache.
Change the line around line 30 that says INFO under logger, level to say DEBUG instead.
Recompile your code and update your ESP32.
Watch the compile error log complete, attempt connection, and some of the return codes bounce back.
Post your ESPHome log.

We can change it back later once we have found the cause.

This is the solution:

substitutions:

  device_name: "tesla-key"
  friendly_name: "Tesla Key"
  
  tesla_vin: !secret tesla_vin

  tesla_ble_mac: !secret tesla_ble_mac


# ==================================
#    DO NOT EDIT BELOW THIS LINE
# ==================================

esphome:
  name: "${device_name}"
  friendly_name: "${friendly_name}"
  comment: "Tesla BLE Client on M5NanoC6"
  name_add_mac_suffix: false
  project:
    name: "pedroktfc.esphome-tesla-ble"
    version: "1.0"

***# Set up the M5NanoC6 board (ESP32-C6)***
***# This requires the esp-idf framework***
***esp32:***
***  # NOTE: Replaced m5stack-nanoc6 with a recognised C6 board name***
***  board: esp32-c6-devkitc-1***
***  variant: esp32c6***
***  framework:***
***    type: esp-idf***


api:
  encryption:
    key: !secret api_encryption_key
ota:
  password: !secret ota_password 


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


logger:

ble_client:
  - mac_address: "XX:XX:XX:XX:XX:XX" #enter your tesla mac address here
    id: ble_tesla_id

external_components:
  - source:
      type: git
      url: https://github.com/PedroKTFC/esphome-tesla-ble
      ref: newteslalib
    components: [tesla_ble_vehicle] 


**packages:**
**  tesla_ble_configs: **
**    url: https://github.com/PedroKTFC/esphome-tesla-ble**
**    ref: newteslalib**
**    files:**
**      - packages/base.yml**
**      - packages/common.yml**
**      - packages/project.yml**

# Define the main tesla component
tesla_ble_vehicle:
  vin: !secret tesla_vin
  id: tesla_ble_vehicle_id
  #private_key: "${tesla_ble_private_key}"
  update_interval: 10s # default
  post_wake_poll_time: 300 # How long to poll for data after car awakes (s)
  poll_data_period: 60 # Normal period when polling for data when not asleep (s)
  poll_asleep_period: 900 # Period to poll for data when asleep (s)
  poll_charging_period: 10 # Period to poll for data when charging (s)
  ble_disconnected_min_time: 900 # Minimum time BLE must be disconnected before sensors are Unknwon (s)
  fast_poll_if_unlocked: 0 # if != 0, fast polls are enabled when unlocked
  wake_on_boot: 0 # != 0 wakes car on device boot


  is_asleep:
    name: "Asleep"
  is_user_present:
    name: "User presence"
  is_unlocked:
    id: "is_unlocked"
    name: "Doors"
  is_charge_flap_open:
    id: "is_charge_flap_open"
    name: "Charge flap"
  is_boot_open:
    id: "is_boot_open"
    name: "Boot"
  is_frunk_open:
    id: "is_frunk_open"
    name: "Frunk"
  shift_state:
    name: "Shift state"
  defrost_state:
    id: "defrost_state"
    name: "Defrost state"
  charge_state:
    id: "charge_state"
    name: "Charge level"
  odometer:
    name: "Odometer"
    filters:
      - multiply: 0.01 # Odometer is in hundredths of a mile (can use this to convert to km)
  charge_current:
    id: "charge_current"
    name: "Charge current"
  charge_voltage:
    id: "charge_voltage"
    name: "Charge voltage"  
  charge_power:
    id: "charge_power"
    name: "Charge power"
  charge_energy_added:
    id: "charge_energy_added"
    name: "Charge energy added"
  charge_distance_added:
    id: "charge_distance_added"
    name: "Charge distance added"
  max_soc:
    id: "max_soc"
    name: "Charge limit"
  max_amps:
    id: "max_amps"
    name: "Current limit"
  mins_to_limit:
    id: "mins_to_limit"
    name: "Minutes to limit"
  battery_range:
    name: "Range"
  charging_state:
    id: "charging_state"
    name: "Charging state"
  last_update:
    name: "Last update"
  is_climate_on:
    id: "is_climate_on"
    name: "Climate"
  internal_temp:
    name: "Interior"
  external_temp:
    name: "Exterior"
  windows_state:
    id: "windows_state"
    name: "Windows"
      
button:
  - platform: template
    id: ble_pair
    name: Pair BLE key
    icon: mdi:key-wireless
    on_press:
      - lambda: id(tesla_ble_vehicle_id)->startPair();
    entity_category: diagnostic

  - platform: template
    id: btn_wake_up
    name: Wake up
    icon: mdi:sleep-off
    on_press:
    - lambda: id(tesla_ble_vehicle_id)->wakeVehicle();

  - platform: template
    id: btn_flash_light
    name: Flash light
    icon: mdi:car-light-high
    on_press:
      - lambda: id(tesla_ble_vehicle_id)->sendCarServerVehicleActionMessage (FLASH_LIGHT, 0);

  - platform: template
    id: btn_sound_horn
    name: Sound horn
    icon: mdi:bugle
    on_press:
      - lambda: id(tesla_ble_vehicle_id)->sendCarServerVehicleActionMessage (SOUND_HORN, 0);

  - platform: template
    id: btn_unlock_charge_port
    name: Unlock charge port
    icon: mdi:ev-plug-ccs2
    on_press:
      - lambda: id(tesla_ble_vehicle_id)->sendVCSECClosureMoveRequestMessage (VCSEC_ClosureMoveRequest_chargePort_tag, VCSEC_ClosureMoveType_E_CLOSURE_MOVE_TYPE_OPEN);

  - platform: template
    id: btn_unlatch_driver_door
    name: Unlatch driver door
    icon: mdi:car-door
    on_press:
      - lambda: id(tesla_ble_vehicle_id)->sendVCSECClosureMoveRequestMessage (VCSEC_ClosureMoveRequest_frontDriverDoor_tag, VCSEC_ClosureMoveType_E_CLOSURE_MOVE_TYPE_OPEN);
    disabled_by_default: true

  - platform: template
    id: btn_regenerate_key
    name: Regenerate key
    icon: mdi:key-change
    on_press:
      - lambda: id(tesla_ble_vehicle_id)->regenerateKey();
    entity_category: diagnostic
    disabled_by_default: true

  - platform: template
    id: btn_force_data_update
    name: Force data update
    icon: mdi:database-sync
    on_press:
      - lambda: id(tesla_ble_vehicle_id)->enqueueVCSECInformationRequest(true);
    entity_category: diagnostic

sensor:
  - platform: ble_client
    type: rssi
    id: ble_signal
    ble_client_id: ble_tesla_id
    name: "BLE Signal"
    icon: mdi:bluetooth
    update_interval: 60s
    entity_category: diagnostic

switch:
  - platform: template
    id: sw_charger
    name: "Charger"
    optimistic: true
    icon: mdi:lightning-bolt
#    restore_mode: RESTORE_DEFAULT_OFF
    lambda: |-
      if ((id(charging_state).state == "Charging") or (id(charging_state).state == "Starting") or (id(charging_state).state == "Calibrating")) {
        return true;
      } else {
        return false;
      }
    turn_on_action:
      - lambda: id(tesla_ble_vehicle_id)->sendCarServerVehicleActionMessage(SET_CHARGING_SWITCH, 1);
    turn_off_action:
      - lambda: id(tesla_ble_vehicle_id)->sendCarServerVehicleActionMessage(SET_CHARGING_SWITCH, 0);

  - platform: template
    id: sw_sentry_mode
    name: "Sentry mode"
    optimistic: true
    icon: mdi:record-circle-outline
    assumed_state: true # we can't read the state 
    restore_mode: RESTORE_DEFAULT_OFF
    turn_on_action:
      - lambda: id(tesla_ble_vehicle_id)->sendCarServerVehicleActionMessage(SET_SENTRY_SWITCH, 1);
    turn_off_action:
      - lambda: id(tesla_ble_vehicle_id)->sendCarServerVehicleActionMessage(SET_SENTRY_SWITCH, 0);
  
  - platform: template
    id: sw_climate
    name: "Climate"
    optimistic: true
    icon: mdi:fan
    lambda: |-
      if (id(is_climate_on).state) {
        return true;
      } else {
        return false;
      }
    restore_mode: RESTORE_DEFAULT_OFF
    turn_on_action:
      - lambda: id(tesla_ble_vehicle_id)->sendCarServerVehicleActionMessage(SET_HVAC_SWITCH, 1);
    turn_off_action:
      - lambda: id(tesla_ble_vehicle_id)->sendCarServerVehicleActionMessage(SET_HVAC_SWITCH, 0);

  - platform: template
    id: sw_steering_wheel_heat
    name: "Steering wheel heat"
    optimistic: true
    icon: mdi:steering
    assumed_state: true # we can't read the state 
    restore_mode: RESTORE_DEFAULT_OFF
    turn_on_action:
      - lambda: id(tesla_ble_vehicle_id)->sendCarServerVehicleActionMessage(SET_HVAC_STEERING_HEATER_SWITCH, 1);
    turn_off_action:
      - lambda: id(tesla_ble_vehicle_id)->sendCarServerVehicleActionMessage(SET_HVAC_STEERING_HEATER_SWITCH, 0);
  
  - platform: template
    id: sw_defrost_car
    name: Defrost car
    optimistic: true
    icon: mdi:snowflake-melt
    lambda: |-
      if (id(defrost_state).state != "Off") {
        return true;
      } else {
        return false;
      }
    turn_on_action:
      - lambda: id(tesla_ble_vehicle_id)->sendCarServerVehicleActionMessage (DEFROST_CAR, 1);
    turn_off_action:
      - lambda: id(tesla_ble_vehicle_id)->sendCarServerVehicleActionMessage (DEFROST_CAR, 0);

  - platform: template
    id: fast_poll_if_unlocked
    name: "Fast poll if unlocked"
    optimistic: true
    icon: mdi:car-door-lock-open
    entity_category: config
    restore_mode: RESTORE_DEFAULT_OFF
    disabled_by_default: true
    on_state:
      - if:
          condition:
            lambda: 'return x;'
          then:
            - lambda: id(tesla_ble_vehicle_id)->fast_poll_if_unlocked_ = 1;
          else:
            - lambda: id(tesla_ble_vehicle_id)->fast_poll_if_unlocked_ = 0;

  - platform: template
    id: wake_on_boot
    name: "Wake on boot"
    optimistic: true
    icon: mdi:sleep-off
    entity_category: config
    restore_mode: RESTORE_DEFAULT_OFF
    disabled_by_default: true
    on_state:
      - if:
          condition:
            lambda: 'return x;'
          then:
            - lambda: id(tesla_ble_vehicle_id)->wake_on_boot_ = 1;
          else:
            - lambda: id(tesla_ble_vehicle_id)->wake_on_boot_ = 0;
  


  - platform: ble_client
    id: sw_ble_connection
    ble_client_id: ble_tesla_id
    name: "BLE Connection"
    entity_category: diagnostic

lock:
  - platform: template
    id: lock_car
    name: "Lock car"
    optimistic: true
    icon: mdi:lock
    lambda: |-
      if (id(is_unlocked).state) {
          return LOCK_STATE_UNLOCKED;
        } else {
          return LOCK_STATE_LOCKED;
        }
    unlock_action:
      - lambda: |-
          id(tesla_ble_vehicle_id)->lockVehicle(VCSEC_RKEAction_E_RKE_ACTION_UNLOCK);
    lock_action:
      - lambda: |-
          id(tesla_ble_vehicle_id)->lockVehicle(VCSEC_RKEAction_E_RKE_ACTION_LOCK);

cover:
  - platform: template
    id: cov_vent
    name: "Vent"
    optimistic: false #### true
    icon: mdi:car-door
    device_class: door
    lambda: |-
      if (id(windows_state).state) {
        return COVER_OPEN;
      } else {
        return COVER_CLOSED;
      }
    close_action: #### This way round to make the arrows follow the desired window motion
      - lambda: |-
          id(tesla_ble_vehicle_id)->sendCarServerVehicleActionMessage (SET_WINDOWS_SWITCH, 0);
    open_action:
      - lambda: |-
          id(tesla_ble_vehicle_id)->sendCarServerVehicleActionMessage (SET_WINDOWS_SWITCH, 1);

  - platform: template
    id: cov_charge_port
    name: "Charge port"
    optimistic: true
    device_class: door
    icon: mdi:ev-plug-ccs2
    lambda: |-
      if (id(is_charge_flap_open).state) {
        return COVER_OPEN;
      } else {
        return COVER_CLOSED;
      }
#    restore_mode: RESTORE_DEFAULT_OFF
    open_action:
      - lambda: id(tesla_ble_vehicle_id)->sendCarServerVehicleActionMessage(SET_OPEN_CHARGE_PORT_DOOR,1);
    close_action:
      - lambda: id(tesla_ble_vehicle_id)->sendCarServerVehicleActionMessage(SET_CLOSE_CHARGE_PORT_DOOR,1);
  
  - platform: template
    id: cov_boot
    name: "Boot"
    optimistic: true
    device_class: door
    icon: mdi:car-back
    lambda: |-
      if (id(is_boot_open).state) {
        return COVER_OPEN;
      } else {
        return COVER_CLOSED;
      }
#    restore_mode: RESTORE_DEFAULT_OFF
    open_action:
      - lambda: id(tesla_ble_vehicle_id)->sendVCSECClosureMoveRequestMessage (VCSEC_ClosureMoveRequest_rearTrunk_tag, VCSEC_ClosureMoveType_E_CLOSURE_MOVE_TYPE_OPEN);
    close_action:
      - lambda: id(tesla_ble_vehicle_id)->sendVCSECClosureMoveRequestMessage (VCSEC_ClosureMoveRequest_rearTrunk_tag, VCSEC_ClosureMoveType_E_CLOSURE_MOVE_TYPE_CLOSE);

  - platform: template
    id: cov_frunk
    name: "Frunk"
    optimistic: true
    device_class: door
    icon: mdi:car
#    assumed_state: true # we can't read the state 
    lambda: |-
      if (id(is_frunk_open).state) {
        return COVER_OPEN;
      } else {
        return COVER_CLOSED;
      }
    open_action:
      - lambda: id(tesla_ble_vehicle_id)->sendVCSECClosureMoveRequestMessage (VCSEC_ClosureMoveRequest_frontTrunk_tag, VCSEC_ClosureMoveType_E_CLOSURE_MOVE_TYPE_OPEN);
    
number:

  - platform: template
    name: "Charging Amps"
    id: charging_amps
    icon: mdi:ev-station
    unit_of_measurement: "A"
    mode: slider
    update_interval: 2s
    min_value: 0
    max_value: 32 # Fixed static integer (safe max)
    step: 1
    set_action:
      - lambda: |-
          int var_x = static_cast<int>(x);
          id(tesla_ble_vehicle_id)->sendCarServerVehicleActionMessage(SET_CHARGING_AMPS, var_x);
    lambda: |-
      if (id(charging_amps).has_state()) 
      {
        return id(charging_amps).state; 
      }
      else 
      {
        return 0;
      }

  - platform: template
    name: "Charging Limit"
    id: charging_limit
    icon: mdi:ev-station
    unit_of_measurement: "%"
    mode: slider
    update_interval: 2s
    min_value: 50
    max_value: 100
    step: 1
    set_action:
      - lambda: |-
          int var_x = static_cast<int>(x);
          id(tesla_ble_vehicle_id)->sendCarServerVehicleActionMessage(SET_CHARGING_LIMIT, var_x);
    lambda: |-
      if (id(charging_limit).has_state())
      {
        return id(charging_limit).state;
      }
      else 
      {
        return 0;
      }

  - platform: template
    id: post_wake_poll_time
    name: "Post wake poll time"
    icon: mdi:timelapse
    min_value: 0
    max_value: 1000
    mode: box
    step: 1
    restore_value: true
    initial_value: 300
    optimistic: true
    disabled_by_default: true
    entity_category: config
    on_value:
      - lambda: |-
          id(tesla_ble_vehicle_id)->post_wake_poll_time_ = x * 1000;
  - platform: template
    id: poll_data_period
    name: "Poll data period"
    icon: mdi:timer-outline
    min_value: 0
    max_value: 1000
    mode: box
    step: 1
    restore_value: true
    initial_value: 60
    optimistic: true
    disabled_by_default: true
    entity_category: config
    on_value:
      - lambda: |-
          id(tesla_ble_vehicle_id)->poll_data_period_ = x * 1000;
  - platform: template
    id: poll_asleep_period
    name: "Poll asleep period"
    icon: mdi:bed-clock
    min_value: 0
    max_value: 1000
    mode: box
    step: 1
    restore_value: true
    initial_value: 60
    optimistic: true
    disabled_by_default: true
    entity_category: config
    on_value:
      - lambda: |-
          id(tesla_ble_vehicle_id)->poll_asleep_period_ = x * 1000;
  - platform: template
    id: poll_charging_period
    name: "Poll charging period"
    icon: mdi:timer-sync-outline
    min_value: 0
    max_value: 1000
    mode: box
    step: 1
    restore_value: true
    initial_value: 10
    optimistic: true
    disabled_by_default: true
    entity_category: config
    on_value:
      - lambda: |-
          id(tesla_ble_vehicle_id)->poll_charging_period_ = x * 1000;
  - platform: template
    id: ble_disconnected_min_time
    name: "BLE disconnected min time"
    icon: mdi:bluetooth-connect
    min_value: 0
    max_value: 1000
    mode: box
    step: 1
    restore_value: true
    initial_value: 300
    optimistic: true
    disabled_by_default: true
    entity_category: config
    on_value:
      - lambda: |-
          id(tesla_ble_vehicle_id)->ble_disconnected_min_time_ = x * 1000;

Could you please explain what you did or highlight what you changed in the yaml? It will be helpful for others looking at This thread in the future

I tried to make it bold, but I am not sure it worked. Anyhow, here are the changes done:

***# Set up the M5NanoC6 board (ESP32-C6)***
***# This requires the esp-idf framework***
***esp32:***
***  # NOTE: Replaced m5stack-nanoc6 with a recognised C6 board name***
***  board: esp32-c6-devkitc-1***
***  variant: esp32c6***
***  framework:***
***    type: esp-idf***



**packages:**
**  tesla_ble_configs: **
**    url: https://github.com/PedroKTFC/esphome-tesla-ble**
**    ref: newteslalib**
**    files:**
**      - packages/base.yml**
**      - packages/common.yml**
**      - packages/project.yml**