How to use iOS Shortcuts to control your Raspberry Pi digital picture frame via iPhone, Siri, or your Apple Watch

I talked about using your iPhone to control your digital picture frame before with tools like PiHelper (for iOS) or DashMQTT (for Android).

But blog reader David C. recently showed me yet another way for iPhone users, which even works with Siri and the Apple Watch.

It uses Apple’s Shortcuts app, formerly known as Workflow, acquired by Apple in 2017. Shortcuts has now been fully integrated into iOS and the recent introduction of iOS14 now even works with widgets.

Shortcuts, at its core, is a scripting app that allows users to create macros to execute recurring tasks, like calling your wife or finding the quickest way home.

Shortcuts is very intuitive to use and incredibly powerful. Everything you repeatedly do on your iPhone can be turned into a Shortcut and made accessible as a widget or via Siri.

And it works perfectly on your Apple Watch as well.

In this article, I will show you how to use Apple Shortcuts to turn your digital picture frame display on and off. In addition, you will find further down the MQTT commands to control my favorite image viewer Pi3D, the foundation of every great digital picture frame.

Your imagination is really the only limit here. Chances are that everything you want to do with Shortcuts, you will be able to.

Tested with: Raspberry Pi OS March 2021 version, Raspberry Pi 2, 3, and 4, Pi3D 2.43, PictureFrame 2021.03.20.

Creating a shortcut

Open the Shortcuts app on your iPhone.

Tap on the Plus sign in the upper right corner. Tap on “Add Action”.

Search for “ssh” and select “Run Script Over SSH”. Tap on “Show More”.

You now enter the same login data you are using to access your Raspberry Pi picture frame from the Terminal command line.

Host: The IP address of your digital picture frame. For some strange reason, I was not able to enter the Bonjour name of my frame like “pictureframe.local”. I had to enter the IP address.

Enter Port: 22 and User and Password. Leave authentication on “Password”. Leave “Input” empty.

Now enter the script as you would do on the command line. To turn off your display you would write:

sudo vcgencmd display_power 0

To turn it on, just use

sudo vcgencmd display_power 1

with everything else staying the same.

Should you get the error message “Unknown Host”, just say “Connect”.

Now test your shortcut buttons and check if everything works fine.

By the way, you can change the color or the icon (called glyph) of your shortcut by taping on the shortcut icon in the Details view.

Adding the shortcut to the Home Screen and the Apple Watch

Tap on the button with the three dots in the upper right corner of your shortcut and again on the next screen to get to “Details”.

Tapping on “Add to Home Screen” will create a normal tile on your screens.

Activating “Show on Apple Watch” will make your shortcuts accessible on your wrist.

Turning the shortcut into a widget

iOS14 has introduced widgets, and they are great for making access to your shortcuts even easier.

Go to the widget screen by swiping left. Swipe to the bottom of the widgets and tap on “Edit”.

Tap on the Plus sign in the upper left corner. Scroll down to Shortcuts. Tap on “Turn on Frame” and repeat for “Turn off Frame”.

That’s it. You now have all frequently used commands right in the widgets section.

Using Siri for activating shortcuts with a voice command

Magically, there is nothing else to do. Just say “Hey Siri” and add the name of your command, for example, “Hey Siri, Turn on Frame”.

MQTT commands for remote controlling Pi3D PictureFrame

If you want to do more than just turning the display of your frame on and off, you can use the remote control features of the Pi3D PictureFrame image viewer.

The remote control of Pi3D works with MQTT commands, which is all explained here.

To help you program the right Shortcut buttons, please find below four command examples. All the Pi3D remote control options are summarized here.

To pause playback:

mosquitto_pub -h localhost -t homeassistant/switch/picframe_paused/set -m ON

To go to the previous image:

mosquitto_pub -h localhost -t homeassistant/switch/picframe_back/set -m ON

To change the time how long an image is being shown (example for 60 seconds):

mosquitto_pub -h localhost -t picframe/time_delay -m 60

To change the Pictures directory to “Pictures/Nature/”:

mosquitto_pub -h localhost -t picframe/directory -m "Nature"

But you can also, for example, use it to control the image viewer Pi3D to set filters for photo playback. Have a look at the Pi3D articles to find out more.

Conclusion

There are many ways to skin a cat.

In the past, I have used SimplePi and PiHelper on the iPhone as well as Alexa and Home Assistant to control our digital picture frame.

Using the new Shortcuts app is just another but very convenient way to control your frame. And using the Apple Watch will always make you feel like Dick Tracy on a mission!

Was this article helpful?


Thank you for your support and motivation.


Scroll to Top