Looking for a way to store time to get home

Doyle

New member
Hello,

I am looking for a way to store the time it will take to get home from my current location (wherever that may be) in a variable including current traffic conditions (think google maps time to destination). I want to then call that variable in an SMS so that I can scan an NFC tag and have a message sent to my wife letting her know about how long until I am home.

Thank you!
 

Snurre

Well-known member
Hey
I think you need two macro's for this (my suggestion)

Make a macro 'Button'
Trigger 'Application launched' Google maps
Action 'Enable macro' Home

This will show a floating button when opening Maps

Calculate your route in maps, click the button and the screen content will be saved in lv test (array) in the 'Home', index 34 is ETA

Then read your NFC tag and an SMS will be sent
You could also just send it directly in the actions without using NFC

The last action disables the floating button (macro)

Screenshot_20220529_114246_com.arlosoft.macrodroid.jpg
 

Doyle

New member
I think I may know what the issue is but I don't know how to fix it. The variable created by "Read Screen Contents" is a dictionary type and not an array type and thus can't be indexed the same way.
 

Doyle

New member
Update: I figured out what the key is for the time remaining in the dictionary when it reads the screen correctly. It is

com.google.android.apps.maps:id/navigation_time_remaining_label

The problem I have now is that it doesn't always read the screen correctly to my knowledge. I have the variable being logged so I can check the log to see what was written and at different times I get different entries into the log for the variable created. If I can figure out how to ensure the screen is correctly read each time I think it will work
 

Doyle

New member
Fully working now. I had to make sure that driving mode was not on. Now the message sends with mu current location and amount of time until I am home. Thank you for the help @Snurre . I really appreciate it.
 
Top