arraylabs / pymyq

Python wrapper for MyQ API
MIT License
112 stars 42 forks source link

State values for locks #142

Closed Goose66 closed 2 years ago

Goose66 commented 2 years ago

Do we know what the values returned for the lock_state are? “locked” and “unlocked”? “open” and “closed” like a door? Constants did not get defined in locks.py. Similarly it would be nice to know what the commands are, as well.

deftdawg commented 2 years ago

device.state returns locked or unlocked for my Lockitron with example.py ... my guess is the API returns lock_state as a string and that's what gets mapped.

Account Name: MyQ's Home
  Locks: 1
  ---------
      Device 1: Door Lock
      Device Online: True
      Device ID: LTRON_E0...
      Parent Device ID: GW2600...
      Device Family: locks
      Device Platform: myq
      Device Type: lockitron
      Firmware Version: 1533846445
      Open Allowed: False
      Close Allowed: False
      Current State: locked
      ---------
  ------------------------------
  Gateways: 1
  ------------
      Device 1: Hub
      Device Online: True
      Device ID: GW2600...
      Parent Device ID: None
      Device Family: gateway
      Device Platform: myq
      Device Type: hub
      Firmware Version: 2.11
      Open Allowed: False
      Close Allowed: False
      Current State: None
      ---------
------------------------------

# Run #2 after unlocking...
...
      Current State: unlocked
Goose66 commented 2 years ago

Thanks!

spudwebb commented 2 years ago

@deftdawg , @Goose66 do you know what are the possible commands in the locks URI?

https://account-devices-locks.myq-cloud.com/api/v5.2/Accounts/{account_id}/locks/{device_serial}/{command}

Goose66 commented 2 years ago

I do not. The pymyq code specifically states it's read only. Don't know if that means the API or just the pymyq implementation.

ehendrix23 commented 2 years ago

Pymyq implementation. We don’t know the API calls to do it etc hence not able to implement.

deftdawg commented 2 years ago

The API calls can be seen by downloading the Android APK, unzipping and decompiling it (using jad)... This exposes only the current API they use which is v6.0