Report comment

Hi Mark, from the feedback it is comparing the ssid being broadcast against the one in your wpa_supplicant file but for some reason it is not seeing a match and going to a hotspot. If it had mad a match it would say connecting to network and then checking network is up. So something about your SSID is being altered. I would expect if you tried to connect to a different router it would be fine. To test this use the feature for using a static ssid and not the wpa_supplicant file.
find this section
#Note:If you only want to check for certain SSIDs
#Remove the # in in front of ssids=('mySSID1'.... below and put a # infront of all four lines above
# separated by a space, eg ('mySSID1' 'mySSID2')
#ssids=('mySSID1' 'mySSID2' 'mySSID3')

change the last line to, based on your example.
ssids=('word word word word')
also the four lines above this section need a # in front of them to stop it checking the wpa_supplicant file.

This will just take what you have written and use that to check the broadcast ssid.

You password can be anything. All the script does is says is a vaild SSID or Mac address being broadcast if so shutdown the hotspot and activates network wifi. The Pi manages how and what it connects to the script is not involved in that.

The script doesn't default to a hotspot, the switch is based on finding a matching SSID being broadcast.

Let me know how you get on. I think the next step is to give you a script that has a lot more feedback, so you can see what it is doing and why it is not getting a match with your ssid.