I have a local file camera like this:
camera 5:
- platform: local_file
file_path: /home/homeassistant/.homeassistant/www/snaps/kitchen/...
name: kitchen_snap
And I use the following card to display the camera on the UI
cards:
- type: picture-entity
entity: camera.kitchen_snap
camera_image: camera.kitchen_snap
camera_view: live
To update the picture, I have an external script running using the REST API to update the image. Here is a simplified version of the script.
#!/bin/sh
set -x
ff=$1
echo $ff
data="{\"entity_id\" : \"camera.kitchen_snap\", \"file_path\" : \"$ff\"}"
echo $data
curl -X POST -H "Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxx,etc" \
-H "Content-Type: application/json" \
-d "$data" \
http://localhost:8123/api/services/camera/local_file_update_file_path
It does not work properly. The display of the picture is lagging by one update from the script. If I update to three pics, say, “one.png”, “two.png”, and “three.png” at 5 second intervals — the first update will not do anything. The second update wil show “one.png” on the UI, and third update will show “two.png” on the UI. If I wait long enough, anywhere from 30 seconds to a few minutes, it will eventually do the right update to “three.png” . It will also show “three.png” if I force a refresh with shift-F5.
Same thing happens with picture_glance card.
Does anyone have suggestions on how to force the update? I am running HA 100.3