SSID and Password as variables

Hi. I´ve tons of devices configured introducing in code the SSID name and password. I´m going to move and I´m afraid thinking on having to configure again all the devices with the new SSID & pw of the new router.
Is there a way to give SSID and password a variable name in the code (wifi: variable_name password:variable_pw)?
Then, in secrets.yaml or wherever you wil give values to both variables so if you need to change any of them you change it just there and the devices will know the new values without having to go one by one changing all of them. Thank you in advance

Yes

:wink:

But if you take your modem/router with you …
And your HA instance as well

It’ll be completely transparent (apart from changing your home location)

:face_with_raised_eyebrow:

I can´t. In my new house the ISP is different. I have to give back my router to my actual ISP.

Give back ???

What are they going to do with it ?

My last modem (ISP Provided) wouldn’t let me bind ip/mac addresses (that quickly went in the bin) so my modem is ‘my own’ (a DrayTek Vigor 2762ac) and so far it has connected under 3 different ISP’s

I understand your reasoning and it will be a good opportunity to tidy up your config
Good luck
:+1:

If you get a new Router from your ISP, simply reconfigure the SSID and PW to the same as you were using before. Done

1 Like

I don’t know what devices you talk about, but in most cases the SSID and password is stored on the device itself, not in HA’s configuration.yaml, so you still not to change these.

My over 60 tasmota devices can be changed at all at once by issuing two commands on one tasmota console, but other devices are more difficult. For my openmqttgateways I need to recompile the code and reflash, my esprflink I don’t know, my easpeasy needs to be done from it’s webpage, etc…
Can be a lot of work in the end.

Marcus,
Why were you replying to me ?
Did I imply I needed this advice ?
This is almost implicit in receiving ANY new device, “CHANGE THE PASSWORDS”

I love that some people change their SSID’s to something passive aggressive (when justified) say :- “Dave_at_12C_is_a_duffus” but personally I can’t be bothered changing the login information on ALL the devices we have.

:man_shrugging:

My IPS also wanted me to send back my old router when I asked for a upgrade.
They sent me the shipping documents and all that but I didn’t send it.

Just keep all the documents and wait a few weeks/months, then it’s yours!
And then you make one of your routers a AP by setting a fixed IP and turning off DHCP.
And you run a ethernet cable from one LAN port to the other routers LAN port (LAN = one of the four ports, not the one labeled “Internet”).

And that is how you extend your WIFI signal for free.
If you need more range you just go to any second hand market and buy a router for next to nothing from people who “changed ISP and have no use of the old router”.
I have bought a router in perfect condition for $0.10, if that is not a good deal then I don’t know what is.

Edit: the above method of extending your range assumes both routers have the same SSID, password and password type (? Can’t remember what it’s called WEP, WPA2 and so on…), which is easy to do.

1 Like

WPA2/PSK that pretty much eliminates someone pressing that stupid button (WPS) on the back of the router to just ‘allow’ login’s (But you should turn off WPS anyway)

Unfortunately that is not correct. If you configure two routers with the same SSID and PW you will have two WIFI nets, not one shared… The effect is, that your device will always try to get the best signal and therefor switches between these two nets. In the end this lowers your speed dramatically, if used for a longer period of time.

But you were on the right path, two routers is right, but you need to configure your second router to be an accesspoint and not “a second net”. :slight_smile:

@Mutt
I don’t know where you live, but the regulation to give back a router to your ISP was lifted only two years ago in the EU. So until then, it was the usual process to get the router from the ISP, and you weren’t allowed to change it! Yep, if you used your own hardware, you were banned. No joke, I ran a FritzBox from the ISP, and behind it, I started my network with my own router (ddwrt)…

I still have my contract with my ISP from around ten or twelve years ago, where I had a special part, that allowed me to use my own hardware. Was 5.-€/month on top. I’m still paying, because the rest of the contract is that good, I wouldn’t want to change that… :smiley:

I don’t think that’s accurate at all. I know since brexit my opinion on all things EU no longer counts, but for my entire life prior to us voting out I was never subjected to any such draconian policy by any of the multiple ISPs I’ve worked my way through and always used my own equipment.

1 Like

And that is exactly what you will get, the second router will be an accesspoint if you disable DHCP and use the LAN ports.
If you don’t believe me then try it yourself.
I have three routers set up this way.

1 Like

Where I live, you only have the choice of 2 real ISP’s, and 3 virtual one’s ( that use the equipment of one of the other two). They all install their own hardware, combo boxes that are router/vdsl modem or router/cable modem. Only the smallest (virtual) one lets you choose your own combo (as long as it is one of the 2 approved models)

Never heard of that either.
And if that was EU law then I’m quite sure most of us in Sweden should be in jail.

I have a hard time understanding why they want to force you to any specific hardware actually. Sure it makes it easier if they want to help, but who says they have to?
And they can add services to your setup as mine has, I have some options to use some type of… I don’t know really… I just don’t care.
But I could switch to any router I want. And some ISPs here don’t even supply or help you choose router.

1 Like

OK, not clear enough, sorry. :slight_smile: It wasn’t law, that you have to take the devices from your ISP, in Germany most ISPs wrote that in their contracts (especially Vodafone and Telefonica). The EU made a law two or three years ago, that this behaviour is not tollerable and the ISPs have to allow the use of other hardware. That’s what I meant with “lifted”.

Nope here in Germany until two or three years ago, you had to take what you get. Even now there are providers that give you a monthly discount, if you take their hardware… (1&1, one of the big providers but not carriers).

Oh, and btw. nobody is saying your opinion doesn’t count anymore. GreatBritain is a part of Europe, and it will always be a part of Europe (hopefully). We may have our differences, but they are mainly “business”. I still believe in the European idea, and I’m quite sure, GB and Europe will find a way to get together again. Maybe not that close, but we all are Europeans, and in the end we need to stick together against all the idiots around the world.

But you should tell people, that you have configured the second router… If you use it as another router and just plug it in, you will get into trouble. :slight_smile: If you do some configuring, that it will work great. That’s what I meant. :slight_smile:

As I said above, it was used by ISPs and the EU law was/is against that.

At least here in Germany it’s just the usual “money making”. The router I got from my ISP (Deutsche Telekom) was a branded old TP-Link router. Original price on eBay (new) was around 40.-€ or 50.-€. Taken the one from the ISP it is 4,95€ a month, for the whole time… Sure it will be changed, if it is broken, but how long does a router work, until it breaks… You see, it’s quite a good business idea… After ten month the initial costs are paid…

Yea ! I agree,
But to be fair to Marc, the ‘audience’ to whom his opinion no longer matters is probably the crowd who voted us out.

I reckon we’ll be back in before too long as the age/opinion divide was particularly squewed. Let’s get rid of some of the bigoted old fogies (only half a joke given the circumstances)

1 Like

READ THE TEXT BEFORE YOU COMMENT!!
SIGH!!!

Isn’t that how you configure a router?
Jisus!!

Relax, Buddy! You seemed stressed out, even that it’s Sunday! :wink: That’s not good for your health, and shouting doesn’t seem to bring you any advantage. :smiley: :smiley: :smiley: Just a short note would have been enough, like so: Sorry, I overread this. :slight_smile:

Lot of stuff posted so not sure if mentioned but pretty sure you can setup new router with old router SSID and PASSWD and all devices connect. May need to set proper IP address space if currently using static IP