Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95488

Picture_entity card and local_file camera --- update is lagging by one frame

$
0
0

@khaimong wrote:

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

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 95488

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>