bropat / eufy-security-ws

Small server wrapper around eufy-security-client library to access it via a WebSocket.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Solar Wall Light S120 T81A0 not working in Home Assistant

spunkt123 opened this issue · comments

Version

1.8.0

Node version

v20.11.1

Operating System type

Linux

Operating system version

AlmaLinux release 9.3 (Shamrock Pampas Cat)

Describe the bug

I use eufy-security-ws with with fuatakgun/eufy_security in homeassistant with a 2K indoor cam which works fine. And i try to use it with a Solar Wall Light S120 (T81A0). Unfortunatelly it is not working correctly.
I can start the stream by clicking "Start P2P Stream" then i can see the stream for some minutes. Then the stream stops, the entity "StreamStatus" changes to "StreamStatus.IDLE". After that i cannot start the stream again by clicking "Start P2P Stream" - I have to stop the camera und start it again.

With my 2K indoor cam i activated "continuous recording" und NAS(RTSP)-Setting in eufy app. But the S120 does not have any RTSP-configuration.

Furthermore all the entities, e.g. "Motion detection", "Current Mode", "Event Image", etc. do not work. Motion detection is always "normal" even when the Eufy App is recognizing and sending a push notification

To reproduce

  1. Go to 'Device'
  2. Click on 'Start P2P Stream'
  3. Stream is running for some minutes
  4. Then the stream stops
  5. "StreamStatus" changes to "StreamStatus.IDLE"
  6. Click on 'Start P2P Stream'
  7. Stream does not start

Screenshots & Logfiles

2024-06-03 19:28:13.575 DEBUG   eufy-security-ws:eufy-security-client   [p2p] [P2PClientProtocol.handleData] Handle DATA DATA - Decrypt Error {
  error: {
    cause: undefined,
    message: 'Error: error:1C80006B:Provider routines::wrong final block length',
    context: undefined,
    stacktrace: 'Error: error:1C80006B:Provider routines::wrong final block length\n' +
      '    at Decipheriv.final (node:internal/crypto/cipher:193:29)\n' +
      '    at decryptP2PData (/usr/src/app/node_modules/eufy-security-client/build/p2p/utils.js:102:18)\n' +
      '    at P2PClientProtocol.handleData (/usr/src/app/node_modules/eufy-security-client/build/p2p/session.js:1175:71)\n' +
      '    at P2PClientProtocol.parseDataMessage (/usr/src/app/node_modules/eufy-security-client/build/p2p/session.js:1152:26)\n' +
      '    at P2PClientProtocol.handleMsg (/usr/src/app/node_modules/eufy-security-client/build/p2p/session.js:986:26)\n' +
      '    at Socket.<anonymous> (/usr/src/app/node_modules/eufy-security-client/build/p2p/session.js:118:56)\n' +
      '    at Socket.emit (node:events:518:28)\n' +
      '    at Socket.emit (node:domain:488:12)\n' +
      '    at UDP.onMessage [as onmessage] (node:dgram:941:8)'
  },
  stationSN: 'T81A0P102346231E',
  message: {
    seqNo: 8,
    channel: 0,
    commandType: 'CMD_STOP_REALTIME_MEDIA',
    signCode: 1,
    type: 1,
    dataType: 'DATA',
    data: '000000000000000000000000000000000000000000000000000000000000000000000000'
  }
}
2024-06-03 19:28:13.575 DEBUG   eufy-security-ws:eufy-security-client   [p2p] [P2PClientProtocol.handleData] Handle DATA DATA - Received data {
  stationSN: 'T81A0P102346231E',
  seqNo: 8,
  commandIdName: 'CMD_STOP_REALTIME_MEDIA',
  commandId: 1004,
  resultCodeName: 'ERROR_PPCS_SUCCESSFUL',
  resultCode: 0,
  resultData: '0000000000000000000000000000000000000000000000000000000000000000',
  data: '000000000000000000000000000000000000000000000000000000000000000000000000',
  seqNumber: 12,
  p2pDataSeqNumber: 9,
  offsetDataSeqNumber: 3
}
2024-06-03 19:28:13.576 DEBUG   eufy-security-ws:eufy-security-client   [p2p] [P2PClientProtocol.handleData] Handle DATA DATA - Result data for command received {
  stationSN: 'T81A0P102346231E',
  message: {
    sequence: 11,
    commandType: 1004,
    nestedCommandType: undefined,
    channel: 0,
    acknowledged: true,
    retries: 0,
    returnCode: 0,
    data: <Buffer d1 00 00 0b 58 5a 59 48 ec 03 10 00 00 00 01 00 00 01 00 00 0b a7 59 7c 74 98 83 d8 3b 28 4b 2e 1e f5 5f 5c>,
    customData: {
      command: {
        name: 'deviceStopLivestream'
      }
    }
  },
  resultCodeName: 'ERROR_PPCS_SUCCESSFUL',
  resultCode: 0
}
2024-06-03 19:28:13.576 DEBUG   eufy-security-ws:eufy-security-client   [http] [Station.onCommandResponse] Station got p2p command response {
  station: 'T81A0P102346231E',
  commandType: 1004,
  channel: 0,
  returnCodeName: 'ERROR_PPCS_SUCCESSFUL',
  returnCode: 0,
  customData: {
    command: {
      name: 'deviceStopLivestream'
    }
  }
}

Additional context

No response