fuatakgun / eufy_security

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

Failed to set up #860

Closed TiltedMag830 closed 11 months ago

TiltedMag830 commented 11 months ago

Describe the bug

I set up the Eufy Security Add-on to use port 3001 since port 3000 is being used by another add on. And now the integration fails to set up.

To reproduce

Steps to reproduce the behavior:

  1. Set up Eufy Security Add-on to use port 3001
  2. See error

Additional information

Hardware Information;

This error originated from a custom integration.

Logger: homeassistant.config_entries Source: custom_components/eufy_security/eufy_security_api/api_client.py:103 Integration: Eufy Security (documentation, issues) First occurred: July 28, 2023 at 2:53:24 PM (9 occurrences) Last logged: 12:09:38 PM

Error setting up entry 127.0.0.1 for eufy_security Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 390, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/eufy_security/init.py", line 50, in async_setup_entry await coordinator.initialize() File "/config/custom_components/eufy_security/coordinator.py", line 39, in initialize await self._api.connect() File "/config/custom_components/eufy_security/eufy_security_api/api_client.py", line 73, in connect await self._set_products() File "/config/custom_components/eufy_security/eufy_security_api/api_client.py", line 103, in _set_products if result[MessageField.STATE.value][EventSourceType.driver.name][MessageField.CONNECTED.value] is False:


KeyError: 'connected'

- Logs from Eufy Security Add-on  (either from Add-ons page of Home Assistant or Docker output):
`        param_id: 0,
        device_sn: 'T8424T1023170ED2',
        param_type: 2001,
        param_value: 'true',
        create_time: 1690571161,
        update_time: 1690571161,
        status: 1
      },
      {
        param_id: 0,
        device_sn: 'T8424T1023170ED2',
        param_type: 1103,
        param_value: '7',
        create_time: 1690571056,
        update_time: 1690571056,
        status: 1
      }
    ],
    pir_total: 0,
    pir_none: 0,
    pir_missing: 0,
    week_pir_total: 0,
    week_pir_none: 0,
    month_pir_total: 0,
    month_pir_none: 0,
    charging_days: 0,
    charing_total: 0,
    charging_reserve: 0,
    charging_missing: 0,
    battery_usage_last_week: 0,
    virtual_version: '',
    relate_devices: null,
    house_id: '2d34c357ee77f0290944d49086df176e2998ae204a54'
  }
}
2023-07-29 17:01:51.023  DEBUG [FloodlightCamera.update] Normalized Properties 
{
  deviceSN: 'T8424T1023170ED2',
  properties: {
    motionDetected: false,
    personDetected: false,
    personName: '',
    name: 'Floodlight Cam',
    model: 'T8424',
    serialNumber: 'T8424T1023170ED2',
    type: 39,
    hardwareVersion: 'P1',
    softwareVersion: '2.0.8.3',
    stationSerialNumber: 'T8424T1023170ED2',
    picture: {
      data: <Buffer ff d8 ff e0 00 10 4a 46 49 46 00 01 01 00 00 01 00 01 00 00 ff fe 00 05 00 00 00 ff db 00 43 00 20 16 18 1c 18 14 20 1c 1a 1c 24 22 20 26 30 50 34 30 ... 39479 more bytes>,
      type: {
        ext: 'jpg',
        mime: 'image/jpeg'
      }
    },
    recordingClipLength: 100,
    recordingRetriggerInterval: 0,
    recordingEndClipMotionStops: true,
    snoozeTime: 0,
    snoozeStartTime: 0,
    light: false,
    lightSettingsBrightnessManual: 39,
    enabled: true,
    'hidden-pictureUrl': '/media/mmcblk0p1/Camera00/20230729113046n.jpg',
    lightSettingsEnable: true,
    lightSettingsMotionTriggered: true,
    lightSettingsMotionTriggeredTimer: 30,
    lightSettingsBrightnessMotion: 100,
    lightSettingsBrightnessSchedule: 100
  }
}
2023-07-29 17:02:54.680  DEBUG [PushClient.sendHeartbeat] Sending heartbeat... 73 
2023-07-29 17:02:54.682  DEBUG [PushClient.buildHeartbeatPingRequest] heartbeatPingRequest 
{
  last_stream_id_received: 73
}
2023-07-29 17:02:54.728  DEBUG [PushClient.handleHeartbeatAck] Heartbeat acknowledge 
{
  tag: 1,
  object: {
    lastStreamIdReceived: 69
  }
}
2023-07-29 17:04:22.398  DEBUG [ClientsController.addSocket] New client with ip: 127.0.0.1 port: 34304 
2023-07-29 17:04:22.413  INFO  [WebSocket.<anonymous>] Client disconnected with ip: 127.0.0.1 port: 34304 code: 1000 reason: Normal Closure 
2023-07-29 17:07:54.688  DEBUG [PushClient.sendHeartbeat] Sending heartbeat... 74 
2023-07-29 17:07:54.691  DEBUG [PushClient.buildHeartbeatPingRequest] heartbeatPingRequest 
{
  last_stream_id_received: 74
}
2023-07-29 17:07:54.754  DEBUG [PushClient.handleHeartbeatAck] Heartbeat acknowledge 
{
  tag: 1,
  object: {
    lastStreamIdReceived: 70
  }
}
2023-07-29 17:09:37.325  DEBUG [ClientsController.addSocket] New client with ip: 127.0.0.1 port: 59622 
2023-07-29 17:09:37.338  INFO  [WebSocket.<anonymous>] Client disconnected with ip: 127.0.0.1 port: 59622 code: 1000 reason: Normal Closure `

- Would you share your device with me in case further debugging required? (Yes/No): 

**Additional context**
![Screenshot_20230729-120329](https://github.com/fuatakgun/eufy_security/assets/112420253/e9e07f9a-0771-4610-9869-0c7bff1c427c)
![Screenshot_20230729-120412](https://github.com/fuatakgun/eufy_security/assets/112420253/81ff5c7d-2e92-4d8b-8104-31612b1acea0)
![Screenshot_20230729-120433](https://github.com/fuatakgun/eufy_security/assets/112420253/277c45d7-5525-41e1-a602-2b6469e15cec)
fuatakgun commented 11 months ago

follow the bug template and get the logs please