Variable "The currently connected wifi is:" does not update when leaving a network

Describe the bug
When disconnecting from a wifi network the variable The currently connected wifi is: in BTT does not change.

Automations that rely on the disconnection work fine. Therefore BTT seems to recognize the disconnect fine, but automations that trigger when connecting to a certain wifi network do not trigger when the previous connected wifi network was the same.

The variable The currently connected wifi is: does get updated once i connect to different network than the previous one.

Therefore one automation triggers (killing DisplayLink Manager when leaving the office wifi). However the automation to start the same programm when reentering the wifi network does not trigger if i did not connect to a different network in between.

Screenshots
Here you can see that i am not connected to a Wifi but it still says "The currently connected wifi is: C(...)

Device information:

  • Type of Mac: MacBook Air M2 13"
  • macOS version: 13.4 (22F66)
  • BetterTouchTool version: 4.157

thanks for reporting, will be fixed in the next alpha!

Thank you very much (also for this amazing tool)!

Edit: Works great. Just tested it.

I just reproduced a similar issue on version 4.272. Seems like the variable didn't get updated when my laptop connected from my iPhone hotspot to my home wi-fi. Here's the details:

  1. I was connected to my iPhone Hotspot, away from home.
  2. I closed my laptop's lid and packed it for travel.
  3. Everything with my CAG worked well up to that point.
  4. 30mins later when I opened up my laptop at home, it connected to my wi-fi.
  5. My CAG was off and BTT's variable Connected Wifi was set with my iPhone Hotspot's SSID.
  6. When I manually reconnected to that wi-fi, everything got set back correctly.
    BetterTouchToolDebug.zip (1.9 MB)

Ah, BTT doesn't update the wifi while sleeping, and possibly the Macbook can switch Wifis while in sleep mode - then BTT wouldn't notice it right now.

I'll add a refresh after sleep to get the latest state.

1 Like

This time it definitely failed.


BetterTouchToolDebug.zip (1.7 MB)

The (force) BetterTouchTool restart doesn't help.

This is now persistent even across machine reboots.

image

I am 100% sure I am connected to my local network and not to my iPhone.

v4.272.

v4.273 didn't fix it!

Update: So the only thing that helped is to turn Networking off and then back on.

that's weird, sounds like macOS didn't send notifications about the wifi state anymore.

This definitely isn't working well. Am I able to poll for wifi status when I open up my laptop, maybe?

@Andreas_Hegenberg - Is there a refresh feature for this on some version after 4.273?

Could you check with the latest alpha? I have added an extra poll after wake from sleep.

Installed. Reporting back soon.

Seems to be working with v4.277. :hugs:

Ah very nice, thanks for testing!

1 Like

Hi, first of all thanks for making BetterTouchTool, it is awesome!
I too seem to be running into similar issues where the state does not seem to update. Most of the time the connected wifi seems to stay at (null) but I have seen a few times where it does after restarting BetterTouchTool it does consistently grab the wifi name correctly, but after switching wifi or turning it on and off it goes back to (null). I am on alpha 4.299, switched to that after it did not work properly on stable and reading this thread.

Apparently on macOS Sonoma, apps need the location permission to access the wifi information. However apparently macOS doesn't prompt users for this permission and there is no way to add an app manually to the list.

If BTT is not showing on the list of location services in the macOS System Settings, try to run this apple script once:

tell application "BetterTouchTool" to get_location
1 Like

Thank you! That seems to do the trick! Weird that it does work when initially starting the application. Almost like apple forgot to block that way of accessing the wifi name.

1 Like

True, this indeed sounds like something they missed :smiley: