Tuesday, May 13, 2014

Tasker text to speech for sms fire pager

I was using 'fire alert 2' to notify me of any for calls. Unfortunately my fire control center uses all capitals in the  SMS fire call pager messages.
Also some acronyms didn't sound good on the text to speech function.
A1 test text [therefore optional]
A2 convert text to variable
A3 STOP if there is not the word "incident" in text
A4 Split at word "testmonkey" (this would be my unit/brigade name so dont need to know this)
A5 split at - for formatting
A6 convert to lower case
A7 modification on text
A8 modification on text
A9 clean up text
A10 talk.
So created a task
FireCallSMS (2)
A1: [X] Variable Set [ Name:%fullstr To:INCIDENT - testmonkey - ASSIST FRNSW
Do Maths:Off Append:Off ]
A2: Variable Set [ Name:%fullstr To:%SMSRB Do Maths:Off Append:Off ]
A3: Stop [ With Error:Off Task: ] If [ %fullstr !~ *INCIDENT* ]
A4: Variable Split [ Name:%fullstr Splitter:testmonkey Delete Base:Off ]
A5: Variable Split [ Name:%fullstr2 Splitter:- Delete Base:Off ]
A6: Variable Convert [ Name:%fullstr2 Function:To Lower Case Store Result In: ]
A7: Variable Search Replace [ Variable:%fullstr2 Search:frnsw Ignore Case:Off Multi-Line:Off One Match Only:Off Store Matches In: Replace Matches:On Replace With:fire rescue new south wales ]
A8: Variable Search Replace [ Variable:%fullstr2 Search:m.v.a Ignore Case:Off Multi-Line:Off One Match Only:Off Store Matches In: Replace Matches:On Replace With:motor vehicle accident ]
A9: Variable Split [ Name:%fullstr2 Splitter:* Delete Base:Off ]
A10: Say [ Text:Fire Call, %fullstr21 Engine:Voice:default:default Stream:3 Pitch:5 Speed:5 Respect Audio Focus:On Network:Off Continue Task Immediately:Off ]

Then a profile
 
'Received text any' from the pager 'contact'