[Android General] ahighfield:
Car Profile

Here is my Car Profile, with a lot of help from you!

The main differences are:

- an added context to Update Time Since profile for a variable %UpdateTS value to be 1 (which is triggered in Car Mode Exit task if not at home)

- seemed to be missing a variable set for %TIMESINCE

- used an alternative approach to the update time since tasks that might be a bit easier (for car park times less than 10hrs) and MT was only displaying total minutes and the %HOURSINCE was always zero

1. Profiles:

Car BT

- Context: BT connected (CarAudio Connect)

- Task: Variable Set %CarBT to 1

- Exit: Variable Set %CarBT to 0

Home

[This is obviously used in many different profiles]

- Context: Location "Home"

- Task: Variable Set %Home to 1

- Exit: Variable Set %Home to 0

Car (Basic)

[When not connected to Car BT but phone is in car]

- Context: BT Near CarAudio Connect

- Task: Car (Basic)

- Exit: Car Mode Exit

Car (Full)

[When connected to Car BT and power plugged in]

- Context: Variable Value %CarBT ~ 1 and Power Any

- Task: Car (Full)

- Exit: Car Mode Exit

Car Park Time

[Calculates time parked]

- Context: Every 2m and Variable Value %UpdateTS ~ 1

- Task: Time Since 1

- Task: Time Since 2

Car Text

[Reads SMS aloud]

- Context: Received Text, Any and Variable Value %CarProfileActive ~ 1

- Task: Read SMS

Car Call

[Handsfree answer/reject calls]

- Context: Phone Ringing and Variable Value %CarProfileActive ~ 1

- Task: Car Call

2. Tasks

Car (Basic)

A1: Variable Set %CarProfileActive ~ 1

A2: If %CarBT ~ 1

A3: Launch App (Spotify) [don't want to launch if don't connect to BT]

A4. End If

A5: System Volume 6

A6: Secure Settings: Screen & Keyboard Lights On, Manual On, Timeout 30s

A7: Secure Settings: Keyguard Disabled

A8: Variable Set: %UpdateTS to 0

Car (Full)

A1: Variable Set %CarProfileActive to 1

[A2: Profile Status: Name Battery Saver, Set Off]

[A3: Profile Status: Name Background Email, Set Off] [These are my battery saving profiles]

A4: Launch App (Spotify)

A5: Auto Brightness On

A6: System Volume 6

A7: Secure Settings: Screen & Keyboard Lights On, Manual On, Timeout 30s

A8: Secure Settings: Keyguard Disabled

A9: Variable Set: %UpdateTS to 0

Car Mode Exit

A1: Variable Set %Hoursince to 0

A2: Variable Set %Minsince to 0

A3: If %TIME > 12.00:

A4: Minimalistic Text, Configuration ampm = PM

A5: Variable Set %Parktime to %TIME - 12.00, Do Maths

A6: Else If %TIME < 12.00:

A7: Minimalistic Text, Configuration ampm = AM

A8: Variable Set %Parktime to %TIME

A9: End If

A10: Minimalistic Text: Configuration parktime = %Parktime

A11: Variable Set %PARKTIME to %TIMES

A12: Variable Set %UpdateTS to 1, If %Home !~ 1 [No need to to count park time if I am at home]

A13: Auto Brightness Off

A14: System Volume 3

A15: Secure Settings: Keyguard Enabled

A16: Secure Settings: Screen & Keyboard Lights On, Manual Off, Timeout 30s

A17: Kill App (Spotify)

A18: Variable Set %CarProfileActive to 0

Time Since 1

A1: Variable Set %TIMESINCE to (%TIMES - %PARKTIME) / 3600, Do Maths [Gives parking time in hours]

A2: Variable Section %TIMESINCE From 1 Length 1, Store Result in %HOURSINCE [This gives the hour result for Minimalistic Text]

A3: Variable Section %TIMESINCE From 2 Length 5, Store Result in %Timesincemins

A4: Variable Set %MINSINCE to round(Timesincemins * 60), Do Maths [This gives the min result for MT rounded to nearest whole minute]

A5: Minimalistic Text Configuration minsince = %Minsince

A6: Minimalistic Text Configuration hoursince = %Hoursince

Time Since 2

A1: Wait 1 Minute

A2: Variable Set %TIMESINCE to (%TIMES - %PARKTIME) / 3600, Do Maths

A3: Variable Section %TIMESINCE From 1 Length 1, Store Result in %HOURSINCE

A4: Variable Section %TIMESINCE From 2 Length 5, Store Result in %Timesincemins

A5: Variable Set %MINSINCE to round(Timesincemins * 60), Do Maths

A6: Minimalistic Text Configuration minsince = %Minsince

A7: Minimalistic Text Configuration hoursince = %Hoursince

Read SMS

A1: Media Control Cmd Pause Simulate Media Button

A2: Say Text "%SMSRN says %SMSRB"

A3: Media Control Cmd Play

Car Call

A1: Media Control Cmd Pause Simulate Media Button

A2: Ringer Volume 4

A3: Say "Do you want to accept this call from %CNAME?"

A4: AutoVoice Recognise Cmd "yes"

A5: If %avmatched ~ true [this is AutoVoice variable]

A6: Speakerphone Set On

A7: Take Call

A8: Else If %avmatched !~ true

A9: End Call

A10: End If

A11: Media Control Cmd Play

The Text and Call tasks need some more testing, I just don't drive that much or get that many calls in my car atm...

Minimalistic Text widget set up:

Static Text: Parked at:

Locale Variable: parktime Locale Variable: ampm

Static Text: Parked for:

Locale variable: hoursince Static Text: Hrs Locale variable: minsince Static Text: Mins