How to change Wi-Fi information on my ESP32

Hello,

I am currently using a ESP32 which is connected to my RaspberryPi 4 via wifi. I am going to change my wifi so all my password and id will change. But only part of my code mentioning about wifi is this.

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

Can you help me to change my wifi please.

Thank you!

Go to the esphome addon config page , there is a secrets button in the upper right corner , click it and edit with your new info.

I found it. Thank you for your help!

Wait , I had some doubts and there is more to it.
Each device has to be updated also to reflect the change in secrets.

You can have multiple wifi (old and new)

So this is for change directly the main code if I get it right. But if I change just the secrets won’t it be work? Because I actually doesn’t need my old infos.

If you update de device via USB , anything will work because wifi is not involved.
But if you update wirelessly, it will fail whenever it needs to connect to wifi and the actual wifi is still the old one.
Declaring the two networks seems the solution.