question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]: changing guard mode to HOME results in crash

See original GitHub issue

Client 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:closed
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Palmkecommented, Aug 4, 2022

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

1reaction
bropatcommented, Aug 4, 2022

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 a hasPropertyValue, which is not present.

In this case one would have to do the following:

if (propertyName !== undefined && this.getPropertyValue(propertyName) !== undefined) {
    const securitySettingsData: string = this.getPropertyValue(propertyName).toString();
    const settings: StationSecuritySettings = JSON.parse(decodeBase64(securitySettingsData).toString("utf8"));
    if (settings.count_down_arm.channel_list.length > 0 && settings.count_down_arm.delay_time > 0) {
        return settings.count_down_arm.delay_time;
    }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug listing with status RESOLVED with resolution FIXED as at ...
Bug :2 - "How do I attach an ebuild. ... Bug:2911 - "db 3.2.3h causes python bsddb to crash" status:RESOLVED resolution:FIXED severity:major ·...
Read more >
Alexa Guard is Not Working As Expected - Amazon.com
Guard Settings can only be modified in Home mode. If you're in Away mode, switch to Home mode first, and then try modifying...
Read more >
JVM Crash Guard - AppDynamics Documentation
This page describes how to view and monitor JVM crashes with JVM Crash Guard. When a JVM crash occurs, you need to know...
Read more >
Star Citizen Alpha 3.17.4 Known Issues
Below are some of the issues and bugs that we are aware of within Star ... Game/Launcher Issues after a Server Crash; Missile...
Read more >
Known issues - Microsoft Flight Simulator Support
Below you will find the list of known issues as well as potential workarounds or solutions. For a more comprehensive list of bugs...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found