Fix for incorrect local file paths in timeline events preventing image display #352
Replies: 1 comment 1 reply
-
Thanks for the suggestion! |
Beta Was this translation helpful? Give feedback.
-
Thanks for the suggestion! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I've been experiencing an issue with the integration that I thought I'd share.
This is potentially a bug or feature request, so figure I'd share this as a discussion.
So for context I'm running Home Assistant Core 2025.5 (running bare metal on Asahi Linux) and I suspect the fact I'm running core is probably the key factor as to why I'm experiencing the issue. I'm currently running the latest versions of the LLM Vision Integration (1.4.3), and LLMVision timeline cards.
I have an automation setup to analyse my doorbell images on doorbell press or motion detection events.
Currently, when the
expose_images: true
option is used with thellmvision.image_analyzer
service, thekey_frame
value stored in theevents.db
for the LLM Vision Timeline contains the full local file path to the saved image (e.g./home/homeassistant2/.homeassistant/www/llmvision/your_image.jpg
).This prevents the images from being displayed correctly in the Home Assistant frontend (e.g., in the LLM Vision Timeline card) because the browser or app cannot access these local server paths directly via HTTP. The expected behavior is that the
key_frame
should contain a web-accessible URL for the image.So, for example, my web browser tries to get the images like this:

http://MYIPADDRESS:8123/home/homeassistant2/.homeassistant/www/llmvision/c776ed9a-0.jpg
and a HTTP 404 is returned.Proposed Solution:
I have been able to implement a solution by modifying the
_expose_image
function in the integrationmedia_handlers.py
file to generate and store the web-accessible /local/... path for the image instead of the full local file path.The following code change in the _expose_image function (in the
media_handlers.py
file) resolves this issue:Diff
By changing
self.key_frame = filename
toself.key_frame = f"/local/{DOMAIN}/{uid}-{frame_name}.jpg"
, the timeline events now correctly reference the image via the /local/ alias, allowing them to be displayed in the frontend for users experiencing this issue.As a result, my frontend is able to grab the images with this URL:
http://IPADDRESS:8123/local/llmvision/2efa0499-0.jpg
Can I suggest incorporating this change into the integration's code to ensure that the timeline correctly displays image snapshots for all users, especially those on setups like Home Assistant Core where the local pathing seems to be an issue?
Note: Whilst this fix works for me and will resolve the issue for setups where local paths are not correctly interpreted, I'm not 100% clear that this wouldn't negatively impact users whose image display is currently working across the different Home Assistant installation methods. Someone with experience may be able to say for sure!
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions