bropat / ioBroker.eusec

This ioBroker adapter allows to control Eufy security devices by connecting to the Eufy cloud servers.
MIT License
132 stars 17 forks source link

Battery percentage shows 0% #199

Closed beandi closed 2 years ago

beandi commented 2 years ago

Describe the bug
Eufycam 2C and 2C pro: Although the battery state in the app ist shown as value between 50% and 100%, the adapter often shows 0%. Some of my cameras have a solar-cell as a supplementary powersource, and there it occurs most often. Nonetheless the rest of the adapter works flawless, but the logged data for the charging-state looks horrible.

Expected behavior
no "0%"-values as long as the battery is above 0%

Versions:

thanks!

bropat commented 2 years ago

Please set the adapter in debug mode, reproduce the error and send me the debug logs.

beandi commented 2 years ago

Debug Logs seems fine, it's just the battery getting a zero value:

[Camera.update] Normalized Properties [{"deviceSN":"T8114P022023305C","properties":{"name":{"value":"Carport","timestamp":1638123831000},"model":{"value":"T8114","timestamp":1638123831000},"serialNumber":{"value":"T8114P022023305C","timestamp":1638123831000},"type":{"value":9,"timestamp":1638123831000},"hardwareVersion":{"value":"eufy2_v","timestamp":1638123831000},"softwareVersion":{"value":"2.7.4","timestamp":1619529683000},"stationSerialNumber":{"value":"T8010N232018098E","timestamp":1638123831000},"rtspStreamUrl":{"value":"","timestamp":1638124855317},"lastChargingDays":{"value":227,"timestamp":1638123831000},"lastChargingFalseEvents":{"value":2375,"timestamp":1638123831000},"lastChargingRecordedEvents":{"value":1782,"timestamp":1638123831000},"lastChargingTotalEvents":{"value":4157,"timestamp":1638123831000},"batteryUsageLastWeek":{"value":0,"timestamp":1638123831000},"pictureUrl":{"value":"xxxx","timestamp":1638123812000},"recordingClipLength":{"value":60,"timestamp":1638124855317},"recordingRetriggerInterval":{"value":5,"timestamp":1638124855317},"recordingEndClipMotionStops":{"value":true,"timestamp":1638124855317},"wifiRssi":{"value":-55,"timestamp":1638134637293},"wifiSignalLevel":{"value":4,"timestamp":1636815810000},"batteryTemperature":{"value":0,"timestamp":1636794197000},"motionDetectionType":{"value":0,"timestamp":1616351994000},"rtspStream":{"value":false,"timestamp":1596279376000},"enabled":{"value":true,"timestamp":1596279365000},"speaker":{"value":true,"timestamp":1596279376000},"microphone":{"value":true,"timestamp":1596279376000},"battery":{"value":0,"timestamp":1638204107207},"motionDetectionSensitivity":{"value":4,"timestamp":1596279377000},"speakerVolume":{"value":92,"timestamp":1596279376000},"notificationType":{"value":3,"timestamp":1605956705000},"statusLed":{"value":false,"timestamp":1596279376000},"antitheftDetection":{"value":true,"timestamp":1618639985000},"motionDetection":{"value":true,"timestamp":1596279376000},"chargingStatus":{"value":2,"timestamp":1618639008000},"watermark":{"value":1,"timestamp":1633424458000},"state":{"value":1,"timestamp":1596279365000},"autoNightvision":{"value":true,"timestamp":1617682187000},"powerWorkingMode":{"value":0,"timestamp":1598902037000},"motionDetected":{"value":false,"timestamp":0},"personDetected":{"value":false,"timestamp":0},"personName":{"value":"","timestamp":0},"audioRecording":{"value":true,"timestamp":1638124855565},"powerSource":{"value":0,"timestamp":1638124855565}}}]

bropat commented 2 years ago

@beandi

The battery value is received via 2 interfaces in the eufy-security-client driver, used by this adapter:

It looks like one of the 2 interfaces is now delivering an incorrect value.

To understand exactly which one returns the wrong value I need the debug logs where the problem is visible (the log extract should contain the correct value plus the 0 value of the battery property).

I need the debug logs of the time frame where the value went to 0 and where the value was displayed correctly again.

FeromonDE commented 2 years ago

@bropat

ich habe das gleiche Problem mit zwei 2C Pro, und egal was ich mache, es bleibt bei 0%.

beandi commented 2 years ago

It looks like one of the 2 interfaces is now delivering an incorrect value.

To understand exactly which one returns the wrong value I need the debug logs where the problem is visible (the log extract should contain the correct value plus the 0 value of the battery property).

I need the debug logs of the time frame where the value went to 0 and where the value was displayed correctly again.

