Skip to content
This repository has been archived by the owner on Dec 26, 2020. It is now read-only.

robmarkcole/HASS-Photo-browser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HASS-Photo-browser

Browse jpg photos in your Home Assistant www/images folder.

Taken from the thread https://community.home-assistant.io/t/image-file-browser-view-for-ha-front-end/41877/12

Credit Ken Depledge

Usage

Place the python script generate_index.py and the css and js folders from this repository in your Home Assistant config/www directory (create this if if doesn't exist). Place your images in a subdirectory of www called images. Your directory structure is then:

config
    www
        generate_index.py
        css folder
        js folder
    images
        contains the jpg images

An index.html file is used to serve images on the Home Assistant front end. Use a shell_command to create this file by adding to configuration.yaml:

shell_command:
  update_images: python3 /user/.homeassistant/www/generate_index.py --image_directory_path /user/.homeassistant/www/images

Manually call the shell command via the Services tool in Developer Tools. Alternatively use an automation triggered by the folder_watcher integration. In your automations.yaml:

NEEDS UPDATING

Display the images on the Home Assistant front end using an Lovelace iframe card using url: /local/index.html:

Troubleshooting

  • Problem: the images dont show in the iframe. Solution: It might take a little time before they appear on restart of HA.
  • Problem: the images haven't been updated in the iframe. Solution: In Chrome More tools - Clear browsing data - Clear cached images and data