Updating API password?

I have two old devices that have a really weak API password that needs to be updated over-the-air.
When I change the API password and install wirelessly in ESPhome, I get :
“ERROR Error auth result: Error: Authentication invalid. Is the password correct?”

Can anyone explain how to update the password?

Thanks,
Kasper

try and turn of your wifi. it will then boot into AP mode. connect to it via your PC on networks and then use this link in your browser

http://192.168.4.1/

you will then be able to change and update passwords if my memory serves me correctly.

see how you go

Thanks for the suggestion. But it seems I can only change wifi settings or OTA update. I’m hoping there is a smart way of updating passwords OTA, I cant be the only person with a bad password :slight_smile:

Can you use the OTA Update, choose file (your yamal with all the correct code and wifi ssid and passwords?

then update

or make sure your wifi details are correct and then connect through HA & ESPHome and edit your code / passwords

Read the docs.
https://esphome.io/components/ota.html#updating-the-password

Thanks, I have. I’m looking for a way to change the API password - not the OTA password you are referencing. Out of curiosity, I tested if changing the key (my_ota) to (my_api) would work, but it doesn’t.

O sorry… this is the way I do it in ESPHome

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: !secret esphome_secret

# Over The Air Password (Stops somone on your network accessing files)
ota:
  password: !secret esphome_secret

# Wifi Information
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

I hope that I am understanding you. Not sure if it is your “my_api” in your code. I keep my passwords in secrets so it easy to keep track and change everyone if necessary but you can just replace it with your one

# Enable Home Assistant API
api:
  password: your_password_here

Then if HA doesn’t pick it up look in integrations and the one you trying to fix. Try the reload (you may have to reboot first) if that doesn’t work try delete it and then re-add it and it should ask for the API password.

It appears the 2023.2 release of Home Assistant may have fixed this for us-- Basically forcing usage of API Encryption (which isn’t a bad thing), and resetting API Password to null. I.e., we can just stop using API pwd, because we’re using the encryption keys instead.

I had been struggling with same thing (how to change API passwords via OTA). But was pleased to see how it was dealt with in 2023.2.

Had the same error while switching to a new wifi network with my devices.

my solution was: using the new wifi-credentials at “wifi_ssid” and “wifi_password”
and using the old wifi_password for the ota-config:

ota:
  password: "Old Wifi password"