Sudoroom Door Shortcut for iPhone: Difference between revisions

No edit summary
Tag: Manual revert
 
(6 intermediate revisions by one other user not shown)
Line 7: Line 7:
Once you’ve built the shortcut, the password is stored in it in readable form. Don’t share the shortcut file (the Share button exports the password along with it). Point people to this guide instead.
Once you’ve built the shortcut, the password is stored in it in readable form. Don’t share the shortcut file (the Share button exports the password along with it). Point people to this guide instead.


This guide walks you through building an Apple Shortcut that asks the sudoroom server to open the door. You don’t need any technical background: follow the numbered steps and you’ll be done in about five minutes. If you’re curious about what’s actually happening, the blue Under the hood boxes explain each piece. Skip them if you just want it working.
This guide walks you through building an Apple Shortcut that asks the sudoroom server to open the door. You don’t need any technical background: follow the numbered steps and you’ll be done in about five minutes. If you’re curious about what’s actually happening, the "Under the hood" section at the end explains each step.  


== How it Works: ==
== How it Works: ==
Line 34: Line 34:
=== Step 2: ===
=== Step 2: ===


Encode: convert it to Base64
Add an "Encode" action directly below the Text action. Make sure it says Encode Text with base64, then tap to expand it and set Line Breaks to None.
Add an Encode action directly below the Text action. Make sure it says Encode Text with base64, then tap to expand it and set Line Breaks to None.


[[File:2 encode base64.png|frame|left]]
[[File:2 encode base64.png|frame|left]]


=== Step 3: ===
=== Step 3: ===


Set Variable: name the result b64creds
Add a "Set Variable" action. Name the variable b64creds. It should automatically show Base64 Encoded as its value; if not, tap the value and choose the Base64 Encoded result from Step 2.
Add a Set Variable action. Name the variable b64creds. It should automatically show Base64 Encoded as its value; if not, tap the value and choose the Base64 Encoded result from Step 2.


[[File:3 set variable.png|frame|left]]
[[File:3 set variable.png|frame|left]]
Line 49: Line 46:
=== Step 4: ===
=== Step 4: ===


Get Contents of URL: send the request
Add a "Get Contents of URL" action. This is the step that actually contacts sudoroom.
Add a Get Contents of URL action. This is the step that actually contacts sudoroom.


===== Configure it like this: =====
===== Configure it like this: =====
Line 65: Line 61:
===== Common mistake: =====
===== Common mistake: =====
If you type the letters “b64creds” instead of picking the variable, the shortcut sends that literal word as your password and the door won’t open. Look for the orange bubble.
If you type the letters “b64creds” instead of picking the variable, the shortcut sends that literal word as your password and the door won’t open. Look for the orange bubble.


== Check Your Work ==
== Check Your Work ==
Line 77: Line 72:


Tap the ▶ play button to test it. If the door responds, you’re done.
Tap the ▶ play button to test it. If the door responds, you’re done.
Optional: add a Show Result action at the end. It will pop up whatever the server sends back, which is very handy when something isn’t working.
 
 
===== Optional: =====
Add a Show Result action at the end. It will pop up whatever the server sends back, which is very handy when something isn’t working.




[[File:5 full shortcut.png|frame|left]]
[[File:5 full shortcut.png|frame|left]]


== Make it one tap ==
== Make it one tap ==
Line 89: Line 86:
* Home Screen: long-press the shortcut in the Shortcuts app → Share → Add to Home Screen. (Here “Share” only adds an icon; it doesn’t send the shortcut to anyone.)
* Home Screen: long-press the shortcut in the Shortcuts app → Share → Add to Home Screen. (Here “Share” only adds an icon; it doesn’t send the shortcut to anyone.)
* Siri: say “Hey Siri,” followed by the shortcut’s name.
* Siri: say “Hey Siri,” followed by the shortcut’s name.
* Lock Screen, Control Center, or Action button: add it as a Shortcut control in your iPhone settings for those features.
* Lock Screen, Control Center, or Widget pull-down menu


== Troubleshooting: ==
== Troubleshooting: ==
Line 96: Line 93:


* the URL
* the URL
* that the credentials are entered as USERNAME:PASSWORD
* that the credentials are entered as username:password (all lowercase!)
* that Base64 uses no line breaks
* that Base64 uses no line breaks
* and that the Authorization header contains the word Basic followed by a space and the b64creds variable
* and that the Authorization header contains the word Basic followed by a space and the b64creds variable