Here you go: ` Value 0 2022-01-04 00:47:26.821 - debug: eufy-security.0 (614814) [Camera.update] Normalized Properties [{"deviceSN":"xxx5E8D","properties":{"name":{"value":"Garten","timestamp":1641129913000},"model":{"value":"T8113","timestamp":1641129913000},"serialNumber":{"value":"xxx5E8D","timestamp":1641129913000},"type":{"value":8,"timestamp":1641129913000},"hardwareVersion":{"value":"eufy2_mini","timestamp":1641129913000},"softwareVersion":{"value":"1.7.4","timestamp":1619529588000},"stationSerialNumber":{"value":"xxx098E","timestamp":1641129913000},"rtspStreamUrl":{"value":"","timestamp":1641215440091},"lastChargingDays":{"value":0,"timestamp":1641129913000},"lastChargingFalseEvents":{"value":0,"timestamp":1641129913000},"lastChargingRecordedEvents":{"value":0,"timestamp":1641129913000},"lastChargingTotalEvents":{"value":0,"timestamp":1641129913000},"batteryUsageLastWeek":{"value":0,"timestamp":1641129913000},"pictureUrl":{"value":"xxx","timestamp":1641129888000},"recordingClipLength":{"value":60,"timestamp":1641215440091},"recordingRetriggerInterval":{"value":5,"timestamp":1641215440091},"recordingEndClipMotionStops":{"value":true,"timestamp":1641215440091},"lightSettingsBrightnessManual":{"value":100,"timestamp":1641215440091},"rtspStream":{"value":false,"timestamp":1596277284000},"nightvision":{"value":1,"timestamp":1626721935000},"enabled":{"value":true,"timestamp":1596277277000},"powerSource":{"value":1,"timestamp":1627807411000},"speaker":{"value":true,"timestamp":1596277284000},"microphone":{"value":true,"timestamp":1596277284000},"battery":{"value":0,"timestamp":1641222462465},"motionDetectionSensitivity":{"value":5,"timestamp":1614116502000},"light":{"value":false,"timestamp":1608830296000},"speakerVolume":{"value":93,"timestamp":1596277284000},"notificationType":{"value":2,"timestamp":1605956719000},"statusLed":{"value":false,"timestamp":1596277284000},"motionDetectionType":{"value":2,"timestamp":1620409291000},"wifiRssi":{"value":-72,"timestamp":1627240273000},"wifiSignalLevel":{"value":3,"timestamp":1627240273000},"antitheftDetection":{"value":false,"timestamp":1596277284000},"motionDetection":{"value":true,"timestamp":1596277284000},"chargingStatus":{"value":2,"timestamp":1641223244882},"watermark":{"value":1,"timestamp":1596277284000},"state":{"value":1,"timestamp":1596277277000},"powerWorkingMode":{"value":1,"timestamp":1599585257000},"batteryTemperature":{"value":7,"timestamp":1641215440566},"motionDetected":{"value":false,"timestamp":0},"personDetected":{"value":false,"timestamp":0},"personName":{"value":"","timestamp":0},"audioRecording":{"value":true,"timestamp":1641215440566}}}]

Value 100 2022-01-04 00:51:34.523 - debug: eufy-security.0 (614814) [Camera.update] Normalized Properties [{"deviceSN":"xxx5E8D","properties":{"name":{"value":"Garten","timestamp":1641129913000},"model":{"value":"T8113","timestamp":1641129913000},"serialNumber":{"value":"xxx5E8D","timestamp":1641129913000},"type":{"value":8,"timestamp":1641129913000},"hardwareVersion":{"value":"eufy2_mini","timestamp":1641129913000},"softwareVersion":{"value":"1.7.4","timestamp":1619529588000},"stationSerialNumber":{"value":"xxx098E","timestamp":1641129913000},"rtspStreamUrl":{"value":"","timestamp":1641215440091},"lastChargingDays":{"value":0,"timestamp":1641129913000},"lastChargingFalseEvents":{"value":0,"timestamp":1641129913000},"lastChargingRecordedEvents":{"value":0,"timestamp":1641129913000},"lastChargingTotalEvents":{"value":0,"timestamp":1641129913000},"batteryUsageLastWeek":{"value":0,"timestamp":1641129913000},"pictureUrl":{"value":"xxx","timestamp":1641129888000},"recordingClipLength":{"value":60,"timestamp":1641215440091},"recordingRetriggerInterval":{"value":5,"timestamp":1641215440091},"recordingEndClipMotionStops":{"value":true,"timestamp":1641215440091},"lightSettingsBrightnessManual":{"value":100,"timestamp":1641215440091},"rtspStream":{"value":false,"timestamp":1596277284000},"nightvision":{"value":1,"timestamp":1626721935000},"enabled":{"value":true,"timestamp":1596277277000},"powerSource":{"value":1,"timestamp":1627807411000},"speaker":{"value":true,"timestamp":1596277284000},"microphone":{"value":true,"timestamp":1596277284000},"battery":{"value":100,"timestamp":1641253646994},"motionDetectionSensitivity":{"value":5,"timestamp":1614116502000},"light":{"value":false,"timestamp":1608830296000},"speakerVolume":{"value":93,"timestamp":1596277284000},"notificationType":{"value":2,"timestamp":1605956719000},"statusLed":{"value":false,"timestamp":1596277284000},"motionDetectionType":{"value":2,"timestamp":1620409291000},"wifiRssi":{"value":-72,"timestamp":1627240273000},"wifiSignalLevel":{"value":3,"timestamp":1627240273000},"antitheftDetection":{"value":false,"timestamp":1596277284000},"motionDetection":{"value":true,"timestamp":1596277284000},"chargingStatus":{"value":2,"timestamp":1641223244882},"watermark":{"value":1,"timestamp":1596277284000},"state":{"value":1,"timestamp":1596277277000},"powerWorkingMode":{"value":1,"timestamp":1599585257000},"batteryTemperature":{"value":4,"timestamp":1641253646994},"motionDetected":{"value":false,"timestamp":0},"personDetected":{"value":false,"timestamp":0},"personName":{"value":"","timestamp":0},"audioRecording":{"value":true,"timestamp":1641215440566}}}]

Value 0 2022-01-04 04:01:50.105 - debug: eufy-security.0 (614814) [Camera.update] Normalized Properties [{"deviceSN":"xxx5E8D","properties":{"name":{"value":"Garten","timestamp":1641129913000},"model":{"value":"T8113","timestamp":1641129913000},"serialNumber":{"value":"xxx5E8D","timestamp":1641129913000},"type":{"value":8,"timestamp":1641129913000},"hardwareVersion":{"value":"eufy2_mini","timestamp":1641129913000},"softwareVersion":{"value":"1.7.4","timestamp":1619529588000},"stationSerialNumber":{"value":"xxx098E","timestamp":1641129913000},"rtspStreamUrl":{"value":"","timestamp":1641215440091},"lastChargingDays":{"value":0,"timestamp":1641129913000},"lastChargingFalseEvents":{"value":0,"timestamp":1641129913000},"lastChargingRecordedEvents":{"value":0,"timestamp":1641129913000},"lastChargingTotalEvents":{"value":0,"timestamp":1641129913000},"batteryUsageLastWeek":{"value":0,"timestamp":1641129913000},"pictureUrl":{"value":"xxx","timestamp":1641129888000},"recordingClipLength":{"value":60,"timestamp":1641215440091},"recordingRetriggerInterval":{"value":5,"timestamp":1641215440091},"recordingEndClipMotionStops":{"value":true,"timestamp":1641215440091},"lightSettingsBrightnessManual":{"value":100,"timestamp":1641215440091},"rtspStream":{"value":false,"timestamp":1596277284000},"nightvision":{"value":1,"timestamp":1626721935000},"enabled":{"value":true,"timestamp":1596277277000},"powerSource":{"value":1,"timestamp":1627807411000},"speaker":{"value":true,"timestamp":1596277284000},"microphone":{"value":true,"timestamp":1596277284000},"battery":{"value":0,"timestamp":1641264759545},"motionDetectionSensitivity":{"value":5,"timestamp":1614116502000},"light":{"value":false,"timestamp":1608830296000},"speakerVolume":{"value":93,"timestamp":1596277284000},"notificationType":{"value":2,"timestamp":1605956719000},"statusLed":{"value":false,"timestamp":1596277284000},"motionDetectionType":{"value":2,"timestamp":1620409291000},"wifiRssi":{"value":-72,"timestamp":1641260627070},"wifiSignalLevel":{"value":3,"timestamp":1627240273000},"antitheftDetection":{"value":false,"timestamp":1596277284000},"motionDetection":{"value":true,"timestamp":1596277284000},"chargingStatus":{"value":2,"timestamp":1641223244882},"watermark":{"value":1,"timestamp":1596277284000},"state":{"value":1,"timestamp":1596277277000},"powerWorkingMode":{"value":1,"timestamp":1599585257000},"batteryTemperature":{"value":1,"timestamp":1641258640392},"motionDetected":{"value":false,"timestamp":0},"personDetected":{"value":false,"timestamp":0},"personName":{"value":"","timestamp":0},"audioRecording":{"value":true,"timestamp":1641215440566}}}] `

bropat commented 2 years ago

@beandi

I believe you, but from the log clippings I only see the "final" value and not where it comes from. I need the entire log section where both occur.

beandi commented 2 years ago

@bropat there is a lot of private information in the logs, so i hesitate to post or send them all uncut. Could you point me in a direction which keywords to search for? As a workaround i disabled recording of 0/NULL values in the influx-adapter, at least the graphs are looking clean this way.

bropat commented 2 years ago

Issue found will be fixed in next release (https://github.com/bropat/eufy-security-client/issues/109).

bropat commented 2 years ago

Released fixed version (0.8.0)