Eufy Security Integration

by the way, do not forget that all commands are sent to homebase station and sometimes it just timeouts and does not process your requests and this is happening in hardware level. moreover, it can process your command but does not return a response to us, which is worse, because live stream might be running on base station but not visible to us.

maybe, you can place an automation to restart add on and reload integration, when there is no activity happening (no live stream etc), example;

  - type: button
    tap_action:
      action: call-service
      service: hassio.addon_restart
      service_data:
        addon: 3a26b21d_eufy_security_addon
      target: {}
    show_icon: false
    name: restart add on
    hold_action:
      action: none

If so, shouldnt we experience the same then with the app of eufy?
Cause the app of eufy is responsive here, when i click it starts , when i stop, it stops
Never had unresponsiveness there…
We are building stuff to help cause otherwise its not working…
We shouldnt be doing that :stuck_out_tongue:
No throw at you guys…
Will see if i can see if the homebase HAS timouts?

1 Like

no, that is a fair question, let me share an example below, @bropat , do you happen to know why this might happen?

@skank , if you have any other type error in eufy add-on, we can get help from @bropat . we can have retrial mechanism in eufy-security-client, maybe?

2021-10-12 14:07:23.062  WARN Station T8010NXXX - Result data for command not received 
{
  message: {
    sequence: 29,
    command_type: 1103,
    nested_command_type: undefined,
    channel: 255,
    data: <Buffer d1 00 00 1d 58 5a 59 48 4f 04 04 00 00 00 01 00 ff 00 00 00 ff 00 00 00>,
    retries: 1,
    acknowledged: true,
    return_code: -133,
    timeout: Timeout {
      _idleTimeout: 20000,
      _idlePrev: null,
      _idleNext: null,
      _idleStart: 464088,
      _onTimeout: [Function (anonymous)],
      _timerArgs: undefined,
      _repeat: null,
      _destroyed: false,
      [Symbol(refed)]: true,
      [Symbol(kHasPrimitive)]: false,
      [Symbol(asyncId)]: 4188,
      [Symbol(triggerId)]: 112
    }
  }
}

created an issue here: https://github.com/bropat/eufy-security-client/issues/51

2 Likes

Fuatakgun:

Other problems too.
Before the last updates (from past days) i had a working script, that takes a snapshot and send the picture to my google homes.
However the script isnt working anymore, so something has changed, this is the error i’m seeing now:

Deurbel gedrukt: Choose at step 1: choice 1: Error executing script. Unexpected error for call_service at pos 3: async_camera_image() missing 2 required positional arguments: ‘width’ and ‘height’
Deurbel gedrukt: Error executing script. Unexpected error for choose at pos 1: async_camera_image() missing 2 required positional arguments: ‘width’ and ‘height’
While executing automation automation.deurbel_gedrukt
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 371, in _async_step
await getattr(self, handler)()
File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 571, in _async_call_service_step
await service_task
File “/usr/src/homeassistant/homeassistant/core.py”, line 1491, in async_call
task.result()
File “/usr/src/homeassistant/homeassistant/core.py”, line 1526, in _execute_service
await handler.job.target(service_call)
File “/usr/src/homeassistant/homeassistant/helpers/entity_component.py”, line 213, in handle_service
await self.hass.helpers.service.entity_service_call(
File “/usr/src/homeassistant/homeassistant/helpers/service.py”, line 658, in entity_service_call
future.result() # pop exception if have
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 830, in async_request_call
await coro
File “/usr/src/homeassistant/homeassistant/helpers/service.py”, line 695, in _handle_entity_call
await result
File “/usr/src/homeassistant/homeassistant/components/camera/init.py”, line 752, in async_handle_snapshot_service
image = await camera.async_camera_image()
TypeError: async_camera_image() missing 2 required positional arguments: ‘width’ and ‘height’

The second thing, i’m seeing this in logs, so by this i report it too
Updating state for camera.tuin (<class custom_components.eufy_security.camera.EufySecurityCamera’>) took 0.682 seconds. Please report it to the custom component author.

  1. question is it possible to see somewhere in the eufy security addon on which version its based form bropats eufy security client. Latest from bropat is 1.1.2, whats the eufy addon based on?

Hey, it is self explanatory, you need to update your script to include additional parameters, this is a new requirement from HA, i have adopted it. Actually, this was also asked to be fixed over here: Eufy Security Integration - #185 by tharr24

On the second one, that is a known risk i took. İn the previous versions, i had separated state and live stream initialization, but always had issues with timing. Now state change is responsible for stream initialization, not an issue but a warning for us.

Regarding to eufy-security-client, you need to check eufy-security-ws version, we are on 0.3.3, to find out exact version we are all consuming.

Any idea where i need to add width and height?
In the automation i take a camera snapshot (cant find info there that i need to add this) and then i play the media…
Any idea how tharr24 fixed that?

Ok the second is only warning

About the eufy security client, we’re on 0.3.3 you say… but i theres no bropat version with that? 0.3.0 it goes to 0.4.0
I see LOADS of fixes for cameras, you have plans to go to latest 1.1.2 version?

We are not directly using client, we are using ws and ws has a dependency to client.

Our ws version is 0.3.3 and client is using 1.1.2

Regarding to updating ws, please track open issue in GitHub, i am publishing existing issues there.

About script call, you need to publish your example

Ok thx for clearing

Heres the automation thats triggering the width and height fault

- id: 'Deurbel_gedrukt'
  alias: Deurbel gedrukt
  description: 'Verwittiging iemand aan de voordeur'
  trigger:
    - entity_id: binary_sensor.deurbel_ringing_sensor
      platform: state
      to: 'True'
  action:
    - choose:
        - conditions:
            - condition: time
              after: "09:00:00"
              before: "22:00:00"
          sequence:  
            - service: script.turn_on 
              target:
                entity_id: script.google_home_say
              data:
                variables:
                  tts_message: "Er staat iemand aan de voordeur!"
                  tts_target:
                    - media_player.keuken
                    - media_player.slaapkamer_arne
                    - media_player.slaapkamer_noor
                    - media_player.slaapkamer
                    - media_player.bureau
                  tts_volume: 0.65
            - delay: "00:00:08"
            - service: camera.snapshot
              data_template:
                entity_id: camera.deurbel
                filename: "www/tmp/deurbel_snapshot.jpg"
            - delay: '00:00:01'
            - service: media_player.play_media
              data:
                entity_id: 
                  - media_player.keuken
                  - media_player.slaapkamer_arne
                  - media_player.slaapkamer_noor
                  - media_player.slaapkamer
                  - media_player.bureau
                media_content_type: "image/jpg"
                media_content_id: !secret image_url_deurbel_snapshot
            - service: rest_command.kiosk_command
              data:
                cmd: screenOn
            - service: browser_mod.popup
              data:
                large: true
                auto_close: true
                card:
                  type: custom:more-info-card
                  entity: camera.voordeur
            - delay: "00:02:00"
            - service: media_player.turn_off
              entity_id: 
                - media_player.keuken
                - media_player.slaapkamer_arne
                - media_player.slaapkamer_noor
                - media_player.slaapkamer
                - media_player.bureau
        - conditions:
            - condition: or
              conditions:
                - condition: time
                  after: "07:00:00"
                  before: "09:00:00"
                - condition: time
                  after: "22:00:00"
                  before: "23:00:00"
          sequence:  
            - service: script.turn_on 
              target:
                entity_id: script.google_home_say
              data:
                variables:
                  tts_message: "Er staat iemand aan de voordeur!"
                  tts_target:
                    - media_player.keuken
                    - media_player.slaapkamer
                  tts_volume: 0.45
            - delay: "00:00:08"
            - service: camera.snapshot
              data_template:
                entity_id: camera.deurbel
                filename: "www/tmp/deurbel_snapshot.jpg"
            - delay: '00:00:01'
            - service: media_player.play_media
              data:
                entity_id: 
                  - media_player.keuken
                  - media_player.slaapkamer
                media_content_type: "image/jpg"
                media_content_id: !secret image_url_deurbel_snapshot
            - service: rest_command.kiosk_command
              data:
                cmd: screenOn
            - service: browser_mod.popup
              data:
                large: true
                auto_close: true
                card:
                  type: custom:more-info-card
                  entity: camera.voordeur
            - delay: "00:02:00"
            - service: media_player.turn_off
              entity_id: 
                - media_player.keuken
                - media_player.slaapkamer
        - conditions:
            - condition: or
              conditions:
                - condition: time
                  after: "00:01:00"
                  before: "07:00:00"
                - condition: time
                  after: "23:00:00"
                  before: "00:00:00"
          sequence:  
            - delay: "00:00:08"
            - service: camera.snapshot
              data_template:
                entity_id: camera.deurbel
                filename: "www/tmp/deurbel_snapshot.jpg"
            - delay: '00:00:01'
            - service: media_player.play_media
              data:
                entity_id: 
                  - media_player.keuken
                  - media_player.slaapkamer
                media_content_type: "image/jpg"
                media_content_id: !secret image_url_deurbel_snapshot
            - service: rest_command.kiosk_command
              data:
                cmd: screenOn
            - service: browser_mod.popup
              data:
                large: true
                auto_close: true
                card:
                  type: custom:more-info-card
                  entity: camera.voordeur
            - delay: "00:02:00"
            - service: media_player.turn_off
              entity_id: 
                - media_player.keuken
                - media_player.slaapkamer         

And heres the generic camera i made

camera:
  - platform: generic
    name: Voordeur
    still_image_url: !secret image_url_deurbel_snapshot  

Why don’t you use image_url from camera and rather capture a new screenshot? image_url is coming from notification and it should be already existing while ringing notification arrived.

Because i sometimes had an empty image, or an old image, that was the only thing to get a correct picture
Any idea how to fix the widt and heigth?

i will take a look at when i am back to computer (couple of hours)

1 Like

Thank you for your effort !
I can see that it stopped working 3 days ago, so some chance probably made 3 days ago

Hi
Did you have any time to look?

I got the same issue… Camera snapshot stopped working with width and height error message

THANK YOU! I searched the web over trying to figure out why my motion sensors weren’t working anymore. I’d disarmed them.

A small correction:

eufy-security-ws 0.3.3 uses the eufy-security-client version 0.9.4

Yeah, you’re right, but don’t forget everything here is based on reverse engineering :wink:

1 Like

Are you seeing this getting truly stable at some point?

If i’m right, latest ws version is 0.4.2
Not sure where i can see what client version it uses, but if it’s latest, then there are a whole bunch of bug fixes since 0.3.3
But i see Fuatakgun is working on 0.4.2 which is good

To make it really stable, there has to be an open api, otherwise it’s a cat and mouse game. Eufy extends or changes the protocol and I have to reverse engineer everything again, with the possibility of misinterpretation and so on.