-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
camera.deurbel_last_event doesn't have a picture #23
Comments
I can confirm |
Confirm this as well. I have no picture in this automatically created entity of last event. Shows nothing. Making it as static image in HA also shows nothing/clicking on it only reloads dashboard but no picture of anything. Doorbell sensor works fine, just the camera last event does not work. Extra info:
|
The camera last event of the eufycam 2 doesnt have image either |
This entity is created on startup via MQTT discovery, but at the moment only gets a picture when an event comes in. So it stays blank until the first event with a picture. Sometimes events do not generate a picture. You need to set this in the Eufy app, to show a picture in notifications. But even then sometimes it doesn't have one (probably because it's not uploaded or captured properly). Also I noticed that sometimes an invalid / broken picture is sent, so it does upload something, but it cannot show the picture in HA. |
I get no
I also don't get pictures when motion is detected on my EufyCam 2C. But the event is detected, which can be seen in the log. |
One hour ago, i could see the picture in my browser, i tested it again and then i didnt see a picture. Theres nothing we can do about it? Or is it possible to view the live cam when the doorbell is pressed? (even 30 sec or smth?) |
Not sure, will investigate some more when I have the time... |
Thanks Matijse for explanation. Ofcourse it is work in progress, thank you so far already 👍 (Edit from hour later: Suddenly my last event image appeared now. I walked by the doorbell again so a new last event is created, and now the broken image icon appears again. Just for feedback purposes. Updating entity seems to go OK, loading pic not yet) |
I noticed there is an option in the Eufy Security app "Content extension of notifications". You can choose whether the notification has a thumbnail or text only. I have mine set to "Most efficient" so there is no thumbnail. Has anyone checked to see what you have selected on this option? |
Yes, mine is / was already set to 'With Thumbnail' already (middle option). |
I find a valid pic_url in the notification inside the SQLITE database. Perhaps this could be captured somehow and displayed instead? Does the plugin piggy back on notifications? That would explain why i dont get events when my system is in "home" mode where I have disabled notifications :-) |
Yes it is subscribing to the same notifications that are sent to the app |
This is a BIG issue, no? |
Hi @skank01 PS For video and still image I use https://github.com/nonsleepr/ha-eufy-security |
@golles i do know that this just started.. it wasnt meant as offence. Respect at all cost |
eufy-ha-mqtt-bridge gets its images from the same push messages that your phone gets. ha-eufy-security gets its images from the Eufy server. I've noticed that the thumbnail isn't showing up in some push messages on my phone, so this seems to be an issue with the Eufy backend rather than anything going wrong on Home Assistant. |
I've updated the script (version 0.2.3):
So I think images should work more reliably now. There still might be corrupt images where there is a URL from Eufy available, but for some reason this isn't a valid picture. I'm not sure how often this happens, so if people see this often, a solution could be that the script also tries to parse the image to see if it is corrupted and ignore it... |
ITs not possible to get the image from the eufy server and then push it? I don't see eufy this fixing anytime though Perhaps eufy doesnt even know about the bug, it is a bug in my opinion... |
Thank you @matijse. In my opinion, I wouldn't work too hard in finding workarounds for a bug at Eufy, where it sends empty or corrupted images. @skank01, I think you're misunderstanding how push messages work. Feel free to let Eufy know that the pictures coming to your phone don't always work though, since it's a bug that they should fix. |
@davida72 i do know how they work. Did you read my post? It contains: I don't see eufy this fixing anytime though Perhaps eufy doesnt even know about the bug, it is a bug in my opinion... So what i'm saying is, that perhaps they (eufy) dont even know they are having the bug |
@matijse the latest event pictures are much more reliable for me after this update |
There is a difference between the "device" picture and the "notification" picture. The device picture can always be loaded, and shows the last image that is known to Eufy, either due to an event, or because you manually watched the stream. The notification picture is sent with notifications. I only use this one, because this is the one that is most likely to be meaningful... I assume Eufy does some magic and tries to make the most interesting snapshot (for example when a person is visible). If I just take the device picture when a notification comes in, it might be an unrelated image... An option is to send the device picture when a push notification arrives that hasn't got a picture attached... |
@matijse is ha-eufy-security using the device picture then? So i prefer to always use the device picture edit: or maybe if you disagree, let us chose between those 2 options? |
Because there is no guarantee that the device picture is updated to the latest event before the script tries to download it... But it could be a good fallback for when the push notification picture is not available. Will add that to the "todo" list ;) Also getting the device picture would require first to list all devices, which you would want to do that often, as to not get blocked by Eufy... |
Problem is, that it is always showing the wrong pic, or too late the correct one How do you handle this then? |
I don't have a doorbell so I don't know how accurate it is... But from what I tested with a loaned doorbell and camera, the push images are most of the time correct (contain people). Do you receive the push messages on your phone with a picture? And is that a correct picture and is that the one that is available in Home Assistant? |
Its not accurate at all.. Yes i receive push messages on my phone ... But mostly its without a picture... (say 35% with a picture, rest without) When it has a picture, then its available in HA too |
I hope you're willing to change this, so i do get an image on doorbell press.. like i said, the iobroker and eufy security integration always has an image which is correct. I guess they are using the device picture then? Pity cause your addon is fast using mqtt, but hasnt always a picture. SO completely stuck on the eufy addons |
There are a few problems with using the device picture, so that's why I was hoping to only use the push notification picture. It seems not reliable enough, so I am interested in using the device picture as backup.... (when I find the time). I want to be careful because sometimes push notifications come in quickly after each other, sometimes they arrive twice. I don't want to do too many requests to the Eufy API as it might (temporarily) block accounts, or even worse, they might take steps to block the whole integration. |
What causes this bug?: When I listen to the MQTT messages from the topic below, I saw the following: Message 1 received on homeassistant/camera/eufy/T8210P00*******_thumbnail at 10:16 AM:
Every seems to work beside the last_event picture. I think it's a timing issue. A the moment the picture is retrieved, it is not available yet (still in transit from homebase to server?). The event thumbnail url of the image shown in the bottom of the popup of the entity does work (points to eufy servers) and would work as a last_event thumbnail imho. |
I have this problem too. The funny thing is, when i reboot HA, it shows a picture until an event is triggered again. |
Hmm interesting... Never seen this happen, but it makes sense that if an image is still uploading / processing, it might break things. I think a good option would be to validate that a picture is a valid image before sending it to Home Assistant, and maybe even retrying after a short time if it failed... I'll add that to the todo list, but I first want to finish switching to the new library with more functionality... |
How's that going with the new library? It seems though that (again) eufy has no meaning in going down that road :( |
I just tried something which hopefully makes the images more reliable. When a push notification is received, it now first waits 100 milliseconds before trying to download the picture, to give Eufy some time to process the image on their end. I don't want to make this delay too long, to get the image as soon as possible if it works. But also after it downloads the image for the first time, it will now check to see if it is a valid image. If it isn't, it waits an additional second and tries to download the image again. For now it will always use the outcome of the second download, but if it still gives invalid images, we might change that to ignore them. This is not really tested, so I am curious what your results are. I only tested it with the images that are downloaded when the integration loads, and they are valid. I wasn't able to trigger a push notification as I test everything with camera's from friends... |
That sounds like a very smart piece of functionality. In order to test this in a useful way, let me ask what you expect the result to be? Less broken images in HA? |
Yes, and if you enable debug log (or look in |
Installed the latest version 1.17 add-on. debug: Uploading new thumbnail for T8210P00nnnnnnn from https://security-app-eu.eufylife.com/v1/s/g/xxxxxxxxxx{"timestamp":"2021-04-22T15:58:03.820Z"} Did something crash according my log? This must be cause by the re-init of EUFY..... After a bit more testing the log shows: But it's not showing the latest thumbnail but one from the previous event. Some more testing reveals: debug: Got notification - Device: T8210P00nnnnnnnn Type: 3102 {"timestamp":"2021-04-22T16:14:07.161Z"} Two pictures are being uploaded the first one is shown (old one), the yyyyyyy is the correct one and not shown. I get a MQTT message homeassistant/eufy/available. Offline and then an Online |
Hmm might be the same as #65 ... Are there any messages in Do you use the Add-on or Docker image directly? I'll create a new release now, so try that after it is build... |
I use the add-on. Found the following in the logs: 021-04-22 19:13:45 INFO (MainThread) [homeassistant.components.automation.turn_on_keukenbel_when_a_person_is_detected] Turn on keukenbel when a person is detected: Executing step call service seem like the image itself is the payload of the mqtt message ..... |
Yes that is true (that is how Home Assistant needs to receive images). My assumption was that invalid image data was sent, so I was trying to validate the image data before actually sending it. Based on the logs in #65 it looks like at least in some conditions that crashes the script/addon. Hopefully the fix I just did fixes that, but for the Addon you need to wait until the new version of the Addon is published |
The image is probably invalid. You can do some addition checks. |
I did some more digging and discovered that the library I used only checked the first part of the image to see if the proper headers are present (like FF D8 for JPEG you mention). This means that when the last part of the image is missing, the library wouldn't catch that. I found a different library (https://github.com/lovell/sharp) that is meant to do processing on whole images, which I now use to force a check on the whole image by outputting the image to a file. In my tests it complains on incomplete images, so I hope this will be a much better way to see if images are valid. This is version 0.2.18, which unfortunately fails to build because it has some dependencies on arm systems... I cannot solve this right now, so this takes a bit more time... |
Using latest build, i tried pushing the doorbell 2 times Guess its not solved ! |
0.2.18 seems to work in my case. First attempt to upload the image was invalid. Retry after 1 second => success.
|
Tested again, got a message on my phone with the picture, in HA, i got nothing, not even after 10 min |
What do the logfiles say? |
on 2.18 I still see errors in the HA logs without images on most occurances. `Logger: homeassistant.components.mqtt Can't decode payload b'\xff\xd8\xff\xdb\x00\x84\x00\x10\x0b\x0c\x0e\x0c\n\x10\x0e\r\x0e\x12\x11\x10\x13\x18(\x1a\x18\x16\x16\x181#%\x1d(:3=<9387@H\N@DWE78PmQW_bghg>Mqypdx\egc\x01\x11\x12\x12\x18\x15\x18/\x1a\x1a/cB8Bcccccccccccccccccccccccccccccccccccccccccccccccccc\xff\xc4\x01\xa2\x00\x00\x01\x05\x01\x01\x01\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x01\x00\x03\x01\x01\x01\x01\x01\x01\x01\x01\x01\x00\x00\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x10\x00\x02\x01\x03\x03\x02\x04\x03\x05\x05\x04\x04\x00\x00\x01}\x01\x02\x03\x00\x04\x11\x05\x12!1A\x06\x13Qa\x07"q\x142\x81\x91\xa1\x08#B\xb1\xc1\x15R\xd1\xf0$3br\x82\t\n\x16\x17\x18\x19\x1a%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz\x83\x84\x85\x86\x87\x88\x89\x8a\x92\x93\x94\x95\x96\x97\x98\x99\x9a\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\x11\x00\x02\x01\x02\x04\x04\x03\x04\x07\x05\x04\x04\x00\x01\x02w\x00\x01\x02\x03\x11\x04\x05!1\x06\x12AQ\x07aq\x13"2\x81\x08\x14B\x91\xa1\xb1\xc1\t#3R\xf0\x15br\xd1\n\x16$4\xe1%\xf1\x17\x18\x19\x1a&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x92\x93\x94\x95\x96\x97\x98\x99\x9a\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xff\xc0\x00\x11\x08\x01\xe0\x02\x80\x03\x01"\x00\x02\x11\x01\x03\x11\x01\xff\xda\x00\x0c\x03\x01\x00\x02\x11\x03\x11\x00?\x00\xc1\xdfF\xfa\x8b4\x03@\x13n\xa6\x13\xcd6\x94P\x03\x85(\x14\xd1\xc58z\xd0\x04\x88\xef\x19\x0c\xacA\xfa\xd5\xe85\x13\xf7e\x19\xf7\x02\xb3\x87Z\s@\x1b\xa9"H\xb9F\x04{S\xab\r\x1d\x91\x83) \xfa\xd5\xe8o\xfbJ?\xe0B\x80/RR+\xab\xa8e9\x06\x96\x80\x12\x90\xd2\xd1@\x008\x18 |
I'm new to the Eufy doorbell. Having the same issue, my thumbnail is not updating in HA. Are there any fixes? |
This has actually been working now with the newer versions and after deleting, factory resetting, and readding my doorbell from the eufy app. |
I've installed the doorbell yesterday, a new one. Configured this mqtt bridge yesterday with the newest version of the software. |
Did you enable notifications in the app? They need to be enabled in the app to see the notifications in the eufy HA. |
Yea, middle option. Full message with thumbnail. I have a thumbnail from the camera in HA but its from yesterday. If I walk nearby and the motion is triggerd I don't get a new image until I reboot the docker container. |
Just trying to help. Another thing I had to do was to have eufy docker use a completely different logon than the app. So I configured the bell with my primary account, shared it to a new email/login, logged in with that second account with the app, configured that account to get notifications and everything, logged out of that account, and plugged that account into HA. Then I relogged into the app with my primary account. Its really been working well for a while now. I believe the last account to logon gets the notification essentially it is logging out your HA docker. When you reboot, you get it to logon again and get a notification but then it gets logged out again pretty quickly probably because of app polling. |
Thanks for the help! I forgot my second account which is logged in on the docker. Logged in on second account, enable tumbnail its working now :). |
I noticed that most of the time the camera entity has no valid picture
If I open the entity_picture url in the browser I get
500: Internal Server Error
error and exceptions log files are empty, combined log only has successful entries.
Mqtt explorer is showing an entry for the camera, but it doesn't contain an image.
The text was updated successfully, but these errors were encountered: