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

Cannot change the guard mode #41

Closed dcc82 closed 3 years ago

dcc82 commented 3 years ago

Describe the bug
Hello,

I have a similar issue to this one, but what's worse is that I can't even change it from the Objects view.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Objects
  2. Click on the value of 'guard_mode'
  3. Select Home from the dropdown list, and click on the tick icon
  4. After a few minutes, it changed back to the previous mode

Screenshots & Logfiles
eufy-security.0 2020-12-30 14:56:38.293 debug (10898) EufyP2PClientProtocol.handleData(): commandId: CMD_SET_PAYLOAD (1350) - result: ERROR_PPCS_TIME_OUT (-3) - msg: f1d00098d1000001585a59484605840000000100ff000100fdffffff000000000000000000000000 eufy-security.0 2020-12-30 14:56:38.293 debug (10898) EufyP2PClientProtocol.handleData(): Result data for command received - message: {"sequence":1,"command_type":1350,"nested_command_type":1224,"channel":255,"data":{"type":"Buffer","data":[209,0 eufy-security.0 2020-12-30 14:56:38.293 error (10898) EufySecurity.stationP2PCommandResult(): Station: T8010P13201XXXXXXXX command CMD_SET_ARMING failed with error: ERROR_PPCS_TIME_OUT (-3) eufy-security.0 2020-12-30 14:56:38.292 debug (10898) Station.onCommandResponse(): station: T8010P13201XXXXXXXX command_type: 1224 channel: 255 return_code: ERROR_PPCS_TIME_OUT (-3) eufy-security.0 2020-12-30 14:56:38.291 debug (10898) EufyP2PClientProtocol.handleMsg(): DATA - received from host 192.168.110.231:28654 - Processing DATA with sequence 1... eufy-security.0 2020-12-30 14:56:29.752 debug (10898) system.adapter.admin.0: logging true eufy-security.0 2020-12-30 14:56:26.499 debug (10898) EufyP2PClientProtocol.handleMsg(): ACK - received from host 192.168.110.231:28654 for datatype DATA sequence 1 eufy-security.0 2020-12-30 14:56:26.491 debug (10898) EufyP2PClientProtocol._sendCommand(): sequence: 1 command_type: 1350 channel: 255 retries: 0 message_states.size: 1 eufy-security.0 2020-12-30 14:56:26.491 debug (10898) Station.setGuardMode(): Using CMD_SET_PAYLOAD... eufy-security.0 2020-12-30 14:56:26.491 debug (10898) Station.setGuardMode(): P2P connection to station T8010P13201XXXXXXXX present, send command mode: 1. eufy-security.0 2020-12-30 14:56:26.490 info (10898) state eufy-security.0.T8010P13201XXXXXXXX.station.guard_mode changed: 1 (ack = false)

Versions:

I assume it's due to ERROR_PPCS_TIME_OUT, but why? I'm currently running your adapter in a dockerised version of ioBroker, could that be the issue?

Thanks.

bropat commented 3 years ago

@dcc82 Hi, Yes the problem is due to ERROR_PPCS_TIME_OUT error. This error is reported by the station via the p2p interface. Unfortunately, I have no idea what this error means.

I'm currently running your adapter in a dockerised version of ioBroker, could that be the issue?

I don't think.

knutbrecht commented 3 years ago

Hi. Just installed v0.1.2 after using 0.0.8. New behaviour of "current_mode" and "guard_mode": When changing the value of guard_mode-object, it is not changed in the app (android). When changing the mode in the app, it is temporarily changend in CURRENT_MODE object (NOT in guard_mode). After some time the current_mode changes back to disarmed(63).

In v0.0.8 i could change the guard_mode via VIS and it changed the status in the app an ONLY the guard_mode-object.

Nevertheless GREAT work. I waited very long for this adapter. Thanks!

bropat commented 3 years ago

@dcc82, @knutbrecht

Should be fixed with latest version (0.1.3). Let me know :)

knutbrecht commented 3 years ago

hi. new version 0.1.3:

Or is there a delay in updating the objects? How long can that be?

bropat commented 3 years ago

@knutbrecht

changing Mode in APP does not result in updated guard_mode object.

At the moment the following is supported:

  1. Activate push notification on the station and the guard mode is changed immediately
  2. Current mode changes instantly, because this event is send by the station over the p2p connection. Here I still have to code that in this case the guard mode is read again over p2p (a the moment it is read only over HTTP).
  3. By polling via the HTTP interface every x minutes (can be set in the settings; default: every 10 minutes)

My main focus at the moment is on decrypting the p2p protocol. This allows me to add some more features (e.g. livestream over p2p, no more polling over HTTP should be possible and so on ;) )