You have all sorts of family or couple photos on your digital picture frame. But now you have guests for dinner that you don’t want to bore with family happiness but instead only show landscape or even art images.

This calls for a change in folder where the image viewer Pi3D PictureFrame pulls your images from.

In this short article, I will show you how to do it either manually, with your Apple or Android phone, or via voice command.

Update, September 2026. This article describes Pi3D PictureFrame, which is still what a Pi 2, Pi 3 or Zero 2 W runs. On a Pi 4 or Pi 5, picframe3 has folder, tag, place and date filters built into its web interface, with a live count of how many pictures a filter selects before you apply it — so the dinner-guest problem below is now a dropdown on your phone. The same thing over MQTT is picframe/picframe/folder_filter/set with the folder name as the payload, or (all) to go back to everything; in Home Assistant it arrives by itself as a select entity for the folder, so no script is needed at all.

The manual approach

If you don’t need to change folders very often at all, you can do it by changing the directory setting in configuration.yaml.

I am assuming that you have various subfolders in your Pictures folder. (In 2020 that was /home/pi/Pictures. Raspberry Pi OS no longer creates a default “pi” user, so today it is /home/<your-user>/Pictures.)

Open the file in a text editor.

This line

  pic_dir: "~/Pictures"   # default="~/Pictures", root folder for images

is typically set to your own Pictures folder.

The other line

  subdirectory: ""   # default="", subdir of pic_dir - can be changed by MQTT"

specifies the subdirectory within that Pictures folder.

If the default value is empty, it will use all the images in the Pictures directory. However, if you add a subfolder, it will only use those.

Change it remotely with your phone

The subdirectory value can be changed remotely with an MQTT message if you have enabled MQTT in your Pi3D configuration file and have set the IP address of your MQTT broker.

Once PictureFrame receives the change of directory command, it will look for those images and reshuffle the playlist.

The MQTT channel for the command is “picframe/directory” and the payload your directory in this format “nature/“

Apple iOS devices

For iPhones, iOS Shortcuts is the way to do this. I used to recommend the PiHelper app here, but it has not been updated since 2020.

You need to create a custom command for each subfolder. The command syntax for a subdirectory “Nature” is

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

To go back to your main Pictures directory, just send a message with no payload.

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

Android devices

For Android, there is DashMQTT which even allows you to design buttons and not just command shortcuts — although that app has not been updated since 2017. On picframe3 you would just open the frame’s web interface in any Android browser.

You need to create a custom command for each subfolder. The command syntax for a subdirectory “Nature” is

app.publish("picframe/directory", "Nature/", false, O);

Voice control your image folders

The most elegant approach is, of course, talking to your picture frame (a.k.a. Alexa) to make it change directory.

In my article “A step-by-step guide on how to use a voice-controlled date filter on your digital photo frame” I have described what is needed.

You can follow the exact same steps for a change of subdirectory.

Create a new script in Home Assistant called “Change to Nature Photos”.

Under Sequence to the right click on “Edit as YAML” and paste the following text in the box.

action: mqtt.publish
data:
  payload: 'Nature'
  topic: picframe/directory

(Home Assistant renamed service: to action: in version 2024.8. If you are copying this into an older installation, service: mqtt.publish is the same thing.)

Test the script in Home Assistant to see if Pi3D PictureFrame changes the subdirectory.

When this works, add a routine in the Amazon Alexa app.

Conclusion

Changing image directories is a very useful feature to have to account for different guests, moods, or special events to celebrate. And it is very easy to set up.

As always, let me know what you think!