Vista previa
OpenPilot 🔗 Siri Shortcuts 🔗
OpenPilot is self-driving car software that's compatible with 250+ cars. You can make your existing car self-driving for around $1500. See comma.ai for more info.
This is a set of iOS (and macOS) Shortcuts that let you quickly set the OpenPilot navigation 🔗 destination from your iPhone, hands-free or not.
Report issues here using feedback, or on my GitHub
- Users with Comma Prime subscriptions: The Comma Connect API can be used to easily set the navigation destination on your Comma device
- Users without Comma Prime subscriptions: these shortcuts can still be used by making the API calls directly to your Comma device's IP address using
- An external data hotspot that supports local networking, or
- The Comma device's own hotspot, where you have your own sim card for data
- The OpenPilot code must be changed to enable this:
- This commit on GitHub 🔗 for the changes necessary to use navigation without a Comma Prime subscription, and
- This commit 🔗 for the followup changes to enable use of these shortcuts
Here are Siri Shortcuts that provide the following functions for iPhone, iPad, and Mac users.
- Navigate with OpenPilot: Set OpenPilot navigation destination from a specified location/pin in Apple Maps, Google Maps, or Waze using the share sheet 🔗
- OpenPilot Search: Search for and select destinations
- by saying "(Hey) Siri, OpenPilot search" or
- by tapping the shortcut/widget/home screen icon followed by your destination (after the prompt)
- Go to work — Go home
- by saying "(Hey) Siri, OpenPilot go to work" or
- by saying "(Hey) Siri, OpenPilot go home", or
- by tapping the shortcut/widget/home screen icon
- Go to favorite by saying "(Hey) Siri, OpenPilot go to favorite", then selecting a favorite from the list by voice or by tapping
- Go to recent by saying "(Hey) Siri, OpenPilot go to recent", then selecting one of the recent locations in the list
- Go to next event by saying "(Hey) Siri, OpenPilot go to next event", then perhaps selecting one of the recent locations in the list
Installation
-
Acquire a JWT authentication 🔗 token at jwt.comma.ai 🔗, where you'll login using the same method you use at Comma Connect
-
Go to Comma Connect 🔗 or UserAdmin 🔗 to get your Comma device dongle id (16 hex characters)
-
Download and install the OpenPilot Siri Shortcuts by tapping the following links on your iPhone, iPad, or Mac
- Complete the setup process for each shortcut (except search which has none). The data you'll provide is described after each install link
- On first run, you'll be prompted to give permission for the shortcuts to do things
- Navigate with OpenPilot
JWT tokendongle idset multi-device behaviorset default map appset number of recent locations to show - OpenPilot search 🔗
- OpenPilot go home 🔗
set home address - OpenPilot go to work 🔗
set work address - OpenPilot go to favorite 🔗
set one or more favorite places - OpenPilot go to recent 🔗
- OpenPilot go to next event🔗
-
Run all shortcuts immediately to acquire permissions and enable hands-free use on subsequent runs
-
If Siri will not recognize the word "OpenPilot" when you speak, you can "teach" it the word by adding a new contact called OpenPilot, and by specifying a phonetic name for it
Navigate with OpenPilot
- This is the main shortcut that actually performs the API call 🔗. This shortcut works in two ways, via the "Share Sheet" 🔗 and by being called by other shortcuts, providing a valid location as input.
- To use with Apple Maps (see images):
- Tap the share button for a selected location/pin in Apple Maps
- Select "Navigate with OpenPilot" from the list of share actions
- If you don't see it in the list, or want it to appear higher for easier access, scroll down and select "edit actions"
- Tap the plus sign next to "Navigate with OpenPilot"
- Arrange the favorite actions to your liking
- That's it! You should see a notification indicating that navigation has been set on your Comma device, and directions will open automatically in Apple Maps
- Google Maps: The process is identical, and directions will open in Google Maps
- Waze: The process is similar
- Select a location, tap "Send", then "more options" to open the share sheet, then select "Navigate with OpenPilot"
- Finish starting directions in Waze
- This shortcut takes text (for Waze), URLs (for Google Maps), and MapLinks (for Apple Maps) as input from the share sheet.
- You can also run it from other shortcuts, such as in the other shortcuts provided here. This makes it very easy to extend the functionality.
- If you do anything cool, be sure to let me know so it can be added here!
- Voice search for locations, places or addresses, and choose from a visual + voice menu of results. Pick one and OpenPilot + iPhone navigation will start
- Four ways to use:
- Say "(Hey) Siri, OpenPilot search" , or
- (becuase "OpenPilot search" is the name of the Shortcut, and every shortcut is callable by name automatically)
- Save the shortcut to a home/lock screen widget 🔗, or
- Save the shortcut as a home screen icon 🔗, or
- Tap the Shortcut in the Shortcuts app.
- Say "(Hey) Siri, OpenPilot search" , or
- Wait for the prompt "what text?"
- ("what text?" was not my idea; you can't change the prompt; smh)
- Say the (mostly) complete address or location name without any long pauses
- You'll be presented with a list of results, and Siri will begin to read them. You can respond verbally or tap one of the results (even with CarPlay 🚗). Select one of the results or tap/say cancel to cancel.
- The default map app you specified during setup will open with directions to the destination, and you'll see a notification that navigation was set on your Comma device.
## Go home
- This simple shortcut lets you save one address
- When run, it passes this location to the Navigate with OpenPilot Shortcut
- Does not need to match the "home" address saved on Comma Connect
## Go to work
- Same Shortcut (as "Go home"), Different Destination
- You see how these could be replicated to add more
- Does not need to match the "work" address saved on Comma Connect
- Similar to home/work, but this one lets you specify multiple place names and locations
- When run, you can select one of the favorites from the list, verbally or by tapping (even in CarPlay 🚗)
- There is no set format to use for the specified locations
- The specified locations are used to search, and the top result is used. They need to be complete enough that the desired place will be the top result
## Go to recent
- Similar to Go to favorites, but you'll choose from a list of recent locations
- This shortcut just calls Navigate with OpenPilot without providing a location, causing it to run in recent location mode
- Inspired by BitNotFound#5466 on Discord
- This shortcut fetches your next calendar event that has a location specified, and sets OpenPilot and phone navigation to its location
Novedades
First release
Qué hace
161 acciones-
Set VariableInput address
-
CommentNavigate with OpenPilot By Tim Wilson, November 2023 https://github.com/twilsonco/OpenPilotSiriShortcuts
-
CommentSet JWT token for authenticating on comma’s server. Leave blank if using direct device access. See https://api.comma.ai/#authentication
-
Text
-
CommentAdd one or more Comma device names (you pick) and dongle IDs. If more than one device is specified, you can set a default or have it ask every time. Get dongle id from comma connect https://connect.comma.ai or useradmin https://useradmin.comma.ai. L…
-
Dictionary
-
Get Dictionary Value
-
Get Item from List
-
Set Variabledevice name
-
Text
-
Set Variablemap app name
-
Count
-
If
-
Text
-
If
-
Choose from List
-
Set Variabledevice name
-
Get Dictionary Value
-
CommentEnter the URL to use when making API calls. For Comma Prime users, leave the default. For direct device access, enter the device IP address with port 8082, e.g. 192.168.43.1:8082
-
URLhttps://api.commadotai.com/v1/navigation
-
CommentCheck for shortcut updates
-
Nothing
-
Comment【Auto-Update Routine】 Checks For Latest Shortcut Version ↳ https://routinehub.co/shortcut/16590/
-
Dictionary
-
Get Dictionary Value
-
If
-
Get IP Address
-
If
-
Get Contents of URLhttps://routinehub.co/api/v1/shortcuts/…/versions/latest
-
If
-
Split Text
-
Repeat with Each
-
Calculate Expression
-
Set VariableLatest Version
-
Split Text
-
Repeat with Each
-
Calculate Expression
-
Set VariableCurrent Version
-
If
-
Choose from MenuNew Version: … Release: … Whats New: "…"
-
Choose from MenuUpdate → Result (Version)
-
Expand URL
-
Replace Text
-
Open URLs
-
Stop This Shortcut
-
Choose from MenuSkip (Info (Version))
-
Comment【Auto-Update Routine Ends Here】 Support → https://www.reddit.com/r/shortcuts/comments/18j4f9p/ 【⚙️】 Convert Semantic Number to Decimals ↳ https://routinehub.co/shortcut/16589/
-
Nothing
-
CommentIf no input provided, fetch recent locations and let user pick one
-
If
-
Number
-
Get Contents of URL…/…/locations
-
Dictionary
-
Set VariableRecent locations dictionary
-
Number
-
Set Variablerecent count
-
Repeat with Each
-
Match Text
-
If
-
If
-
Text
-
If
-
Text
-
If
-
If
-
Calculate
-
Set Variablerecent count
-
Set Dictionary Value
-
Set VariableRecent locations dictionary
-
If
-
Text
-
Stop and Output
-
Choose from List
-
Text
-
Location
-
Set VariableInput address
-
CommentFor non-location input, from Apple/Google/Waze, parse the location
-
Get Type
-
If
-
CommentExtract address if shared from Waze
-
Match Text
-
If
-
Get URLs from Input
-
Expand URL
-
URL Encode
-
Match Text
-
If
-
Get Group from Matched Text
-
URLhttps://maps.apple.com/?q=…&ll=…
-
Location
-
Set VariableInput address
-
If
-
Get Addresses from Input
-
Set VariableInput address
-
Text
-
Set Variablemap app name
-
If
-
CommentExtract address if shared from google maps (url)
-
Match Text
-
If
-
Get Group from Matched Text
-
URL
-
Expand URL
-
URL Encode
-
Match Text
-
If
-
Get Group from Matched Text
-
Replace Text
-
Get Addresses from Input
-
Set VariableInput address
-
Text
-
Set Variablemap app name
-
If
-
Match Text
-
If
-
Get Group from Matched Text
-
Get Addresses from Input
-
Set VariableInput address
-
Text
-
Set Variablemap app name
-
If
-
Match Text
-
If
-
Get Group from Matched Text
-
URLhttps://maps.apple.com/?q=…&ll=…
-
Location
-
Set VariableInput address
-
If
-
Location
-
Set VariableInput address
-
Location
-
Set VariableInput address
-
Location
-
Get Details of Locations
-
Get Details of Locations
-
Get Details of Locations
-
Get Details of Locations
-
Get Details of Locations
-
Get Details of Locations
-
Get Details of Locations
-
Get Details of Locations
-
Text
-
Commenthttps://api.comma.ai/#navigation
-
Get Contents of URL…/…/set_destination
-
Get Type
-
If
-
If
-
List
-
Change Case
-
If
-
Show Directions
-
If
-
Text
-
Show Result
-
Show Notification… nav set to: …
-
Stop This Shortcut
-
If
-
If
-
Show Notification…
-
Stop This Shortcut
-
Show Notification…
Ver como código
Todas las acciones de este atajo escritas en Cherri, un lenguaje de programación para Atajos. Ideal para aprender cómo funciona.
#include 'actions/web'
#include 'actions/network'
#define color darkblue
#define glyph map
@InputAddress = ShortcutInput
/*
Navigate with OpenPilot
By Tim Wilson, November 2023
https://github.com/twilsonco/OpenPilotSiriShortcuts
*/
// Set JWT token for authenticating on comma’s server. Leave blank if using direct device access. See https://api.comma.ai/#authentication
const JWTToken = ""
/*
Add one or more Comma device names (you pick) and dongle IDs. If more than one device is specified, you can set a default or have it ask every time.
Get dongle id from comma connect https://connect.comma.ai or useradmin https://useradmin.comma.ai.
Leave blank for direct access
*/
const DongleIdDict = {
"C3": "0000000000000000"
}
const DeviceNameList = getValue(DongleIdDict, "")
@DeviceName = getFirstItem(DeviceNameList)
@MapAppName = "Maps"
const Count = count(@DeviceName)
if Count > 1 {
const AskUser = "yes"
if AskUser == "yes" {
chooseFromList(DeviceNameList)
@DeviceName
}
}
const DongleId = DongleIdDict[@DeviceName]
// Enter the URL to use when making API calls. For Comma Prime users, leave the default. For direct device access, enter the device IP address with port 8082, e.g. 192.168.43.1:8082
const APIUrl = url("https://api.commadotai.com/v1/navigation")
// Check for shortcut updates
nothing()
/*
【Auto-Update Routine】
Checks For Latest Shortcut Version
↳ https://routinehub.co/shortcut/16590/
*/
const Info = {
"Author": "twilsonco",
"RoutineHub ID": 17677,
"Version": "1.0.1",
"Version Check": true
}
const True = getValue(Info, "Version Check")
if True == "Yes" {
const CurrentIPAddress = getExternalIP("IPv4")
if CurrentIPAddress {
const Result = downloadURL("https://routinehub.co/api/v1/shortcuts/{Info['RoutineHub ID']}/versions/latest")
if Result contains "success" {
const SplitText = splitText(Result['Version'], ".")
for _ in SplitText {
@LatestVersion = ((1/1000)^@RepeatIndex)*@RepeatItem+@LatestVersion
}
const SplitText1 = splitText(Info['Version'], ".")
for _ in SplitText1 {
@CurrentVersion = ((1/1000)^@RepeatIndex)*@RepeatItem+@CurrentVersion
}
if @LatestVersion > @CurrentVersion {
menu "New Version: {Result['Version']}\nRelease: {Result['Release']}\nWhats New: \"{Result['Notes']}\"" {
item "Update → {Result['Version']}":
expandURL(Result['URL'])
const UpdatedText = replaceText("https://www.icloud.com/", "shortcuts://", false)
openURL(UpdatedText)
stop()
item "Skip ({Info['Version']})":
}
}
}
}
}
/*
【Auto-Update Routine Ends Here】
Support → https://www.reddit.com/r/shortcuts/comments/18j4f9p/
【⚙️】
Convert Semantic Number to Decimals
↳ https://routinehub.co/shortcut/16589/
*/
nothing()
// If no input provided, fetch recent locations and let user pick one
if !@InputAddress {
const MaxNumRecents = 10
const ContentsOfURL = jsonRequest("{APIUrl}/{DongleId}/locations", "GET", {}, {
"Authorization": "JWT {JWTToken}"
})
@RecentLocationsDictionary = {}
@RecentCount = 0
for _ in ContentsOfURL {
const Matches = containsText(@RepeatItem['save_type'], "recent")
if Matches {
if @RepeatItem {
} else {
}
if @RecentLocationsDictionary != PlaceKey {
if @RecentCount < MaxNumRecents {
@RecentCount = @RecentCount + 1
@RecentLocationsDictionary = setValue(@RecentLocationsDictionary, PlaceKey, @RepeatItem)
}
}
}
}
if @RecentCount == 0 {
mustOutput()
}
chooseFromList(@RecentLocationsDictionary)
const Text = "{['place_name']}, {['place_details']}"
location(Text)
@InputAddress
}
// For non-location input, from Apple/Google/Waze, parse the location
const Type = typeOf(@InputAddress)
if Type != "Location" {
// Extract address if shared from Waze
const Matches1 = containsText(@InputAddress, "Use Waze*")
if Matches1 {
getURLs(@InputAddress)
expandURL()
const URLEncodedText = urlEncode()
const Matches2 = containsText(URLEncodedText, ".*ll\.([^&]+)")
if Matches2 {
getMatchGroup(Matches2, 0)
const URL = url("https://maps.apple.com/?q={}&ll={}")
location(URL)
@InputAddress
} else {
getAddresses(URLEncodedText)
@InputAddress
}
@MapAppName = "Waze"
} else {
// Extract address if shared from google maps (url)
const Matches3 = containsText(@InputAddress, "(http\S+)")
if Matches3 {
const Text1 = getMatchGroup(Matches3, 0)
const URL2 = url(Text1)
expandURL(URL2)
urlEncode()
const Matches4 = containsText(, ".*goo.*q=([^&]*)")
if Matches4 {
getMatchGroup(Matches4, 0)
const UpdatedText1 = replaceText("+", " ")
getAddresses(UpdatedText1)
@InputAddress
@MapAppName = "Google Maps"
} else {
const Matches5 = containsText(, ".*apple.*address=([^&]*)")
if Matches5 {
const Text2 = getMatchGroup(Matches5, 0)
getAddresses(Text2)
@InputAddress
@MapAppName = "Maps"
} else {
const Matches6 = containsText(Text1, ".*apple.*ll=([^&]*)")
if Matches5 {
getMatchGroup(Matches6, 0)
const URL1 = url("https://maps.apple.com/?q={}&ll={}")
location(URL1)
@InputAddress
} else {
location(URL2)
@InputAddress
}
}
}
}
}
location(@InputAddress)
@InputAddress
}
const Location = location(@InputAddress)
getLocationDetail(Location, "Name")
getLocationDetail(Location, "Street")
getLocationDetail(Location, "City")
getLocationDetail(Location, "State")
getLocationDetail(Location, "ZIP Code")
getLocationDetail(Location, "Country")
getLocationDetail(Location, "Latitude")
getLocationDetail(Location, "Longitude")
const PlaceDetails = "{}, {}, {} {}, {}"
// https://api.comma.ai/#navigation
const ContentsOfURL1 = jsonRequest("{APIUrl}/{DongleId}/set_destination", "POST", {
"latitude": "{}",
"longitude": "{}",
"place_details": "{PlaceDetails}",
"place_name": "{}"
}, {
"Authorization": "JWT {JWTToken}",
"Content-Type": "application/json"
})
const Type1 = typeOf(ContentsOfURL1)
if Type1 == "Dictionary" {
if ContentsOfURL1['Keys'] contains "success" {
const AllowedMapAppNames = list("Maps", "Google Maps", "Waze")
const MapAppNameTitleCase = uppercase(@MapAppName)
if AllowedMapAppNames contains MapAppNameTitleCase {
rawAction("is.workflow.actions.getdirections", {
"WFDestination": "@InputAddress",
"WFGetDirectionsActionApp": "MapAppNameTitleCase"
})
} else {
show()
}
showNotification("{@DeviceName} nav set to: {@InputAddress}", "", false, @InputAddress)
stop()
} else {
if ContentsOfURL1['Keys'] contains "error" {
showNotification(ContentsOfURL1['error'], "Error setting destination", ContentsOfURL1)
stop()
}
}
}
showNotification(ContentsOfURL1, "Error setting destination")
Valoraciones y reseñas
Escribe una reseñaAún no hay reseñas. ¡Sé el primero en compartir tu opinión!