Ask Siri about when a photo on your Raspberry Pi digital picture frame was taken 2

Ask Siri about when a photo on your Raspberry Pi digital picture frame was taken

When you have many photos on your digital picture frame, you probably sometimes look at an image and wonder “where was this taken”?

But even if you don’t have the location, knowing the date when the picture was taken typically leads to the geography.

In this article, I will show you how you can trigger the display of the date within the image viewer Pi3D either via your smartphone or with Alexa.

Shortly after I had finished writing this article, the location feature was added to this group of text overlays. Be sure to head over to How to show the place where your photo was taken with the Raspberry Pi digital picture frame geolocation feature once you finished this post.

Using MQTT commands to show the date or file name

A great feature of Pi3D is that you can remote control the script with MQTT commands which can be triggered from your phone, your Home Assistant setup or your computer.

I have written extensively about Pi3D and MQTT on this blog and if you haven’t used it yet, you may want to have a look at some of these articles.

Paddy, the author of Pi3D, has recently updated the list of MQTT commands which now includes the display of text.

You can find the full list of Pi3D’s MQTT commands in the PictureFrame2020.py script.

The new sections are:

client.subscribe("frame/text_on", qos=0) #shows the file name
client.subscribe("frame/date_on", qos=0) #shows the Exif date
client.subscribe("frame/date_text_on", qos=0) #shows both file name and Exif date
client.subscribe("frame/text_off", qos=0) # turns everything off

It’s possible to send a payload with the “text_on”, “date_on” or “date_text_on” which is interpreted as the show time in seconds. The default is 0.33 x the slide display time which will be used if you send the MQTT message with no payload.

I will show you below the examples for the display of the date but with the above commands, you will know how to show the file name as well.

Using iOS Shortcuts & Co. to make the date appear

I have explained in this article how to send MQTT commands to your picture frame from your iPhone or your Apple Watch.

If you have an Android phone, you can use DashMQTT.

As I am on the iOS platform, I will explain the command for iOS Shortcuts.

At the very basic, this command turns on the date for every image:

mosquitto_pub -h localhost -t frame/date_on -m

After about a third of your "time_delay” variable (the number of seconds each photo is displayed set in your PictureFrame2020config.py) the display will fade again. This is the default value.

You can also specify the display length in seconds by sending a payload with the MQTT command. So for about 60 seconds, you would use

mosquitto_pub -h localhost -t frame/date_on -m 60

Using this command will turn on the date display for every image. As the contrast of white fonts may not be very easy to read on bright images, Paddy added a shaded bar in the background.

Ask Siri about when a photo on your Raspberry Pi digital picture frame was taken 3

Change the date format or language

If you want to change the date format, open PictureFrame2020.config and look for this line.

parse.add_argument(      "--show_text_fm",  default="%d. %B %Y", help="format to show date over the image")

In the example above, the date would be shown as “14. October 2020” with “%d” obviously being the day, “%B” the full month and “%Y” the year in 4 digits. For a full list of date variable options, look here.

If you want to change the language of the date, you first have to make sure that your local language has been installed.

Type

sudo dpkg-reconfigure locales

to open the Raspberry Pi config menu and select your local language. Where possible, pick the “UTF-8” variant.

The second step is to change the local in the PictureFrame2020.config file. Look for this line

parse.add_argument(      "--locale",        default="de_DE.utf8", help="set the locale")

and insert your local language in “default”. The example above, will give you the date in German.

Ask Siri about when a photo on your Raspberry Pi digital picture frame was taken 4

Please note: If the date shown is not the Exif date that you expect, then your Exif data may be corrupted. You can’t see this as the file opens and shows as normal. Out of 1,000 old photos, I had it in over 300 files, most of them older. What I did was to export them from Adobe Lightroom again, and then everything was clean. You can probably do the same with the photo software that you are using. You can verify the state of your Exif date with this simple script.

Create a shortcut to only show the date for one image

If you just want to show the date for the one image that you are currently looking at, you will need to send a “frame/text_off” command. This command will turn off the display of both date and filename.

To combine the two commands, so that the data is only shown once for one image, you can trigger the display, introduce a wait time, and then trigger the off command.

In iOS Shortcuts, you would first add the command for sending the first MQTT command.

Add a delay of 10 seconds.

And as the third step, send the command to stop showing any text.

This is how it looks on my picture frame:

Ask Siri about when a photo on your Raspberry Pi digital picture frame was taken 5
Ask Siri about when a photo on your Raspberry Pi digital picture frame was taken 6
Ask Siri about when a photo on your Raspberry Pi digital picture frame was taken 7

You don’t necessarily need the payload but iOS Shortcuts was complaining about sending an MQTT message without payload, so I added “Seconds” in the first command and “off” in the second.

Ask Siri to trigger this command

Now that you have created a shortcut, you can activate with “Hey, Siri”. This will then trigger the three actions above.

Conclusion

Thanks to Paddy, for continually extending the functionality of the Pi3D image viewer!

Showing the date and/or file name on demand is a really useful feature especially if you have a large photo collection on your digital picture frame. And now it’s easy to do!

Was this post helpful?

Scroll to Top