launching the app when speed is reached

Lozin

New member
Good morning. Sorry for my poor English, but I'm using a translator. I have a question for you. How to make the selected application work after exceeding the speed of 20 km/h in the car?
 
Last edited:

MacroDroidDev

Administrator
Staff member
I don't recommend trying to do this. It's possible to poll the current speed value using magic text set on a variable and then check the value, but this will cause considerable battery drain.

I would suggest using the activity recognition trigger to determine when you are in a vehicle. This won't match exactly what you are asking but may be adequate and much better for the battery life.
 

Lozin

New member
I don't recommend trying to do this. It's possible to poll the current speed value using magic text set on a variable and then check the value, but this will cause considerable battery drain.

I would suggest using the activity recognition trigger to determine when you are in a vehicle. This won't match exactly what you are asking but may be adequate and much better for the battery life.
Unfortunately, the activity detection does not work The topic concerns the multimedia station in the car which is connected to a permanent power supply. Can you help me create such a macro? I've done some simple macros, but I can't handle it.
 

MacroDroidDev

Administrator
Staff member
Something like this:

T: Regular interval (5 seconds or whatever you want)
A: Set variable speed_string = {last_loc_speed_kmh}
A: Set variable speed_int = {strval=speed_string}
A: If (speed_int > 20)
DO WHATEVER YOU WANT
A: Endif

Unfortunately I just noticed that the speed magic text only appears for string variables, hence the shuffling from string to int variable above. I will fix in the next update to ensure they appear for numerical variables so they can be set directly.
 

Lozin

New member
Something like this:

T: Regular interval (5 seconds or whatever you want)
A: Set variable speed_string = {last_loc_speed_kmh}
A: Set variable speed_int = {strval=speed_string}
A: If (speed_int > 20)
DO WHATEVER YOU WANT
A: Endif

Unfortunately I just noticed that the speed magic text only appears for string variables, hence the shuffling from string to int variable above. I will fix in the next update to ensure they appear for numerical variables so they can be set directly.
it's OK?
 

Attachments

  • Screenshot_2023-01-23-14-57-55-903_com.arlosoft.macrodroid.jpg
    Screenshot_2023-01-23-14-57-55-903_com.arlosoft.macrodroid.jpg
    387 KB · Views: 26

MacroDroidDev

Administrator
Staff member
Sorry I overlooked the detail that you need to be using something which is constantly updating the devices location such as Google maps.
 

Jacob L

Moderator (Lawsonator)
I already have this app. Thank you. It seems to work now. But I don't know how to make the application run only once. And after restarting the device, the macro worked again.
I don't understand fully but there's a constraint you can add called invoked/not invoked.
 

Lozin

New member
I don't understand fully but there's a constraint you can add called invoked/not invoked.
1. The device starts up
2. The macro is running and waiting for the speed to reach 20km/h
3. After reaching 20km/h, the application starts
4. Macro completed until device restarted
 

Jacob L

Moderator (Lawsonator)
1. The device starts up
2. The macro is running and waiting for the speed to reach 20km/h
3. After reaching 20km/h, the application starts
4. Macro completed until device restarted
Trigger: boot
Action: plugin(enable the speedometer app), set variable(set the variable to the speed provided to by the speedometer app), loop while variable is less than 20 then add a wait before next action. Once the loop exits it should do the actions you wanted after the 30km. You can then disable the speedometer.
 

Lozin

New member
I did 3 macros. It seems to be working properly. I'll have to check in the car while driving.
 

Attachments

  • Screenshot_2023-01-24-08-53-17-415_com.arlosoft.macrodroid.jpg
    Screenshot_2023-01-24-08-53-17-415_com.arlosoft.macrodroid.jpg
    281.6 KB · Views: 30
  • Screenshot_2023-01-24-08-52-56-065_com.arlosoft.macrodroid.jpg
    Screenshot_2023-01-24-08-52-56-065_com.arlosoft.macrodroid.jpg
    431.5 KB · Views: 30
  • Screenshot_2023-01-24-08-51-54-560_com.arlosoft.macrodroid.jpg
    Screenshot_2023-01-24-08-51-54-560_com.arlosoft.macrodroid.jpg
    408.4 KB · Views: 30
Top