Wifi connect /disconnect trigger unreliable

Flatmotion1

New member
Like title describes:
I have a macro with wifi connection as a trigger but it only works 50% of the time. In the log I can see that the connect /disconnect triggers aren't getting logged so they're not getting recognized, the times it does get recognized it works flawless.
I'm not sure what I can do to change this as it seems that my macro is correctly set but it's just not getting read by the app.
Thanks in advance
 

Qarboz

Well-known member
Like title describes:
I have a macro with wifi connection as a trigger but it only works 50% of the time. In the log I can see that the connect /disconnect triggers aren't getting logged so they're not getting recognized, the times it does get recognized it works flawless.
I'm not sure what I can do to change this as it seems that my macro is correctly set but it's just not getting read by the app.
Thanks in advance
Check MacroDroid's battery optimization settings
 

Flatmotion1

New member
Check MacroDroid's battery optimization settings
I did, it's all set to stay active and my phone even tells me that it's running in background all the time
 

Attachments

  • Screenshot_20231105-223835_ASUS_Launcher.jpg
    Screenshot_20231105-223835_ASUS_Launcher.jpg
    80 KB · Views: 5
  • Screenshot_20231105-224248_Settings.jpg
    Screenshot_20231105-224248_Settings.jpg
    356.2 KB · Views: 5

Flatmotion1

New member
What about "Background app management"?
I'm not sure about it but it didn't seem to affect any other macro.
I tried triggering other macros seconds before or after (connecting Bluetooth headphones triggering opening the media player) and that works at all times.
 

dhj49er

Well-known member
Can you provide a screenshot of your macro?

Have you tried turning the WiFi on and off (at the router) while the screen is on?

if so, does the macro run every time or not?
 

Flatmotion1

New member
Can you provide a screenshot of your macro?

Have you tried turning the WiFi on and off (at the router) while the screen is on?

if so, does the macro run every time or not?
Attached you'll find a screenshot.
This works also unreliable if I manually toggle wifi on and off. Most of the times the log will show the trigger being recognized and sometimes it won't.

The split in times you see here is because after a certain time I don't want it to go to full volume anymore. But even with these things deactivated it won't work reliably
 

Attachments

  • Screenshot_20231106-063643_MacroDroid.jpg
    Screenshot_20231106-063643_MacroDroid.jpg
    668.7 KB · Views: 13

Dm114

Well-known member
Attached you'll find a screenshot.
This works also unreliable if I manually toggle wifi on and off. Most of the times the log will show the trigger being recognized and sometimes it won't.

The split in times you see here is because after a certain time I don't want it to go to full volume anymore. But even with these things deactivated it won't work reliably
2 suggestions:
- in your tests, use "Trigger fired..." instead of connectivity state;
- uses only 1 IF clause with ELSE IF... instead of 3 independent IF clauses to avoid making useless (or, sometimes, inappropriate) tests if the previous one is ok.
 

Flatmotion1

New member
2 suggestions:
- in your tests, use "Trigger fired..." instead of connectivity state;
- uses only 1 IF clause with ELSE IF... instead of 3 independent IF clauses to avoid making useless (or, sometimes, inappropriate) tests if the previous one is ok.
Like this?
 

Attachments

  • Screenshot_20231106-075210_MacroDroid.jpg
    Screenshot_20231106-075210_MacroDroid.jpg
    676.5 KB · Views: 10

hsurB

Well-known member
Can I add time frames at all? All I could find for triggers are specific times and days to set, but no time frames.
By the way, thanks for your replies

@Dm114 meant constraint called trigger fired - and then you choose trigger.
This way you set different actions that are supposted to be performed when chosen trigger triggers macro like in your case.
Hard to tell if thats what causes your macro to not work properly though
 

Flatmotion1

New member
@Dm114 meant constraint called trigger fired - and then you choose trigger.
This way you set different actions that are supposted to be performed when chosen trigger triggers macro like in your case.
Hard to tell if thats what causes your macro to not work properly though
Hmm.
Unfortunately I don't quite understand the constraints part of the macros or how it's supposed to work or be tied into the triggers. Where can I look it up?
 

Flatmotion1

New member
@Dm114 meant constraint called trigger fired - and then you choose trigger.
This way you set different actions that are supposted to be performed when chosen trigger triggers macro like in your case.
Hard to tell if thats what causes your macro to not work properly though
I did also modify the macro and removed all the time triggers as well so just wifi state is the trigger, still only fires about 60% of the time only. I'm not sure what I'm doing wrong here. The log simply does not show the ones that weren't detected.
 

dhj49er

Well-known member
I did also modify the macro and removed all the time triggers as well so just wifi state is the trigger, still only fires about 60% of the time only. I'm not sure what I'm doing wrong here. The log simply does not show the ones that weren't detected.
Have you changed the if and else if statements from WiFi connected to trigger fired, as suggested by @Dm114?

Upload a screenshot of the macro with the time elements removed.
 

dhj49er

Well-known member
Are you turning WiFi on and off at the router?

Turning WiFi on and off by the status bar, I don't believe is your use case.

In my experience using the status bar to turn WiFi on and off there is a delay before WiFi is connected or disconnected. The trigger fired for the if statements eliminates the uncertainty caused by the delay.
 

Flatmotion1

New member
Here's the screenshot.
"Have you changed the if and else if statements from WiFi connected to trigger fired, as suggested by @Dm114?"
I don't understand what that means
 

Attachments

  • Screenshot_20231106-090718_MacroDroid.jpg
    Screenshot_20231106-090718_MacroDroid.jpg
    801.3 KB · Views: 11

Flatmotion1

New member
Are you turning WiFi on and off at the router?

Turning WiFi on and off by the status bar, I don't believe is your use case.

In my experience using the status bar to turn WiFi on and off there is a delay before WiFi is connected or disconnected. The trigger fired for the if statements eliminates the uncertainty caused by the delay.
Both.
Whether I turn it on and off manually or I go outside until it disconnects due to distance. It doesn't work reliably.
 
Top