1mfaasj
(Bowa)
October 5, 2023, 1:39pm
1
Hi,
Can someone help with the following please. I’ve got a strange issue and can’t get the image into view.
With an automation I create a snapshot of my camera:
action:
- service: camera.snapshot
data:
filename: /media/snapshot.jpg
target:
entity_id: camera.camera1
This works because I see the image on that location:
But this code doesn’t seem to work:
type: picture
image: /media/snapshot.jpg
How my configuration looks like:
homeassistant:
media_dirs:
media: "/media"
allowlist_external_dirs:
- "/media"
Am I missing something?
minion1
(Minion)
October 5, 2023, 6:27pm
2
Try this:
image: /local/media/snapshot.jpg
1mfaasj
(Bowa)
October 5, 2023, 6:35pm
3
1mfaasj:
/media/snapshot.jpg
doesn’t work either. In the logs it says this:
looks like it’s related to onvif?
Logger: homeassistant.components.onvif
Source: components/onvif/camera.py:155
Integration: ONVIF ([documentation](https://www.home-assistant.io/integrations/onvif), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+onvif%22))
First occurred: 20:30:33 (2 occurrences)
Last logged: 20:30:39
Fetch snapshot image failed from camera, falling back to FFmpeg; Unknown error: All connection attempts failed
minion1
(Minion)
October 6, 2023, 7:17am
4
First make sure the snapshot is being generated correctly, then only can you display it in a card. If it’s not, then the problem is with the entity that is supposed to generate the snapshot.
ciddi89
(Christian)
October 6, 2023, 7:44am
5
You can try to use the www folder for the snaphot.
/config/www/tmp/my_picture.jpg
My experience is that the media folder is not working for snapshots.
1mfaasj
(Bowa)
October 6, 2023, 8:33am
6
the strange thing is, I’ve tried your code and it saves the snapshot.jpg file there:
with this code:
action:
- service: camera.snapshot
data:
filename: /config/www/tmp/snapshot.jpg
But when I try to display the image, it breaks:
code:
type: picture
image: /config/www/tmp/snapshot.jpg
ciddi89
(Christian)
October 6, 2023, 8:47am
7
Ok try these:
type: picture
image: http://yourhassip:8123/local/tmp/auffahrt_snapshot.jpg
You have to add the ip / or webadress of your home assistent.
1mfaasj
(Bowa)
October 6, 2023, 9:17am
8
it becomes even more strange. I’ve tried these two, only the second one works (so an image is displayed):
http://myip:8123/local/tmp/snapshot.jpg
/local/tmp/snapshot.jpg
but it’s an older picture, not the most recent one. I guess it has something to do with caching?!
ciddi89
(Christian)
October 6, 2023, 4:17pm
9
Hmm which photo is in the folder? The new one? Then clear the cache of the browser and you will see if this is the problem.