[Bug]: changing guard mode to HOME results in crash
See original GitHub issueClient version
2.1.2
Node version
14.19.1
Operating System type
Mac OS X
Operating system version
Mac OS 12.2.1
Describe the bug
Using Home Assistant I noticed the add on crashed every time I switch to HOME mode. So I checked out newest eufy-security-ws and could reproduce my issue here. Looks like its similar to https://github.com/bropat/eufy-security-client/issues/187 but according to the ticket it should be fixed but somehow I’m still running into that issue.
To reproduce
call station.set_guard_mode <id> 1 in client, error is then logged on the server with eufy-security-ws
Screenshots & Logfiles
2022-08-04 11:49:18.404 INFO Alarm mode for station T8010N232148034E changed to: HOME
(node:46276) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'toString' of undefined
at Station.getArmDelay (/Users/iot/stuff/eufy/eufy-security-ws/node_modules/eufy-security-client/src/http/station.ts:596:85)
at Station.onAlarmMode (/Users/iot/stuff/eufy/eufy-security-ws/node_modules/eufy-security-client/src/http/station.ts:566:31)
at P2PClientProtocol.<anonymous> (/Users/iot/stuff/eufy/eufy-security-ws/node_modules/eufy-security-client/src/http/station.ts:54:68)
at P2PClientProtocol.emit (events.js:400:28)
at P2PClientProtocol.emit (domain.js:475:12)
at P2PClientProtocol.handleDataControl (/Users/iot/stuff/eufy/eufy-security-ws/node_modules/eufy-security-client/src/p2p/session.ts:1274:22)
at P2PClientProtocol.handleData (/Users/iot/stuff/eufy/eufy-security-ws/node_modules/eufy-security-client/src/p2p/session.ts:988:18)
at P2PClientProtocol.parseDataMessage (/Users/iot/stuff/eufy/eufy-security-ws/node_modules/eufy-security-client/src/p2p/session.ts:979:26)
at P2PClientProtocol.handleMsg (/Users/iot/stuff/eufy/eufy-security-ws/node_modules/eufy-security-client/src/p2p/session.ts:801:26)
at Socket.<anonymous> (/Users/iot/stuff/eufy/eufy-security-ws/node_modules/eufy-security-client/src/p2p/session.ts:113:56)
Additional context
I’m not sure how exactly to trigger a debug log that helps you but I found this while looking through the logs on the started server:
{
stationSN: '<...>',
properties: {
name: '<...>',
model: 'T8010',
serialNumber: '<...>',
type: 0,
hardwareVersion: 'P0',
softwareVersion: '3.1.9.0h',
macAddress: '<...>',
timeFormat: 1,
alarmVolume: 3,
promptVolume: NaN,
notificationSwitchModeSchedule: true,
notificationSwitchModeGeofence: true,
notificationSwitchModeApp: true,
notificationSwitchModeKeypad: true,
stationAwaySecuritySettings: '<...>,
stationCustom1SecuritySettings: '<...>',
guardMode: 1,
lanIpAddress: '<...>',
alarmTone: 2,
notificationStartAlarmDelay: true
}
}
Looks like stationHomeSecuritySettings is missing? I added some alarm delay and then the property was available. So looks like that property is not available if you keep everything in the eufy app to default? But then I’m not sure why the property check introduced in the ticket before does not seem to work or still cause an issue.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
Right, that explains a lot. Apologies to @aeife and others experiencing this issue, I have pushed a fix to https://github.com/bropat/eufy-security-client/pull/198
Sorry, I could only look more closely now.
this.hasProperty(propertyName)
doesn’t do what you mean. It checks internally whether this device supports this property. What you would need is ahasPropertyValue
, which is not present.In this case one would have to do the following: