Skip to content
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

Open
golles opened this issue Jan 3, 2021 · 54 comments
Open

camera.deurbel_last_event doesn't have a picture #23

golles opened this issue Jan 3, 2021 · 54 comments

Comments

@golles
Copy link

golles commented Jan 3, 2021

I noticed that most of the time the camera entity has no valid picture

access_token: dd1b40db1446780f051d744efd2c4b7628f3110bblablabla
friendly_name: Deurbel - Last event
entity_picture: >-
  /api/camera_proxy/camera.deurbel_last_event?token=dd1b40db1446780f051d744efd2c4b7628f3110bblablabla
supported_features: 0

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.

{"name":"Deurbel - Last event","topic":"homeassistant/camera/eufy/T8210P00bla_thumbnail","unique_id":"T8210P00bla_thumbnail"}
@skank01
Copy link

skank01 commented Jan 3, 2021

I can confirm
Sometimes it doesnt have a picture.
Sometimes it doest though
Strange

@unknownbomb
Copy link

unknownbomb commented Jan 3, 2021

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:

  • Running on RPI4, 4gb
  • I have the T8210, Eufy 2K Doorbell Battery Powered
  • Logs show no issues, logging in goes fine (in combined.txt).

@skank01
Copy link

skank01 commented Jan 3, 2021

The camera last event of the eufycam 2 doesnt have image either

@matijse
Copy link
Owner

matijse commented Jan 3, 2021

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.

@r77s
Copy link

r77s commented Jan 3, 2021

I get no

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 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.​

@skank01
Copy link

skank01 commented Jan 3, 2021

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.

One hour ago, i could see the picture in my browser, i tested it again and then i didnt see a picture.
I've set option to get notification with thumbnail... so normally it should contain it, but indeed, sometimes its invalid/broken pic

Theres nothing we can do about it?
Then this entity is pretty useless no?
I noticed an url in the doorbell_pressed_entity too, but that one doesnt work either

Or is it possible to view the live cam when the doorbell is pressed? (even 30 sec or smth?)

@matijse
Copy link
Owner

matijse commented Jan 3, 2021

Not sure, will investigate some more when I have the time...

@unknownbomb
Copy link

unknownbomb commented Jan 3, 2021

Thanks Matijse for explanation. Ofcourse it is work in progress, thank you so far already 👍
I recognize what you're saying. Most of my event logs do contain pic_url's which work, sometimes no value is input there (as you already said). Might be a workaround to make some sort of loop in the current database for the latest entry > get the pic_url link and load that up to HA or something? - But that's more a workaround and you are much smarter :). Take care and thanks for now. I'll check again later, already happy that doorbell press works good now :D. Have a nice day!

(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)

@mikedrawback
Copy link
Contributor

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?

@unknownbomb
Copy link

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).

@wormiedk
Copy link

wormiedk commented Jan 4, 2021

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 :-)

@mikedrawback
Copy link
Contributor

Yes it is subscribing to the same notifications that are sent to the app

@skank01
Copy link

skank01 commented Jan 5, 2021

This is a BIG issue, no?
If we can't get an image, i find it almost worthless to have the cam and the doorbellpresses ..
Ok we can use the doorbell press to turn lights and/or speech through the house, but thats it.
No video feed, no still image..

@golles
Copy link
Author

golles commented Jan 5, 2021

This is a BIG issue, no?
If we can't get an image, i find it almost worthless to have the cam and the doorbellpresses ..
Ok we can use the doorbell press to turn lights and/or speech through the house, but thats it.
No video feed, no still image..

Hi @skank01
I don't think this is a BIG issue at this moment and I don't think you realize this project has just started 9 days ago.
I do believe @matijse and also some others are doing a great job building this and also sharing this with us. Writing a message as you did will not motivate them, so please show a bit more respect towards them and what they're building.

PS For video and still image I use https://github.com/nonsleepr/ha-eufy-security

@skank01
Copy link

skank01 commented Jan 5, 2021

@golles i do know that this just started.. it wasnt meant as offence.
I did already give respect to the start of this though

Respect at all cost

@davida72
Copy link

davida72 commented Jan 5, 2021

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.

@matijse
Copy link
Owner

matijse commented Jan 21, 2021

I've updated the script (version 0.2.3):

  • Now it loads a picture for every camera on startup
  • It better ignores empty urls

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...

@skank01
Copy link

skank01 commented Jan 21, 2021

ITs not possible to get the image from the eufy server and then push it?
Indeed, eufy security ALWAYS has an image.

I don't see eufy this fixing anytime though

Perhaps eufy doesnt even know about the bug, it is a bug in my opinion...

@davida72
Copy link

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.

@skank01
Copy link

skank01 commented Jan 22, 2021

@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

@mikedrawback
Copy link
Contributor

@matijse the latest event pictures are much more reliable for me after this update

@matijse
Copy link
Owner

matijse commented Jan 22, 2021

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...

@skank01
Copy link

skank01 commented Jan 22, 2021

@matijse is ha-eufy-security using the device picture then?
I dont get why you dont use device picture then. Since you say it shows the last image due to an event
So an event is certainly when doorbell is pressed (true also when for ex you manually watch).. but if you use to push the device picture only when the doorbell is pressed, that way you will always get the right picture, cause when you manually watch, then you dont have doorbellpress and you dont push it to other stuff... I hope you understand what i mean..

So i prefer to always use the device picture

edit: or maybe if you disagree, let us chose between those 2 options?

@matijse
Copy link
Owner

matijse commented Jan 22, 2021

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...

@skank01
Copy link

skank01 commented Jan 23, 2021

Problem is, that it is always showing the wrong pic, or too late the correct one
See , middle is the one from mqtt bridge
[img]https://i.ibb.co/tDPvd5T/pic.jpg[/img]

How do you handle this then?
To show the picture when doorbell is pressed

@matijse
Copy link
Owner

matijse commented Jan 23, 2021

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?

@skank01
Copy link

skank01 commented Jan 23, 2021

Its not accurate at all..
Mostly it just doenst have picture here...

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

@skank01
Copy link

skank01 commented Jan 28, 2021

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.
The iobroker setup always has a picture but is not using mqtt so is kinda slow using api
Then theres the eufy security integration but progress there has stopped and doenst have a lot of functions

SO completely stuck on the eufy addons

@matijse
Copy link
Owner

matijse commented Jan 28, 2021

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.

@ajvdw
Copy link

ajvdw commented Mar 21, 2021

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:

<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>thumb/2021/03/21/station/T8010P232*****/hTZtVxNF04KRcM3d.jpg.......etc.....

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.

@woutr-nl
Copy link

I have this problem too. The funny thing is, when i reboot HA, it shows a picture until an event is triggered again.

@matijse
Copy link
Owner

matijse commented Mar 29, 2021

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...

@skank01
Copy link

skank01 commented Mar 30, 2021

How's that going with the new library?
Appreciated your time and effort in this.
Hope some day we will get an image , everytime doorbell is pressed
Although.. google announced its open api to communicate with eufy too
https://androidcommunity.com/google-assistant-can-now-be-connected-to-smart-doorbells-20210312/

