FYI: I have a Eufy doorbell and multiple pan/tilt cameras that work flawlessly with this integration (Thank you!!). I've been using this integration for quite a while so I have a decent understanding.
The problem is with a new Eufy S120 when attempting to livestream to my HA dashboard. I encounter this error:
Failed to call service camera/turn_on. {'type': 'result', 'success': False, 'messageId': 'device.stop_livestream.c42ea6d5c7f742d0a678cc8f883e539e', 'errorCode': 'device_livestream_not_running}`
Around 20% of the time, I can get the feed to appear without issue from this camera (it's on the list of supported devices). The rest of the time, the stream will throw an error within about 10 seconds after clicking "Start Stream." But even if I'm able to get the stream running, most of the time it will be live for about 30 seconds before suddenly stopping, and throwing the same error above. Once the error appears, the Eufy Add-On hangs, and must be manually restarted or it will chew up CPU.
To reproduce
Assume Eufy Add-On + Integration are installed and configured, with other camera streams already working.
Assuming the root cause is related this bug reproes in two ways:
First Repro
Set Eufy S120 video and recording settings to low
Copy the WebRTC dashboard card from the dev docs, replacing entity ID with camera.garage_camera and save
Press "Start Stream"
See error
Second Repro
Set Eufy S120 video and recording settings to low
Copy the WebRTC dashboard card from the dev docs, replacing entity ID with camera.garage_camera and save
Press "Start Stream"
Live stream will begin. Wait at least 60 seconds. Do not interact with the page or navigate away.
Wait for livestream to disappear, observe error
Expected behavior
A livestream of the camera feed should start within 10 seconds of pressing "Start stream"
Additional information
Go to Settings -> System -> Repairs -> Click on 3 dots (...) -> System Information and get Version and Installation Type to below fields;
Home Assistant Installation Type: OS
Home Assistant Core Version: core-2024.5.4
Eufy Security Add-on Version: 1.8.0-2
Eufy Security Integration Version: 8.0.2
Hardware Information:
Camera Model: Eufy S120
Raspberry Pi Model 4B
Live Streaming Protocol (RTSP/P2P): P2P (note: this camera specifically does not give the option for RTSP, but i still get an RTSP link in the device UI, and the stream says "RTC" when it works)
Debug Logs from Home Assistant (https://github.com/fuatakgun/eufy_security/discussions/624) - Without this, I will automatically resolve this issue
Attached, with specific error below. The logs keep getting truncated to a short output instead of showing me the whole thing at once. So I tried to capture the logs specifically when the stream fails. I can get additional samples if helpful.
2024-05-20 18:56:25.432 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:199: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:517:28)\n' +
' at Socket.emit (node:domain:489:12)\n' +
' at UDP.onMessage [as onmessage] (node:dgram:942:8)'
},
stationSN: 'T81A0P1023404CFA',
message: {
seqNo: 5,
channel: 0,
commandType: 'CMD_STOP_REALTIME_MEDIA',
signCode: 1,
type: 1,
dataType: 'DATA',
data: '000000000000000000000000000000000000000000000000000000000000000000000000'
}
}
Logs from Eufy Security Add-on (either from Add-ons page of Home Assistant or Docker output):
Attached, with specific error below. The logs keep getting truncated to a short output instead of showing me the whole thing at once. So I tried to capture the logs specifically when the stream fails. I can get additional samples if helpful.
},
p2pDid: 'USPRAMB-758202-CCCNR'
}
2024-05-20 20:55:28.753 DEBUG eufy-security-ws:eufy-security-client [p2p] [P2PClientProtocol.handleMsg] Trying to connect in QUICKEST mode... {
stationSN: 'T81A0P1023404CFA',
ip: '73.42.203.35',
port: 20097
}
2024-05-20 20:55:28.755 DEBUG eufy-security-ws:eufy-security-client [p2p] [P2PClientProtocol._connect] Connecting to host 73.42.203.35 on port 20097 (CHECK_CAM) {
stationSN: 'T81A0P1023404CFA',
address: {
host: '73.42.203.35',
port: 20097
},
p2pDid: 'USPRAMB-758202-CCCNR'
}
2024-05-20 20:55:28.759 DEBUG eufy-security-ws:eufy-security-client [p2p] [P2PClientProtocol.handleMsg] Trying to connect in QUICKEST mode... {
stationSN: 'T81A0P1023404CFA',
ip: '192.168.0.94',
port: 20097
}
2024-05-20 20:55:28.760 DEBUG eufy-security-ws:eufy-security-client [p2p] [P2PClientProtocol._connect] Connecting to host 192.168.0.94 on port 20097 (CHECK_CAM) {
stationSN: 'T81A0P1023404CFA',
address: {
host: '192.168.0.94',
port: 20097
},
p2pDid: 'USPRAMB-758202-CCCNR'
}
2024-05-20 20:55:28.763 DEBUG eufy-security-ws:eufy-security-client [p2p] [P2PClientProtocol.handleMsg] Trying to connect in QUICKEST mode... {
stationSN: 'T81A0P1023404CFA',
ip: '73.42.203.35',
port: 20097
}
2024-05-20 20:55:28.764 DEBUG eufy-security-ws:eufy-security-client [p2p] [P2PClientProtocol._connect] Connecting to host 73.42.203.35 on port 20097 (CHECK_CAM) {
stationSN: 'T81A0P1023404CFA',
address: {
host: '73.42.203.35',
port: 20097
},
p2pDid: 'USPRAMB-758202-CCCNR'
}
2024-05-20 20:55:28.767 DEBUG eufy-security-ws:eufy-security-client [p2p] [P2PClientProtocol.handleMsg] Trying to connect in QUICKEST mode... {
stationSN: 'T81A0P1023404CFA',
ip: '192.168.0.94',
port: 20097
}
2024-05-20 20:55:28.768 DEBUG eufy-security-ws:eufy-security-client [p2p] [P2PClientProtocol._connect] Connecting to host 192.168.0.94 on port 20097 (CHECK_CAM) {
stationSN: 'T81A0P1023404CFA',
address: {
host: '192.168.0.94',
port: 20097
},
p2pDid: 'USPRAMB-758202-CCCNR'
}
2024-05-20 20:55:31.718 DEBUG eufy-security-ws:eufy-security-client [p2p] [P2PClientProtocol.handleMsg] Connecting to host 50.18.221.114 on port 10000 (CHECK_CAM2)... {
stationSN: 'T81A0P1023404CFA',
ip: '50.18.221.114',
port: 10000,
data: '20e7f36e'
}
2024-05-20 20:55:31.723 DEBUG eufy-security-ws:eufy-security-client [p2p] [P2PClientProtocol.handleMsg] Connecting to host 18.215.43.18 on port 10000 (CHECK_CAM2)... {
stationSN: 'T81A0P1023404CFA',
ip: '18.215.43.18',
port: 10000,
data: '20e7f36f'
}
2024-05-20 20:55:31.754 DEBUG eufy-security-ws:eufy-security-client [p2p] [P2PClientProtocol.handleMsg] Connecting to host 50.18.221.114 on port 10000 (CHECK_CAM2)... {
stationSN: 'T81A0P1023404CFA',
ip: '50.18.221.114',
port: 10000,
data: '1eb53683'
}
2024-05-20 20:55:31.757 DEBUG eufy-security-ws:eufy-security-client [p2p] [P2PClientProtocol.handleMsg] Connecting to host 18.215.43.18 on port 10000 (CHECK_CAM2)... {
stationSN: 'T81A0P1023404CFA',
ip: '18.215.43.18',
port: 10000,
data: '1eb53684'
}
2024-05-20 20:55:31.760 DEBUG eufy-security-ws:eufy-security-client [p2p] [P2PClientProtocol.handleMsg] Connecting to host 50.18.221.114 on port 10000 (CHECK_CAM2)... {
stationSN: 'T81A0P1023404CFA',
ip: '50.18.221.114',
port: 10000,
data: '20c1d26e'
}
2024-05-20 20:55:31.762 DEBUG eufy-security-ws:eufy-security-client [p2p] [P2PClientProtocol.handleMsg] Connecting to host 18.215.43.18 on port 10000 (CHECK_CAM2)... {
stationSN: 'T81A0P1023404CFA',
ip: '18.215.43.18',
port: 10000,
data: '20c1d26f'
}
2024-05-20 20:55:33.677 ERROR eufy-security-ws Message error
LivestreamNotRunningError Livestream for device T81A0P1023404CFA could not be stopped, because it is not running, LivestreamNotRunningError
error stack:
• message_handler.js DeviceMessageHandler.handle
/usr/src/app/node_modules/eufy-security-ws/dist/lib/device/message_handler.js:213
• task_queues process.processTicksAndRejections
internal/process/task_queues:95
• server.js async Client.receiveMessage
/usr/src/app/node_modules/eufy-security-ws/dist/lib/server.js:94
Would you share your device with me in case further debugging required? (Yes/No): If necessary
Additional context
Add any other context about the problem goes here. Mainly, share everything as log files and use screenshots as last resort.
A few things I've tried without notable changes in behavior:
Using Eufy app to adjust notification settings, enabling all notifications at the highest frequency
Increasing the length of camera triggering time to the maximum in the eufy app
Trying different stream activation sequences, starting with cameras that I know work and then trying the misbehaving one. I did this in various orders to see if the error would be provoked.
Ensuring the strongest possible wifi signal (full strength according to Eufy app)
Adjusting eufy integration settings ("Stream" checkbox) to see if there's any difference
Describe the bug
FYI: I have a Eufy doorbell and multiple pan/tilt cameras that work flawlessly with this integration (Thank you!!). I've been using this integration for quite a while so I have a decent understanding.
The problem is with a new Eufy S120 when attempting to livestream to my HA dashboard. I encounter this error:
Failed to call service camera/turn_on. {'type': 'result', 'success': False, 'messageId': 'device.stop_livestream.c42ea6d5c7f742d0a678cc8f883e539e', 'errorCode': 'device_livestream_not_running
}`Around 20% of the time, I can get the feed to appear without issue from this camera (it's on the list of supported devices). The rest of the time, the stream will throw an error within about 10 seconds after clicking "Start Stream." But even if I'm able to get the stream running, most of the time it will be live for about 30 seconds before suddenly stopping, and throwing the same error above. Once the error appears, the Eufy Add-On hangs, and must be manually restarted or it will chew up CPU.
To reproduce
Assume Eufy Add-On + Integration are installed and configured, with other camera streams already working.
Assuming the root cause is related this bug reproes in two ways: First Repro
camera.garage_camera
and saveSecond Repro
camera.garage_camera
and saveExpected behavior
A livestream of the camera feed should start within 10 seconds of pressing "Start stream"
Additional information
Go to Settings -> System -> Repairs -> Click on 3 dots (...) -> System Information and get Version and Installation Type to below fields;
Hardware Information:
Camera Model: Eufy S120
Raspberry Pi Model 4B
Live Streaming Protocol (RTSP/P2P): P2P (note: this camera specifically does not give the option for RTSP, but i still get an RTSP link in the device UI, and the stream says "RTC" when it works)
Debug Logs from Home Assistant (https://github.com/fuatakgun/eufy_security/discussions/624) - Without this, I will automatically resolve this issue Attached, with specific error below. The logs keep getting truncated to a short output instead of showing me the whole thing at once. So I tried to capture the logs specifically when the stream fails. I can get additional samples if helpful.
402f1039_eufy_security_ws_2024-05-20T18-56-52.879Z.log
Logs from Eufy Security Add-on (either from Add-ons page of Home Assistant or Docker output): Attached, with specific error below. The logs keep getting truncated to a short output instead of showing me the whole thing at once. So I tried to capture the logs specifically when the stream fails. I can get additional samples if helpful.
Would you share your device with me in case further debugging required? (Yes/No): If necessary
Additional context
Add any other context about the problem goes here. Mainly, share everything as log files and use screenshots as last resort.
A few things I've tried without notable changes in behavior: