Skip to content

Commit

Permalink
Incremented schema version to 4
Browse files Browse the repository at this point in the history
Added new properties `chargingStatus`, `wifiSignalLevel`, `rtspStreamUrl`, `chirpVolume`, `chirpTone`, `videoHdr`, `videoDistortionCorrection` and `videoRingRecord` to Device
Renamed properties from `motionDetectionSensivity`, `soundDetectionSensivity` and `ledStatus` to `motionDetectionSensitivity`, `soundDetectionSensitivity` and `statusLed` for Device
Some problems that arose with the past schemaVersion increases have been fixed (#14)
Implemented feature request #13
Added debug option to the container (#15)
Updated versions of the package dependencies
  • Loading branch information
bropat committed Aug 7, 2021
1 parent f0379ef commit ff42617
Show file tree
Hide file tree
Showing 13 changed files with 2,796 additions and 118 deletions.
7 changes: 6 additions & 1 deletion API_SCHEMA.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,9 @@ Base schema.
* Added new Station events `currentModeChanged` and `alarmEvent`
* Added new commands `triggerAlarm`, `resetAlarm`, `hasProperty`, `hasCommand` and `getCommands` to Station
* Added new properties `timeFormat`, `alarmVolume`, `alarmTone`, `promptVolume`, `notificationSwitchModeSchedule`, `notificationSwitchModeGeofence`, `notificationSwitchModeApp`, `notificationSwitchModeKeypad` and `notificationStartAlarmDelay` to Station
* Added new error codes `deviceInvalidProperty`, `deviceInvalidPropertyValue`, `devicePropertyNotSupported`, `deviceReadOnlyProperty`, `deviceNotSupported`, `deviceInvalidCommandValue`, `deviceLivestreamAlreadyRunning`, `deviceLivestreamNotRunning`, `schemaIncompatible`, `invalidCountryCode` and `invalidLanguageCode`
* Added new error codes `deviceInvalidProperty`, `deviceInvalidPropertyValue`, `devicePropertyNotSupported`, `deviceReadOnlyProperty`, `deviceNotSupported`, `deviceInvalidCommandValue`, `deviceLivestreamAlreadyRunning`, `deviceLivestreamNotRunning`, `schemaIncompatible`, `invalidCountryCode` and `invalidLanguageCode`

## Schema 4

* Added new properties `chargingStatus`, `wifiSignalLevel`, `rtspStreamUrl`, `chirpVolume`, `chirpTone`, `videoHdr`, `videoDistortionCorrection` and `videoRingRecord` to Device
* Renamed properties from `motionDetectionSensivity`, `soundDetectionSensivity` and `ledStatus` to `motionDetectionSensitivity`, `soundDetectionSensitivity` and `statusLed` for Device
155 changes: 146 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ Returns:

```ts
interface {
serialNumber: string; // [added with schema version: 4+]
connected: boolean;
}
```
Expand Down Expand Up @@ -425,6 +426,7 @@ Returns:

```ts
interface {
serialNumber: string; // [added with schema version: 4+]
properties: {
[index: string]: PropertyValue;
}
Expand Down Expand Up @@ -486,6 +488,7 @@ Returns:

```ts
interface {
serialNumber: string; // [added with schema version: 4+]
commands: Array<CommandName>;
}
```
Expand All @@ -507,6 +510,7 @@ Returns:

```ts
interface {
serialNumber: string; // [added with schema version: 4+]
exists: boolean;
}
```
Expand All @@ -528,6 +532,7 @@ Returns:

```ts
interface {
serialNumber: string; // [added with schema version: 4+]
exists: boolean;
}
```
Expand All @@ -550,6 +555,7 @@ Returns:

```ts
interface {
serialNumber: string; // [added with schema version: 4+]
properties: {
[index: string]: PropertyMetadataAny;
}
Expand All @@ -572,6 +578,7 @@ Returns:

```ts
interface {
serialNumber: string; // [added with schema version: 4+]
properties: {
[index: string]: PropertyValue;
}
Expand Down Expand Up @@ -762,6 +769,7 @@ Returns:

```ts
interface {
serialNumber: string; // [added with schema version: 4+]
livestreaming: boolean;
}
```
Expand Down Expand Up @@ -859,7 +867,8 @@ Returns:

```ts
interface {
voices: Voices
serialNumber: string; // [added with schema version: 4+]
voices: Voices
}
```

Expand All @@ -879,6 +888,7 @@ Returns:

```ts
interface {
serialNumber: string; // [added with schema version: 4+]
commands: Array<CommandName>;
}
```
Expand All @@ -900,6 +910,7 @@ Returns:

```ts
interface {
serialNumber: string; // [added with schema version: 4+]
exists: boolean;
}
```
Expand All @@ -921,6 +932,7 @@ Returns:

```ts
interface {
serialNumber: string; // [added with schema version: 4+]
exists: boolean;
}
```
Expand Down Expand Up @@ -1034,7 +1046,16 @@ interface {
currentMode: number;
guardMode: number;
connected: boolean;
type: number;
type: number; // [added with schema version: 1+]
timeFormat: number; // [added with schema version: 3+]
alarmVolume: number; // [added with schema version: 3+]
alarmTone: number; // [added with schema version: 3+]
promptVolume: number; // [added with schema version: 3+]
notificationSwitchModeSchedule: boolean; // [added with schema version: 3+]
notificationSwitchModeGeofence: boolean; // [added with schema version: 3+]
notificationSwitchModeApp: boolean; // [added with schema version: 3+]
notificationSwitchModeKeypad: boolean; // [added with schema version: 3+]
notificationStartAlarmDelay: boolean; // [added with schema version: 3+]
}
}
}
Expand Down Expand Up @@ -1063,7 +1084,16 @@ interface {
currentMode: number;
guardMode: number;
connected: boolean;
type: number;
type: number; // [added with schema version: 1+]
timeFormat: number; // [added with schema version: 3+]
alarmVolume: number; // [added with schema version: 3+]
alarmTone: number; // [added with schema version: 3+]
promptVolume: number; // [added with schema version: 3+]
notificationSwitchModeSchedule: boolean; // [added with schema version: 3+]
notificationSwitchModeGeofence: boolean; // [added with schema version: 3+]
notificationSwitchModeApp: boolean; // [added with schema version: 3+]
notificationSwitchModeKeypad: boolean; // [added with schema version: 3+]
notificationStartAlarmDelay: boolean; // [added with schema version: 3+]
}
}
}
Expand All @@ -1082,7 +1112,7 @@ interface {
source: "station";
event: "guard mode changed";
serialNumber: string;
currentMode: number; // Removed in schema version 3+, as there is now a separate event
currentMode: number; // [removed with schema version: 3+ as there is now a separate event]
guardMode: number;
}
}
Expand Down Expand Up @@ -1237,9 +1267,11 @@ interface {
cryingDetected: boolean;
ringing: boolean;
locked: boolean;
sensorOpen: boolean;
sensorChangeTime: number;
antitheftDetection: boolean;
autoNightvision: boolean;
ledStatus: boolean;
ledStatus: boolean; // [added with schema version: 0+; removed with schema version: 4+]
motionDetection: boolean;
soundDetection: boolean;
petDetection: boolean;
Expand All @@ -1249,7 +1281,58 @@ interface {
motionSensorPIREvent: number;
wifiRSSI: number;
pictureUrl: string;
type: number;
type: number; // [added with schema version: 1+]
motionDetectionType: number; // [added with schema version: 3+]
motionDetectionSensivity: number; // [added with schema version: 3+; removed with schema version: 4+]
motionTracking: boolean; // [added with schema version: 3+]
soundDetectionType: number; // [added with schema version: 3+]
soundDetectionSensivity: number; // [added with schema version: 3+; removed with schema version: 4+]
light: boolean; // [added with schema version: 3+]
microphone: boolean; // [added with schema version: 3+]
speaker: boolean; // [added with schema version: 3+]
speakerVolume: number; // [added with schema version: 3+]
ringtoneVolume: number; // [added with schema version: 3+]
audioRecording: boolean; // [added with schema version: 3+]
powerSource: number; // [added with schema version: 3+]
powerWorkingMode: number; // [added with schema version: 3+]
recordingEndClipMotionStops: boolean; // [added with schema version: 3+]
recordingClipLength: number; // [added with schema version: 3+]
recordingRetriggerInterval: number; // [added with schema version: 3+]
videoStreamingQuality: number; // [added with schema version: 3+]
videoRecordingQuality: number; // [added with schema version: 3+]
videoWDR: boolean; // [added with schema version: 3+]
lightSettingsEnable: boolean; // [added with schema version: 3+]
lightSettingsBrightnessManual: number; // [added with schema version: 3+]
lightSettingsBrightnessMotion: number; // [added with schema version: 3+]
lightSettingsBrightnessSchedule: number; // [added with schema version: 3+]
lightSettingsMotionTriggered: boolean; // [added with schema version: 3+]
lightSettingsMotionTriggeredDistance: number; // [added with schema version: 3+]
lightSettingsMotionTriggeredTimer: number; // [added with schema version: 3+]
chimeIndoor: boolean; // [added with schema version: 3+]
chimeHomebase: boolean; // [added with schema version: 3+]
chimeHomebaseRingtoneVolume: number; // [added with schema version: 3+]
chimeHomebaseRingtoneType: number; // [added with schema version: 3+]
notificationType: number; // [added with schema version: 3+]
rotationSpeed: number; // [added with schema version: 3+]
notificationPerson: boolean; // [added with schema version: 3+]
notificationPet: boolean; // [added with schema version: 3+]
notificationAllOtherMotion: boolean; // [added with schema version: 3+]
notificationCrying: boolean; // [added with schema version: 3+]
notificationAllSound: boolean; // [added with schema version: 3+]
notificationIntervalTime: boolean; // [added with schema version: 3+]
notificationRing: boolean; // [added with schema version: 3+]
notificationMotion:boolean; // [added with schema version: 3+]
chirpVolume: number; // [added with schema version: 4+]
chirpTone: number; // [added with schema version: 4+]
motionDetectionSensitivity: number; // [added with schema version: 4+]
soundDetectionSensitivity: number; // [added with schema version: 4+]
videoHdr: boolean; // [added with schema version: 4+]
videoDistortionCorrection: boolean; // [added with schema version: 4+]
videoRingRecord: number; // [added with schema version: 4+]
statusLed: boolean; // [added with schema version: 4+]
chargingStatus: number; // [added with schema version: 4+]
rtspStreamUrl: string; // [added with schema version: 4+]
wifiSignalLevel: number; // [added with schema version: 4+]
}
}
}
Expand Down Expand Up @@ -1292,9 +1375,11 @@ interface {
cryingDetected: boolean;
ringing: boolean;
locked: boolean;
sensorOpen: boolean;
sensorChangeTime: number;
antitheftDetection: boolean;
autoNightvision: boolean;
ledStatus: boolean;
ledStatus: boolean; // [added with schema version: 0+; removed with schema version: 4+]
motionDetection: boolean;
soundDetection: boolean;
petDetection: boolean;
Expand All @@ -1304,7 +1389,58 @@ interface {
motionSensorPIREvent: number;
wifiRSSI: number;
pictureUrl: string;
type: number;
type: number; // [added with schema version: 1+]
motionDetectionType: number; // [added with schema version: 3+]
motionDetectionSensivity: number; // [added with schema version: 3+; removed with schema version: 4+]
motionTracking: boolean; // [added with schema version: 3+]
soundDetectionType: number; // [added with schema version: 3+]
soundDetectionSensivity: number; // [added with schema version: 3+; removed with schema version: 4+]
light: boolean; // [added with schema version: 3+]
microphone: boolean; // [added with schema version: 3+]
speaker: boolean; // [added with schema version: 3+]
speakerVolume: number; // [added with schema version: 3+]
ringtoneVolume: number; // [added with schema version: 3+]
audioRecording: boolean; // [added with schema version: 3+]
powerSource: number; // [added with schema version: 3+]
powerWorkingMode: number; // [added with schema version: 3+]
recordingEndClipMotionStops: boolean; // [added with schema version: 3+]
recordingClipLength: number; // [added with schema version: 3+]
recordingRetriggerInterval: number; // [added with schema version: 3+]
videoStreamingQuality: number; // [added with schema version: 3+]
videoRecordingQuality: number; // [added with schema version: 3+]
videoWDR: boolean; // [added with schema version: 3+]
lightSettingsEnable: boolean; // [added with schema version: 3+]
lightSettingsBrightnessManual: number; // [added with schema version: 3+]
lightSettingsBrightnessMotion: number; // [added with schema version: 3+]
lightSettingsBrightnessSchedule: number; // [added with schema version: 3+]
lightSettingsMotionTriggered: boolean; // [added with schema version: 3+]
lightSettingsMotionTriggeredDistance: number; // [added with schema version: 3+]
lightSettingsMotionTriggeredTimer: number; // [added with schema version: 3+]
chimeIndoor: boolean; // [added with schema version: 3+]
chimeHomebase: boolean; // [added with schema version: 3+]
chimeHomebaseRingtoneVolume: number; // [added with schema version: 3+]
chimeHomebaseRingtoneType: number; // [added with schema version: 3+]
notificationType: number; // [added with schema version: 3+]
rotationSpeed: number; // [added with schema version: 3+]
notificationPerson: boolean; // [added with schema version: 3+]
notificationPet: boolean; // [added with schema version: 3+]
notificationAllOtherMotion: boolean; // [added with schema version: 3+]
notificationCrying: boolean; // [added with schema version: 3+]
notificationAllSound: boolean; // [added with schema version: 3+]
notificationIntervalTime: boolean; // [added with schema version: 3+]
notificationRing: boolean; // [added with schema version: 3+]
notificationMotion:boolean; // [added with schema version: 3+]
chirpVolume: number; // [added with schema version: 4+]
chirpTone: number; // [added with schema version: 4+]
motionDetectionSensitivity: number; // [added with schema version: 4+]
soundDetectionSensitivity: number; // [added with schema version: 4+]
videoHdr: boolean; // [added with schema version: 4+]
videoDistortionCorrection: boolean; // [added with schema version: 4+]
videoRingRecord: number; // [added with schema version: 4+]
statusLed: boolean; // [added with schema version: 4+]
chargingStatus: number; // [added with schema version: 4+]
rtspStreamUrl: string; // [added with schema version: 4+]
wifiSignalLevel: number; // [added with schema version: 4+]
}
}
}
Expand Down Expand Up @@ -1692,7 +1828,7 @@ In an attempt to keep compatibility between different server and client versions
{
"command": "set_api_schema",
"messageId": 1,
"schemaVersion": 3
"schemaVersion": 4
}
{"type":"result","success":false,"messageId":1,"errorCode":"schema_incompatible"}
```
Expand All @@ -1717,6 +1853,7 @@ eufy-security-ws is available via a Docker image
* `P2P_CONNECTION_SETUP:` P2P connection setup (default: 0 ; Prefers local connection over cloud)
* `POLLING_INTERVAL_MINUTES:` Polling intervall for data refresh from Eufy Cloud (default: 10 min.)
* `ACCEPT_INVITATIONS:` Automatically accept device invitations (default: false)
* `DEBUG:` When the variable is set, debug mode is activated (default: unset)

The image also exposes a `/data` volume that corresponds to the `persistentDir`.

Expand Down
7 changes: 6 additions & 1 deletion docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ POLLING_INTERVAL_MINUTES="${POLLING_INTERVAL_MINUTES:-10}"
TRUSTED_DEVICE_NAME="${TRUSTED_DEVICE_NAME:-eufyclient}"
ACCEPT_INVITATIONS="${ACCEPT_INVITATIONS:-false}"

DEBUG_OPTION=""
if [ -n "$DEBUG" ]; then
DEBUG_OPTION="-v"
fi

JSON_STRING="$( jq -n \
--arg username "$USERNAME" \
--arg password "$PASSWORD" \
Expand All @@ -38,4 +43,4 @@ JSON_STRING="$( jq -n \
)"

echo "$JSON_STRING" > /etc/eufy-security-ws-config.json
/usr/local/bin/node /usr/src/app/dist/bin/server.js --config /etc/eufy-security-ws-config.json
/usr/local/bin/node /usr/src/app/dist/bin/server.js --config /etc/eufy-security-ws-config.json $DEBUG_OPTION
Loading

0 comments on commit ff42617

Please sign in to comment.