fuatakgun / eufy_security

Home Assistant integration to manage Eufy Security devices as cameras, home base stations, doorbells, motion and contact sensors.
889 stars 73 forks source link

states.camera.doorbell.attributes.entity_picture not updating #955

Closed xNUTx closed 10 months ago

xNUTx commented 10 months ago

I tried to set up notifications when the doorbell is rang. As far as I know and could find I should be using

{{ states.camera.doorbell.attributes.entity_picture }}

to find the proxy url+token to retrieve the last picture the integration would have taken when the doorbell was activated (push event from eufy cloud).

The image on the dashboard is updated no problem, but the one reachable by that URI is the one which was there when HA was last restarted.

Reproduction

Steps to reproduce the behavior:

  1. Go to Developer Tools -> Templates -> enter the above attribute
  2. Copy the URI
  3. Go to browser, fill in HA address and port + the copied URI
  4. See old picture.

Expected behavior The URI points to a new camera image.

Additional information

Go to Settings -> System -> Repairs -> Click on 3 dots (...) -> System Information and get Version and Installation Type to below fields;

fuatakgun commented 10 months ago

camera entity picture is supposed to be updated when stream is started. motion/ringing etc events are updating last event image for a very long time.

xNUTx commented 10 months ago

What template variable/attribute do I need to send the doorbell.event_image as URL to my phone in the notification then?

I searched, but this was the only one which came close... /api/camera_proxy/image.event_image or something similar does not work without a token and I would love to use something easy and similar as the one I tried to use before...

fuatakgun commented 10 months ago

on the readme, there is an example of sending the image entity to mobile app notification.

https://github.com/fuatakgun/eufy_security#send-notification-with-thumbnail-from-home-assistant

xNUTx commented 10 months ago

Screenshot_20231018-204254

As you can see, this is an image in an alert made from that example. It is lagging one event behind...

fuatakgun commented 10 months ago

If you notice, the initial question is far different that what issue you are facing, Why don't we start with the issue?

If you are having this, I suggest you to add 1-2 seconds delay before firing the notification to phone. When notification event arrives to home assistant, there is also some time spent on decrypting of the image and downloading it, so there is some delay.

xNUTx commented 10 months ago

Yeah, the initial question was caused by the fact that image.(device)_event_image was showing the old pictures...

But now with the delay this works as well. I started my attempt to configure the automation using your template... I do not know what happened to the timeout... I must have removed it by accident while tinkering.

It needs a 3 second delay for my setup to work fine. It does now. Thank you bro, for your patience with me and my dumb questions as well 👍

fuatakgun commented 10 months ago

No, i just updated it after discussing it with you, the delay was not there till yesterday:-)

So, you helped us in a way.