I recently salvaged a screen from a broken laptop that my neighbor wanted to give for recycling.
I wanted to build a Photo Frame that would display a slideshow background with personal images and also popup cards with any useful information regarding my home status.
Here’s a photo from the early stages of this project.
A sonoff basic with ESPHome, to remotely turn on and off the screen via homeassistant.
A Xiaomi Mi Box S Android TV Box which runs the Fully Kiosk Browser for the Home Assistant part, and also supports Google Play Apps such as Youtube or even Netflix.
A pair of external speakers connected to the board’s audio jack output (for Radio, YouTube etc).
An actual wooden frame that my father built to match the screen’s dimensions.
Image slideshow using a very simple python script to cycle through personal images, that I later load into HA using the local_file camera component.
Clock with the current weather icon (I am using wunderground as provider)
Camera pop-ups when movement is detected
Various alerts using the auto-entities card (for example, high energy consumption, bad air quality, weather alerts, smoke alarms etc)
A card that shows the remaining time of our cooking countdown timer.
Plus using the media_player component of browser-mod an alarm sound is played when the timer runs out.
Of course the possibilities are limitless, it all depends on your setup and needs.
Lovelace setup
I have created a dedicated Lovelace Dashboard for the Frame.
The lovelace card, is a Picture-Elements card in Panel Mode.
See an example here.
Looks nice, do you use a seperate home assistant setup for the photo-frame or same instanance with seperate love-lace dashboard?
and what tablet is used, hardware specs? I have a iPad2 with HDMI output, but think it is to old to run Hass in the browser
Hello, I only have one instance of home assistant. Among my other tabs, I have one dedicated to the photo-frame. (edit: Now there is a dedicated Lovelace dashboard).
It displays the above picture-element card in panel mode.
However, I have created a separate user specifically for the frame. Then, using the custom-header plugin I have set up this specific user to use kiosk mode with the default tab being the slideshow one. As a result, the frame always loads this specific tab without the header or the sidebar being visible. (edit: custom-header no longer exists).
As for the tablet, it is just a very cheap old Android tablet. Specwise it has just 1 gig of RAM and a 4 core CPU at 1.3 GHz. (edit: now i’ve switched to an android tv box).
However, If you’re interested in bulding something similar I would recommend using an Android TV Box instead, something like the MiBox S.
Besides the whole home assistant stuff, it will give the ability to also easily watch youtube, netflix or anything else on the frame.
So for anyone wondering, this is how I used the script from @valvex on Synology, inside Docker, after installing pyscript in HACS.
It only took me about 8 hours to figure it. This being the first time messing with python, I think that’s not too bad…
slideshow.py file placed in /config/pyscript
@service
def slideshow():
import random
import os
import shutil
path = '/Completed' #my custom folder to watch
random_image = random.choice([x for x in os.listdir(path)])
image_path = '{}/{}'.format(path,random_image)
shutil.copy2(image_path, '/config/www/slide.jpg')
What caused me most problems was the / (slash) between the path folder and the actual file to copy
This is so close to what I’m trying to accomplish. I want a rotating background as you have, but every time I try to add conditional media card it doesn’t display over the initial “slide” background pic. It just shows up as a tiny icon on the far left corner of my screen. I know it’s something simple I’m missing. Any ideas?
@valvex Awesome! I still gotta work my way around it, but I’m getting the gist, and have it showing up. Thanks! Great work on this, I’m using a tablet on a wireless charger, but love the idea of it doubling as a picture frame when not actively being used.
You are a hero! Thank you. I was having such a hard time trying to figure out how to make this work with pyscript instead of a shell command. Can’t thank you enough for the time and effort you put into this, and for sharing it with the rest of us!
Thank you for all your hard work you put into this! This has helped me tremendously! I was finally able to get my TV’s showing what I want, and not what the chromecast thinks I want!
I do have a question about this though…although I know this was made years ago, I’m trying to use this same technique to cast a dashboard to my TV. Everything works as expected, except the hui-element. This works correctly on my dashboards that are running either fully kiosk, HA app, or on the web, but when casting, the hui-element does not appear.
Any ideas on how to resolve this?
edit: got this to work by removing the custom:hui-element and changing it to just type: image. This then followed all the same rules that your custom:hui-element follows in terms of aspect ratio, style, etc. but now is just considered an image. Only thing left to figure out is how to refresh the image consistently. I’ll update if I figure it out!
edit (2): All is working properly, and updating as expected. So, anyone who is trying to get this to work on a chromecast using a raspberry pi setup (pyscript, not shell) this is the element I added to the dashboard:
I also have pyscript running in order to update the slideshow, this is using the code that @GKHerping kindly added here.
I’m also using the code that the OP provided to update the “slide.jpg” image by pulling images that I have now stored locally on my HA instance in ‘/config/www/images/slideshow’. OP Slideshow Config setup