Macro to switch wifi when signal is low.

dumitrudan608

New member
Hi,
I'm trying to create a macro that would switch wifi when signal is low, but for that i would need a few details:
1 can Macrodroid check the wifi strength?
2 can Macrodroid check if wifi us 5ghz vs 2.4?
3 can Macrodroid check if there is any internet activity, so it does not switch when something is running.
4 what would be the best trigger to be used in this case?
 

FrameXX

Well-known member
1 - Yes - there's a global variable (magic text) that you can use.
2 - Probably not. Maybe some way.
3 - No - you can add constraint that some downloading notification is not present or something like that.
4 - Variable changed - signal strange is smaller or bigger than your value.
 

Elenkhos

Member
Please note that to get the WiFi strength the screen must be on in most devices.
2. If you can name the 5 GHz WiFi SSID you can check against the SSID if it contains, for example, "5ghz".
3. Like FrameXX said, I don't think there is a straightforward way.
4. FrameXX: But how to update the variable? I understood that dumitrudan608 wants to check constantly the WiFi strength and if the device requires the screen to be on, it will consume a lot of battery. Even if it worked screen off it would need periodic checks for the built-in WiFi strength variable.
 
Last edited:

FrameXX

Well-known member
1 - Yes - there's a global variable (magic text) that you can use.
2 - Probably not. Maybe some way.
3 - No - you can add constraint that some downloading notification is not present or something like that.
4 - Variable changed - signal strange is smaller or bigger than your value.

As Elenkhos said you will need create your variable that you will update every (for example 30 seconds) with your signal strenght. Add constraint (only if any wifi is connected).
 

Dm114

Well-known member
Don't forget that [wifi_strength] measures the quality of the signal (strength in dBm) between the mobile and the box, not the quality of the connection to the network.
So, those two elements contribute to connection quality but MacroDroid cannot measure the second one which is the more important mainly if you are in an area with a bad network.
 

Timbo

New member
Can someone please add an example macro for this function? I have to switch my WiFi two times, if I go from the bedroom to the kitchen.
Not because it's a huge apartment, but very thick walls.

I don't find any manuals for magic text and it's capabilities.

There are lots of macros made, which are way too complicated to understand.

Where can you learn something like this?
 

Endercraft

Moderator (& bug finder :D)
There are certain functions where you need to try it yourself. The wifi signal strength is obscure in the documentation however because MacroDroid is made to be accessible to beginners as well as for experienced users some functions that wouldn't really be used by normal users MacroDroid expects you to understand.
I see that many users are trying to use wifi signal strength so I will try and make a page on the wiki.
 

Timbo

New member
What means "failed to convert value 1 to integer"?
 

Attachments

  • Screenshot_20231107-171737.png
    Screenshot_20231107-171737.png
    494.1 KB · Views: 10

Timbo

New member
Damn you're right 🤦

I added the <-80 to the constraints, to stop it from triggering every 20 seconds, if the signal is good.

Testing tomorrow...

Thanks for your help!
 

Attachments

  • Screenshot_20231107-222810.png
    Screenshot_20231107-222810.png
    166.8 KB · Views: 9
Top