Two passwords on secret.yaml file

Good morning. I have a network repeater connected via lan to the main modem. The repeater uses the same password as the modem but its SSID is different.
The problem is that I can’t configure the “secret.yalm” file with two SSIDs to be able to access the devices with both solutions

# Your Wi-Fi SSID and password
wifi_ssid: "first choice"
wifi_password: "my_psw"

wifi_ssid: "lan repeater "
wifi_password: "my_psw"

while on the device file.

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

I am trying to configure with these parameters but I cannot.
Anyone have any suggestions? thank you

Why not set the SSID to the same for both devices and then lock their channels.
Use either channel 1,6 or 11 for 2,4GHz to spread then out and make sure the two devices are not on the same channel.
For 5GHz just place one device at the lowest channels and the other at the highest.

The problem is that the wifi signal does not reach the repeater because it is too far away. The repeater receives from the LAN cable modem and creates its own wifi network. The esp01 component is affected by the wifi network of the repeater only.
I need the double SSid for maintenance: I extract the esp01 remotely and take it home to be able to modify it and then it automatically connects to the modem.

# Your Wi-Fi SSID and password
wifi_ssid: "first choice"
wifi_password: "my_psw"

wifi_ssid: "lan repeater "
wifi_password: "my_psw"

Everything works if I write passwords and SSids in the code but I can’t get it to work via “secret.yaml”

I see no reason why you can not use the same SSID and password on the two WLANs.

But you say you can write the two WiFi setting in the device file? How does that look?

If I write this in the device

wifi:
  networks:
  - ssid: "first choice"
    password: "my_psw"
  - ssid: "lan repeater "
    password: "my_psw"

the device works in both wifi networks

If instead I create the “secret.yaml”

# Your Wi-Fi SSID and password
wifi_ssid: "first choice"
wifi_password: "my_psw"

wifi_ssid: "lan repeater "
wifi_password: "my_psw"

Compiling gives me an error.
I regularly use secret.yaml on devices that use the main network. it all goes down the drain when I try to write two SSid and two psw in secret.yaml

And if you use ?:

wifi:
   networks:
   - ssid:! secret wifi_ssid1
     password:! secret wifi_password1
   - ssid:! secret wifi_ssid2
     password:! secret wifi_password2

secret.yaml

wifi_ssid1: "first choice"
wifi_password1: "my_psw"

wifi_ssid2: "lan repeater "
wifi_password2: "my_psw"

Maybe still a gap problem in ssid

1 Like

In secrets.yaml

### WiFi
wifi_ssid: "Any_WiFi"
wifi_password: "Any_Password"

iot_wifi_ssid: "IoT_WiFi"
iot_wifi_password: "IoT_Passwod"

In device yaml.

wifi:
  ssid: !secret iot_wifi_ssid
  password: !secret iot_wifi_password

I solved it thanks to the suggestions of Coolie 1101 and pepe59. I used both and created this code:
in secret.yaml

# Your Wi-Fi SSID and password
wifi_ssid: "first choice"
wifi_password: "my_psw"

iot_wifi_ssid: "IoT_WiFi"
iot_wifi_password: "IoT_Passwod"

#wifi_ap_ssid_1: "IoT_WiFi"
wifi_ap1_password: "ap_psw"

and on the device

wifi:
  networks:
   - ssid: !secret wifi_ssid
     password: !secret wifi_password
   - ssid: !secret iot_wifi_ssid
     password: !secret iot_wifi_password
  # Other options
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "IoT_WiFi"
    password: !secret wifi_ap1_password

tested and working. I can’t give both of them the check mark “solved”

I can’t get both of them to tick “resolved”.
I hope that Coolie1101 will forgive me but I will give the solution to pepe59 because his code is closest to mine.
however, you were both decisive.
thank you

1 Like

thanks a ton, working fine now…
I was struggling to get going with my Wifi Access point extender…