It seems though that (again) eufy has no meaning in going down that road :(

@matijse
Copy link
Owner

matijse commented Apr 21, 2021

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...

@davida72
Copy link

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?

@matijse
Copy link
Owner

matijse commented Apr 21, 2021

Yes, and if you enable debug log (or look in combined.log file), you should see a line for every image downloaded with Image validation result:. Most probably will have "ok":true, but if you see any logs that show an error, I am interested in the next few lines (should indicate a retry and the result of the retry)

@ajvdw
Copy link

ajvdw commented Apr 22, 2021

Installed the latest version 1.17 add-on.
It looks like something crashed, saw the following in the log:

debug: Uploading new thumbnail for T8210P00nnnnnnn from https://security-app-eu.eufylife.com/v1/s/g/xxxxxxxxxx{"timestamp":"2021-04-22T15:58:03.820Z"}
debug: Image validation result: {"ok":true,"timestamp":"2021-04-22T15:58:03.963Z"}
debug: ---- Retrieved device thumbnails {"timestamp":"2021-04-22T15:58:03.974Z"}
debug: ---- EUFY INITIALIZE DONE! ---- {"timestamp":"2021-04-22T15:58:03.978Z"}
debug: Publishing battery percentage 87% for T8210P00nnnnnnn {"timestamp":"2021-04-22T15:58:03.982Z"}
debug: Image validation result: {"ok":true,"timestamp":"2021-04-22T15:58:04.174Z"}

Did something crash according my log?
A person_detected event arrived, was published via MQTT, I know this because by doorbell rings for a tenth of a second.
Then the camera.card showed unavailable instead of the usual Idle
The event person_detected event was repeated (doorbell rang again) and the proper thumbnail is shown.

This must be cause by the re-init of EUFY.....

After a bit more testing the log shows:
debug: Image validation result: {"ok":true,"timestamp":"2021-04-22T16:14:07.349Z"}
debug: ---- Retrieved device thumbnails {"timestamp":"2021-04-22T16:14:07.359Z"}
debug: ---- EUFY INITIALIZE DONE! ---- {"timestamp":"2021-04-22T16:14:07.362Z"}
debug: Publishing battery percentage 87% for T8210P00nnnnnnnn {"timestamp":"2021-04-22T16:14:07.365Z"}
debug: Image validation result: {"ok":true,"timestamp":"2021-04-22T16:14:07.601Z"}
debug: Image validation result: {"ok":true,"timestamp":"2021-04-22T16:14:07.631Z"}

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"}
debug: Uploading new thumbnail for T8210P00nnnnnnn from https://security-app-eu.eufylife.com/v1/s/g/xxxxxxx {"timestamp":"2021-04-22T16:14:07.257Z"}
debug: Uploading new thumbnail for T8210P00nnnnnnnn from https://security-app-eu.eufylife.com/v1/s/g/yyyyyyyy {"timestamp":"2021-04-22T16:14:07.270Z"}
debug: Image validation result: {"ok":true,"timestamp":"2021-04-22T16:14:07.349Z"}
debug: ---- Retrieved device thumbnails {"timestamp":"2021-04-22T16:14:07.359Z"}
debug: ---- EUFY INITIALIZE DONE! ---- {"timestamp":"2021-04-22T16:14:07.362Z"}
debug: Publishing battery percentage 87% for T8210P00nnnnnnnn {"timestamp":"2021-04-22T16:14:07.365Z"}
debug: Image validation result: {"ok":true,"timestamp":"2021-04-22T16:14:07.601Z"}
debug: Image validation result: {"ok":true,"timestamp":"2021-04-22T16:14:07.631Z"}

Two pictures are being uploaded the first one is shown (old one), the yyyyyyy is the correct one and not shown.
Please note that they are uploaded with almost the same timestamp ....

I get a MQTT message homeassistant/eufy/available. Offline and then an Online

@matijse
Copy link
Owner

matijse commented Apr 22, 2021

Hmm might be the same as #65 ... Are there any messages in error.log or exceptions.log? I think it automatically restarts after the crashes (watch out to not get blocked).

Do you use the Add-on or Docker image directly?

I'll create a new release now, so try that after it is build...

@ajvdw
Copy link

ajvdw commented Apr 22, 2021

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
2021-04-22 19:13:45 WARNING (MainThread) [homeassistant.components.mqtt] Can't decode payload b'\xff\xd8\xff\xdb\x00C\x00 \x18\x18\x1c\x18\x14 \x1c\x1c\x1c$$ (0P40,,0dHL<Pth|xthpp\x80\x90\xb8\x9c\x80\x88\xb0\x8cpp\xa0\xdc\xa4\xb0\xc0\xc4\xd0\xd0\xd0|\x9c\xe4\xf4\xe0\xc8\xf0\xb8\xcc\xd0\xc8\xff\xdb\x00C\x01$$$0,044\xc8\x84p\x84\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xff\xc0\x00\x11\x08\x02X\x03 \x03\x01"\x00\x02\x11\x01\x03\x11\x01\xff\xc4\x00\x1f\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\xff\xc4\x00\xb5\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\xff\xc4\x00\x1f\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\xff\xc4\x00\xb5\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\xda\x00\x0c\x03\x01\x00\x02\x11\x03\x11\x00?\x00\x84t\xa7\xc6\x9b\x8eOJD\x198\x15r\x18\xc7J\x91\x8f\x812\xc0\n\x92\xe6a\n\x08\xd3\x99\x1b\x80\x05?"\x08\x8b\xb7\x1e\xc3\xa9\xa6\xd8\xdb\x96o\xb5K\xf7\x9b\xee\x8fA\xebI+\x83&\xb2\xb5\x16\xf1\xe5\xb9\x95\xbe\xf1\xfe\x95j\x8a\xc4\x14QE\x00\x14QE\x00\x14QE\x00\x14QE\x00\x14QE\x00\x14QE\x00\x14QE\x00\x14QE\x00\x14QE\x02\nJZ(\x13BRS\xa9(%\xa1))i)\x92\xc6\x91I\x8a~)1N\xe00\x8an)\xe4Rb\xaa\xe2\x19\x8aLS\xf1ILc\x08\xa2\x9ci(\x10\xdcRS\xb1IL\x06\xd2S\xa9(\x01)1N\xa4\xa0\x04\xa4\xa7RP1\xb4R\xd1@\x86\xe2\x8aZ(\x01\xb4R\xd1@\tIN\xa4\xa0bb\x8aZJ\x00J)h\xa0BRR\xd1@\tIKE\x00%\x14\xb4S\x01(\xa2\x8a\x00J)i(\x00\xa4\xa5\xa2\x80\x12\x8aZ(\x01(\xa5\xa4\xa0\x02\x92\x96\x8a\x00J)i(\x00\xa2\x8a(\x00\xa4\xa5\xc5\x18\xa6\x02QK\x8a(\x01(\xa5\xa2\x80\n(\xa2\x80\x0cQKE\x00%\x14\xb4P\x01E\x14P\x01E\x14R\x00\xa2\x96\x92\x80\nLR\xd1@\r\x82>\xe6\xae\xc6\x02)'\x80:\xd4pGD\x9b\xa6\x90[\xc7\xd4\xfd\xe3\xe8+\x97vt\x0e\x89>\xdb9f\xff\x00R\x87\xa7\xa9\xaddQ\xac1\xaa \xe0S\xea\xc4\x14QE\x00\x14QE\x00\x14QE\x00\x14QE\x00\x14QE\x00\x14QE\x00\x14QE\x00\x14QE\x00\x14QE\x00\x14QE\x00\x14QE\x00\x14QE\x02bRR\xd1A\r\tIKE2F\xd2\x1au&)\x80\xcaJ~)1L\x06b\x92\x9f\x8ai\x15@6\x93\x14\xeaJ\x00n(\xc5-\x14\xc0m%;\x14b\x80\x1bI\x8av(\xc5\x02\x1bIN\xc5%\x006\x8au&

seem like the image itself is the payload of the mqtt message .....

@matijse
Copy link
Owner

matijse commented Apr 22, 2021

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

@ajvdw
Copy link

ajvdw commented Apr 22, 2021

The image is probably invalid. You can do some addition checks.
JPEG starts with FF D8 and ends with FF D9.

@matijse
Copy link
Owner

matijse commented Apr 22, 2021

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...

@skank01
Copy link

skank01 commented Apr 23, 2021

Using latest build, i tried pushing the doorbell 2 times
-> 2 times no image

Guess its not solved !

@ajvdw
Copy link

ajvdw commented Apr 23, 2021

0.2.18 seems to work in my case. First attempt to upload the image was invalid. Retry after 1 second => success.
Maybe the 100ms wait should be configurable. I guess waiting for 300ms is better than 1100ms.....

error: Image seems to be invalid. URL: https://security-app-eu.eufylife.com/v1/s/g/xxxxxxxx- {"ok":false,"error":{},"timestamp":"2021-04-23T18:21:18.912Z"}
info: Retrying image https://security-app-eu.eufylife.com/v1/s/g/xxxxxxxxx- after waiting 1 second... {"timestamp":"2021-04-23T18:21:19.917Z"}
info: Retry - Image validation result:  {"ok":true,"timestamp":"2021-04-23T18:21:20.202Z"}

@skank01
Copy link

skank01 commented Apr 24, 2021

Tested again, got a message on my phone with the picture, in HA, i got nothing, not even after 10 min

@ajvdw
Copy link

ajvdw commented Apr 25, 2021

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?

@calisro
Copy link

calisro commented Jun 9, 2021

on 2.18 I still see errors in the HA logs without images on most occurances.

`Logger: homeassistant.components.mqtt
Source: components/mqtt/init.py:888
Integration: MQTT (documentation, issues)
First occurred: 3:00:00 PM (6 occurrences)
Last logged: 4:33:14 PM

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

[\x9a\xe9.\x93u\x84\xa3\x1f\xc3\x9a\xe6\x1920M\x00F\xe7\x18=I\xf7\xa1\xa4\x04\xe4\x0e}\xceM#'\xb9\xa0p\xb8\x03\x8e\xf4\x00\xdd\xe7=\xc5&\xe2\x0e?:v\x01=\x05\x0e\x06x \x0f\xa5\x006@U3\x83\xb4\x1e\xb4\x87\x03\xdf\xde\xad\x18\xff\x00r\xca\xdbO\xcb\xc5W\x01J\x02\x074\x00\xd0x\xe7\x14+d\xf3\xd0Q\x9f\x9b\x18\xe2\x9c@\xf4\xa0\x04\xc9#\x02\x94\xc6\xc1\xc0=\xfd\xe9B\x8c\xfb\xd3\xc7\x1c\x8a\x00r&9={S\xbd=)\x999\xa5\x04\x81\x9a\x00\x90\x10zRg\x9fja\xe0t\xa3\x8d\xbd\xe8\x01\xc5\xb8'\x18\xf7\xf4\xa4\x1fw\xdf\xd6\x98@\x18\x18\xe0s\xcd'bpy\xef' on homeassistant/camera/eufy/xxxxxxx_thumbnail with encoding utf-8 (for <Job HassJobType.Callback <function async_attach_trigger..mqtt_automation_listener at 0x7f96e60e50>>)`

@Step-han
Copy link

I'm new to the Eufy doorbell. Having the same issue, my thumbnail is not updating in HA. Are there any fixes?

@calisro
Copy link

calisro commented Oct 18, 2021

This has actually been working now with the newer versions and after deleting, factory resetting, and readding my doorbell from the eufy app.

@Step-han
Copy link

I've installed the doorbell yesterday, a new one. Configured this mqtt bridge yesterday with the newest version of the software.

@calisro
Copy link

calisro commented Oct 18, 2021

Did you enable notifications in the app? They need to be enabled in the app to see the notifications in the eufy HA.

@Step-han
Copy link

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.

@calisro
Copy link

calisro commented Oct 18, 2021

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.

@Step-han
Copy link

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 :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests