I know of 2 networks with the same SSID but different credentials (via a "sign in to network" webpage). I only have an account for one of them (and it happens to be somewhere with little-to-no 3G/4G so I can't just turn this network off completely). Of course, when it connects to the network I can't use, it turns off my 4G.
I've seen this answer suggesting it could be done using
tasker. I don't currently have tasker but could buy it for this. But I have a few issues with that approach:
I don't really want my GPS polling all the time for (mainly) battery life reasons.
So: Will tasker do this with network-based locations (especially as one location has poor mobile signal - the same place is inside a big building so GPS might not work)?
The answer I've linked to wasn't accepted despite seeming to answer the question pretty well, and has no upvotes. It doesn't make me confident it would work.
I'm on a non-rooted Xperia Z3 compact, bought from Amazon so it should be Sony's stock Lollipop.