GithubHelp home page GithubHelp logo

rmcob / homebridge-wyze-robovac Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 4.0 236 KB

This plug-in provides rudimentary control for a Wyze Robot Vacuum.

License: Apache License 2.0

Python 26.12% TypeScript 72.49% Shell 1.39%
homebridge robovac verified wyze

homebridge-wyze-robovac's People

Contributors

rmcob avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

homebridge-wyze-robovac's Issues

Getting 400 response when the plugin attempts to login

Describe Your Problem:
I just upgraded and am now getting a 400 error in the logs when the plugin loads. The vacuums aren't getting added.

Logs:

[2/15/2024, 7:43:16 AM] [WyzeRoboVac] error: Command failed: python3 /volume1/homebridge/node_modules/homebridge-wyze-robovac/py_helpers/getVacuumDeviceList.py [redacted email] [redacted password] [redacted api key ID] [redacted api key]
Traceback (most recent call last):
  File "/volume1/homebridge/node_modules/homebridge-wyze-robovac/py_helpers/getVacuumDeviceList.py", line 13, in <module>
    client = Client(email=os.sys.argv[1], password=os.sys.argv[2], key_id=os.sys.argv[3], api_key=os.sys.argv[4])
  File "/var/packages/homebridge/home/.local/lib/python3.8/site-packages/wyze_sdk/api/client.py", line 72, in __init__
    self.login()
  File "/var/packages/homebridge/home/.local/lib/python3.8/site-packages/wyze_sdk/api/client.py", line 184, in login
    response = self._auth_client().user_login(
  File "/var/packages/homebridge/home/.local/lib/python3.8/site-packages/wyze_sdk/service/auth_service.py", line 88, in user_login
    response = self.api_call(
  File "/var/packages/homebridge/home/.local/lib/python3.8/site-packages/wyze_sdk/service/auth_service.py", line 58, in api_call
    return super().api_call(
  File "/var/packages/homebridge/home/.local/lib/python3.8/site-packages/wyze_sdk/service/base.py", line 347, in api_call
    return super().api_call(
  File "/var/packages/homebridge/home/.local/lib/python3.8/site-packages/wyze_sdk/service/base.py", line 204, in api_call
    return self.do_post(url=api_url, headers=headers, payload=json, params=params)
  File "/var/packages/homebridge/home/.local/lib/python3.8/site-packages/wyze_sdk/service/base.py", line 132, in do_post
    return self._do_request(client, req)
  File "/var/packages/homebridge/home/.local/lib/python3.8/site-packages/wyze_sdk/service/base.py", line 106, in _do_request
    raise err
  File "/var/packages/homebridge/home/.local/lib/python3.8/site-packages/wyze_sdk/service/base.py", line 93, in _do_request
    response.raise_for_status()
  File "/usr/lib/python3.8/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://auth-prod.api.wyze.com/api/user/login

Plugin Config:

{
    "name": "WyzeRoboVac",
    "username": "[redacted]",
    "password": "[redacted]",
    "key_id": "[redacted]",
    "api_key": "[redacted]",
    "mfaCode": "[redacted]",
    "statusCheckRefreshInterval": 30,
    "idleBatteryCheckRefreshInterval": 1800,
    "busyBatteryCheckRefreshInterval": 120,
    "path2py_stubs": "/volume1/homebridge/node_modules/homebridge-wyze-robovac/py_helpers",
    "debugLevel": 1,
    "platform": "WyzeRoboVac"
}

Screenshots:

Environment:

  • Plugin Version: v1.5.1
  • Homebridge Version: v1.7.0
  • Node.js Version: v20
  • NPM Version: 10.1.0
  • Operating System: Sysology NAS

Error: Command failed

Please take a look at the logs

[9/3/2023, 11:29:15 AM] [WyzeRoboVac] Starting to sweep room 'Bedroom:Bedroom'(Vacuum)
[9/3/2023, 11:29:17 AM] [WyzeRoboVac] error: Command failed: python3 /homebridge/node_modules/homebridge-wyze-robovac/py_helpers/vacuumStartSweep.py [email protected] PASS  API_ID API_KEY 'Vacuum' 'Bedroom'
Traceback (most recent call last):
  File "/homebridge/node_modules/homebridge-wyze-robovac/py_helpers/vacuumStartSweep.py", line 54, in <module>
    for room in vacuum.current_map.rooms:
  File "/usr/local/lib/python3.8/dist-packages/wyze_sdk/models/devices/vacuums.py", line 703, in rooms
    return [VacuumMapRoom(**room) for room in map_data['12']]
  File "/usr/local/lib/python3.8/dist-packages/wyze_sdk/models/devices/vacuums.py", line 703, in <listcomp>
    return [VacuumMapRoom(**room) for room in map_data['12']]
TypeError: ABCMeta object argument after ** must be a mapping, not str

Plugin is generating HTTP 400's when hitting https://auth-prod.api.wyze.com/user/login

Describe The Bug:

It appears that the plugin is hitting a non-existent endpoint:

requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://auth-prod.api.wyze.com/user/login

CleanShot 2023-04-18 at 16 51 12

Expected behavior:

The error shouldn't be produced?

Logs:

[4/18/2023, 8:50:32 PM] [WyzeRoboVac] error: Command failed: python3 /usr/lib/node_modules/homebridge-wyze-robovac/py_helpers/getVacuumDeviceList.py XXXXXXXXXXXXX
Traceback (most recent call last):
  File "/usr/lib/node_modules/homebridge-wyze-robovac/py_helpers/getVacuumDeviceList.py", line 13, in <module>
    client = Client(email=sys.argv[1], password=os.sys.argv[2])
  File "/usr/local/lib/python3.10/dist-packages/wyze_sdk/api/client.py", line 66, in __init__
    self.login()
  File "/usr/local/lib/python3.10/dist-packages/wyze_sdk/api/client.py", line 164, in login
    response = self._auth_client().user_login(email=self._email, password=self._password, totp_key=self._totp_key)
  File "/usr/local/lib/python3.10/dist-packages/wyze_sdk/service/auth_service.py", line 75, in user_login
    response = self.api_call('/user/login', json=kwargs, nonce=nonce)
  File "/usr/local/lib/python3.10/dist-packages/wyze_sdk/service/auth_service.py", line 56, in api_call
    return super().api_call(
  File "/usr/local/lib/python3.10/dist-packages/wyze_sdk/service/base.py", line 347, in api_call
    return super().api_call(
  File "/usr/local/lib/python3.10/dist-packages/wyze_sdk/service/base.py", line 204, in api_call
    return self.do_post(url=api_url, headers=headers, payload=json, params=params)
  File "/usr/local/lib/python3.10/dist-packages/wyze_sdk/service/base.py", line 132, in do_post
    return self._do_request(client, req)
  File "/usr/local/lib/python3.10/dist-packages/wyze_sdk/service/base.py", line 106, in _do_request
    raise err
  File "/usr/local/lib/python3.10/dist-packages/wyze_sdk/service/base.py", line 93, in _do_request
    response.raise_for_status()
  File "/usr/lib/python3/dist-packages/requests/models.py", line 943, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://auth-prod.api.wyze.com/user/login

Plugin Config:

        {
            "name": "WyzeRoboVac",
            "username": "XXXXXXXX",
            "password": "XXXXXXXX",
            "mfaCode": "XXXXXXXX",
            "statusCheckRefreshInterval": 30,
            "idleBatteryCheckRefreshInterval": 1800,
            "busyBatteryCheckRefreshInterval": 120,
            "path2py_stubs": "/usr/lib/node_modules/homebridge-wyze-robovac/py_helpers",
            "debugLevel": 1,
            "platform": "WyzeRoboVac"
        },

Environment:

  • Plugin Version:
  • Homebridge Version: 1.6.0
  • Node.js Version: 18.16.0
  • NPM Version: 9.5.1
  • Operating System: Ubuntu 22.04

Invalid Syntax error

Describe The Bug:
The plugin never starts because it says there's a syntax error. The weird thing is that if I execute the line that's failing, it gives me my vacuum name without a problem.

Logs:

error: Command failed: python3 /usr/lib/node_modules/homebridge-wyze-robovac/py_helpers/getVacuumDeviceList.py [email] [password]
  File "/usr/lib/node_modules/homebridge-wyze-robovac/py_helpers/getVacuumDeviceList.py", line 10
    print(f"USAGE: {sys.argv[0]} wyze_email wyze_password")
                                                         ^
SyntaxError: invalid syntax

Environment:

  • Plugin Version: 1.2.1
  • Homebridge Version: 1.4.1
    • Python Version: 3.8.6
  • Node.js Version: 12.18.4
  • NPM Version: 6.14.8
  • Operating System: Raspbian

Username / Password invalid

Describe Your Problem:
Unable to log in using basic login and password. Other Waze plugin (for lights) works perfectly. Using same pair of credentials.
Using Hoobs 4, up to date
Logs:

2/21/2023, 7:46:04 PMwyzerobovacbridge stopping
2/21/2023, 7:46:10 PMWyze Robovac Bridge starting
2/21/2023, 7:46:13 PMWyze Robovac BridgeLoaded plugin 'homebridge-wyze-robovac'
2/21/2023, 7:46:13 PMWyze Robovac BridgeLoading 2 platforms...
2/21/2023, 7:46:13 PMWyze Robovac BridgeWyzeRoboVacERRORINVALID CONFIGURATION FOR PLUGIN: homebridge-wyze-robovac
2/21/2023, 7:46:13 PMWyze Robovac BridgeWyzeRoboVacERRORname, username and/or password not set. Plugin not started.
2/21/2023, 7:46:13 PMWyze Robovac BridgeBridge is running on port 51846.

Plugin Config:
{
"platform": "WyzeRoboVac1",
"name": "WyzeRoboVac1",
"username": "[email protected]",
"password": "PASSWORD",
"refreshInterval": 30000,
"path2py_stubs": "/usr/lib/node_modules/homebridge-wyze-robovac/py_helpers"
}

Screenshots:

Environment:

  • Plugin Version: 1.2.1
  • Homebridge Version: 1.6.0
  • Node.js Version: 16.19.1
  • NPM Version: 8.19.3
  • Operating System: Raspbian

statusCheckRefreshInterval not working

statusCheckRefreshInterval does not seem to be working. My robovac has been done for over 3 minutes and the switch is still active.

This is a fresh install, only thing i did was change the path to this /homebridge/node_modules/homebridge-wyze-robovac/py_helpers

from the logs

[1/5/2023, 9:24:03 PM] [WyzeRoboVac] in setInterval(), this.currentStatus = 'VacuumMode.FINISHED_RETURNING_TO_CHARGE'
[1/5/2023, 9:24:33 PM] [WyzeRoboVac] in setInterval(), this.currentStatus = 'VacuumMode.IDLE'

[1/5/2023, 9:27:43 PM] [WyzeRoboVac] Room 'Hallway'(WyzeVac): Get Characteristic On -> true

a whole 3 minutes later, its still true.

2FA potential issues?

Describe Your Problem:

I do not have a vaccuum from Wyze but I was interested in using this repo as a basis for extending some other Wyze devices to Homekit. Because of that I have a quick question, does each run of the python script not require a new mfa code and why not? If I run scripts standalone I have to enter a new mfa code each time, is this not the case when executing them from typescript?

Also as far as I can tell you do not currently use the provided mfaCode in your implementation, is this correct and intended?

import wyze_sdk

[2/1/2024, 3:58:33 PM] [WyzeRoboVac] error: Command failed: python3 /usr/local/lib/node_modules/homebridge-wyze-robovac/py_helpers/getVacuumDeviceList.py Traceback (most recent call last): File "/usr/local/lib/node_modules/homebridge-wyze-robovac/py_helpers/getVacuumDeviceList.py", line 4, in <module> import wyze_sdk ModuleNotFoundError: No module named 'wyze_sdk'

Removed personal info.

Getting that error when running the plugin. I installed the wyze sdk by inputting pip install wyze_sdk in the command terminal and I verified that it was installed. I did a restart on my server and computer and the problem still persists.

Node modules not installed?

python3: can't open file '/usr/lib/node_modules/homebridge-wyze-robovac/py_helpers/getVacuumDeviceList.py': [Errno 2] No such file or directory

No devices listed

When the plugin runs the discoverDevices() method. No devices get listed. Running the same exact command inside homebridge terminal, successfully logs my vacuum name.

This is all I as the plugin logs to homebridge
`
[8/22/2022, 11:10:53 AM] [WyzeRoboVac] Launched child bridge with PID 353787

[8/22/2022, 11:10:53 AM] Registering platform 'homebridge-wyze-robovac.WyzeRoboVac'

[8/22/2022, 11:10:53 AM] [WyzeRoboVac] Loaded homebridge-wyze-robovac v1.2.1 child bridge successfully

[8/22/2022, 11:10:54 AM] [WyzeRoboVac] discoverDevices(): username = 'xxxxxx', password = 'xxxx'

[8/22/2022, 11:10:54 AM] Homebridge v1.5.0 (HAP v0.10.2) (WyzeRoboVac) is running on port 45383.
`

‘Unknown device type detected’ stops from polling for other devices?

Describe The Bug:
Not finding my vac. I do get a message about ‘Unknown device type detected’, which is likely my Wyze Air Purifier. Wondering if that stops the poll for other devices.

Saw an old issue about Python error logging, not certain how it applies.

To Reproduce:
Restart Homebridge or Wyze bridge.

Expected behavior:
Wyze vac accessory loaded

Logs:

Show the Homebridge logs here, remove any sensitive information.

[02/05/2023, 08:30:39] [WyzeRoboVac] Restarting child bridge...
[02/05/2023, 08:30:39] Got SIGTERM, shutting down child bridge process...
[02/05/2023, 08:30:45] [WyzeRoboVac] Child bridge process ended
[02/05/2023, 08:30:45] [WyzeRoboVac] Process Ended. Code: 143, Signal: null
[02/05/2023, 08:30:52] [WyzeRoboVac] Restarting Process...
[02/05/2023, 08:30:53] [WyzeRoboVac] Launched child bridge with PID 11126
[02/05/2023, 08:30:53] Registering platform 'homebridge-wyze-robovac.WyzeRoboVac'
[02/05/2023, 08:30:53] [WyzeRoboVac] Loaded homebridge-wyze-robovac v1.2.1 child bridge successfully
[02/05/2023, 08:30:53] Loaded 0 cached accessories from cachedAccessories.0E8621AD9154.
[02/05/2023, 08:30:53] [WyzeRoboVac] discoverDevices(): username = '[deleted]', password = '[deleted]'
[02/05/2023, 08:30:53] Homebridge v1.6.1 (HAP v0.11.1) (WyzeRoboVac) is running on port 45640.
[02/05/2023, 08:30:55] [WyzeRoboVac] stderr: Unknown device type detected ({'mac': 'CO_AP1_7C78B2CA5F58', 'first_activation_ts': 1682970096000, 'first_binding_ts': 1682970096000, 'enr': 'enr_place_holder', 'nickname': 'Post Office', 'timezone_name': 'America/New_York', 'product_model': 'CO_AP1', 'product_model_logo_url': '', 'product_type': 'Common', 'hardware_ver': '0.0.0.0', 'firmware_ver': '1.0.10', 'user_role': 1, 'binding_user_nickname': '[deleted]', 'conn_state': 1, 'conn_state_ts': 1682970852986, 'push_switch': 1, 'device_params': {}, 'is_in_auto': 0, 'event_master_switch': 1, 'parent_device_mac': '', 'parent_device_enr': '', 'binding_ts': 1682970096000, 'timezone_gmt_offset': -4.0})

Plugin Config:

Just the Wyze section

 {
            "name": "WyzeRoboVac",
            "username": "[deleted]",
            "password": "[deleted]",
            "statusCheckRefreshInterval": 30,
            "idleBatteryCheckRefreshInterval": 1800,
            "busyBatteryCheckRefreshInterval": 120,
            "path2py_stubs": "/var/lib/homebridge/node_modules/homebridge-wyze-robovac/py_helpers",
            "debugLevel": 1,
            "_bridge": {
                "username": "0E:86:21:AD:91:54",
                "port": 45640
            },
            "platform": "WyzeRoboVac"
        }

Screenshots:

Environment:

  • Plugin Version:
  • Homebridge Version: 1.61
  • Node.js Version: 18.13
  • NPM Version:
  • Operating System: Debian on Raspberery Pi

Missing file after installation of the plugin

Describe The Bug:
Receiving the following error after installation:

/opt/homebrew/bin/python3: can't open file '/usr/lib/node_modules/homebridge-wyze-robovac/py_helpers/getVacuumDeviceList.py': [Errno 2] No such file or directory

To Reproduce:
Installed the plugin. Re-started. Error shows up. No devices listed.

Expected behavior:

Logs:

Show the Homebridge logs here, remove any sensitive information.

Plugin Config:

Show your Homebridge config.json here, remove any sensitive information.

Screenshots:

Environment:

  • Plugin Version:
  • Homebridge Version:
  • Node.js Version:
  • NPM Version:
  • Operating System:

Username / Password invalid

Describe Your Problem:
Unable to log in using basic login and password. Other Waze plugin (for lights) works perfectly. Using same pair of credentials.
Using Hoobs 4, up to date
Logs:

2/21/2023, 7:46:04 PMwyzerobovacbridge stopping
2/21/2023, 7:46:10 PMWyze Robovac Bridge starting
2/21/2023, 7:46:13 PMWyze Robovac BridgeLoaded plugin 'homebridge-wyze-robovac'
2/21/2023, 7:46:13 PMWyze Robovac BridgeLoading 2 platforms...
2/21/2023, 7:46:13 PMWyze Robovac BridgeWyzeRoboVacERRORINVALID CONFIGURATION FOR PLUGIN: homebridge-wyze-robovac
2/21/2023, 7:46:13 PMWyze Robovac BridgeWyzeRoboVacERRORname, username and/or password not set. Plugin not started.
2/21/2023, 7:46:13 PMWyze Robovac BridgeBridge is running on port 51846.

Plugin Config:
{
"platform": "WyzeRoboVac1",
"name": "WyzeRoboVac1",
"username": "[email protected]",
"password": "PASSWORD",
"refreshInterval": 30000,
"path2py_stubs": "/usr/lib/node_modules/homebridge-wyze-robovac/py_helpers"
}

Screenshots:

Environment:

  • Plugin Version: 1.2.1
  • Homebridge Version: 1.6.0
  • Node.js Version: 16.19.1
  • NPM Version: 8.19.3
  • Operating System: Raspbian

getVacuumDeviceList.py no such file or directory

Describe Your Problem:

Just trying to get things to work at all. When I enter the Homebridge terminal, there's not even a node_modules folder in the /usr/lib directory, so I'm assuming I've missed some setup step maybe?

Logs:

[WyzeRoboVac] error: Command failed: python3 /usr/lib/node_modules/homebridge-wyze-robovac/py_helpers/getVacuumDeviceList.py ***********@gmail.com *********
python3: can't open file '/usr/lib/node_modules/homebridge-wyze-robovac/py_helpers/getVacuumDeviceList.py': [Errno 2] No such file or directory

Plugin Config:
I suspect it has to do with the path2py_stubs path since it's not able to find it.

{
    "name": "WyzeRoboVac",
    "username": "***********@gmail.com",
    "password": "**********",
    "statusCheckRefreshInterval": 30,
    "idleBatteryCheckRefreshInterval": 1800,
    "busyBatteryCheckRefreshInterval": 120,
    "path2py_stubs": "/usr/lib/node_modules/homebridge-wyze-robovac/py_helpers",
    "debugLevel": 0,
    "platform": "WyzeRoboVac",
    "_bridge": {
        "username": "***",
        "port": 45277
    }
}

Screenshots:

Environment:
Not sure what this means, sorry 😕

  • Plugin Version: 1.2.1
  • Homebridge Version: 1.6.0
  • Node.js Version: 16.16.0
  • NPM Version: 8.11.0
  • Operating System: Synology DSM 7

Error when vacuuming all rooms

Describe Your Problem:
When choosing to vacuum all rooms or just one room, the vacuum doesn't start up.

Logs:

`[2/1/2024, 6:08:00 PM] [WyzeRoboVac] error: Command failed: python3 /usr/local/lib/node_modules/homebridge-wyze-robovac/py_helpers/getVacuumStatus.py 'Vacuum'
Traceback (most recent call last):
File "/usr/local/lib/node_modules/homebridge-wyze-robovac/py_helpers/getVacuumStatus.py", line 15, in
client = Client(email=os.sys.argv[1], password=os.sys.argv[2], key_id=os.sys.argv[3], api_key=os.sys.argv[4])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wyze_sdk/api/client.py", line 73, in init
self.login()
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wyze_sdk/api/client.py", line 185, in login
response = self._auth_client().user_login(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wyze_sdk/service/auth_service.py", line 88, in user_login
response = self.api_call(
^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wyze_sdk/service/auth_service.py", line 58, in api_call
return super().api_call(
^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wyze_sdk/service/base.py", line 347, in api_call
return super().api_call(
^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wyze_sdk/service/base.py", line 204, in api_call
return self.do_post(url=api_url, headers=headers, payload=json, params=params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wyze_sdk/service/base.py", line 132, in do_post
return self._do_request(client, req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wyze_sdk/service/base.py", line 106, in _do_request
raise err
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wyze_sdk/service/base.py", line 93, in _do_request
response.raise_for_status()
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/requests/models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 429 Client Error: Too Many Requests for url: https://auth-prod.api.wyze.com/api/user/login

[2/1/2024, 6:08:15 PM] [WyzeRoboVac] error: Command failed: python3 /usr/local/lib/node_modules/homebridge-wyze-robovac/py_helpers/getVacuumStatus.py 'Vacuum'
Traceback (most recent call last):
File "/usr/local/lib/node_modules/homebridge-wyze-robovac/py_helpers/getVacuumStatus.py", line 15, in
client = Client(email=os.sys.argv[1], password=os.sys.argv[2], key_id=os.sys.argv[3], api_key=os.sys.argv[4])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wyze_sdk/api/client.py", line 73, in init
self.login()
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wyze_sdk/api/client.py", line 185, in login
response = self._auth_client().user_login(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wyze_sdk/service/auth_service.py", line 88, in user_login
response = self.api_call(
^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wyze_sdk/service/auth_service.py", line 58, in api_call
return super().api_call(
^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wyze_sdk/service/base.py", line 347, in api_call
return super().api_call(
^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wyze_sdk/service/base.py", line 204, in api_call
return self.do_post(url=api_url, headers=headers, payload=json, params=params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wyze_sdk/service/base.py", line 132, in do_post
return self._do_request(client, req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wyze_sdk/service/base.py", line 106, in _do_request
raise err
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wyze_sdk/service/base.py", line 93, in _do_request
response.raise_for_status()
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/requests/models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 429 Client Error: Too Many Requests for url: https://auth-prod.api.wyze.com/api/user/login

[2/1/2024, 6:08:30 PM] [WyzeRoboVac] error: Command failed: python3 /usr/local/lib/node_modules/homebridge-wyze-robovac/py_helpers/getVacuumStatus.py 'Vacuum'
Traceback (most recent call last):
File "/usr/local/lib/node_modules/homebridge-wyze-robovac/py_helpers/getVacuumStatus.py", line 15, in
client = Client(email=os.sys.argv[1], password=os.sys.argv[2], key_id=os.sys.argv[3], api_key=os.sys.argv[4])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wyze_sdk/api/client.py", line 73, in init
self.login()
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wyze_sdk/api/client.py", line 185, in login
response = self._auth_client().user_login(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wyze_sdk/service/auth_service.py", line 88, in user_login
response = self.api_call(
^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wyze_sdk/service/auth_service.py", line 58, in api_call
return super().api_call(
^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wyze_sdk/service/base.py", line 347, in api_call
return super().api_call(
^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wyze_sdk/service/base.py", line 204, in api_call
return self.do_post(url=api_url, headers=headers, payload=json, params=params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wyze_sdk/service/base.py", line 132, in do_post
return self._do_request(client, req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wyze_sdk/service/base.py", line 106, in _do_request
raise err
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wyze_sdk/service/base.py", line 93, in _do_request
response.raise_for_status()
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/requests/models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 429 Client Error: Too Many Requests for url: https://auth-prod.api.wyze.com/api/user/login

[2/1/2024, 6:08:45 PM] [WyzeRoboVac] error: Command failed: python3 /usr/local/lib/node_modules/homebrid`

My email and password are right, and I copy and pasted the Key ID and API Key straight from the Wyze portal.

Plugin Config:

{ "name": "WyzeRoboVac", "username": "", "password": "", "key_id": "", "api_key": "", "statusCheckRefreshInterval": 15, "idleBatteryCheckRefreshInterval": 751, "busyBatteryCheckRefreshInterval": 120, "path2py_stubs": "/usr/local/lib/node_modules/homebridge-wyze-robovac/py_helpers", "debugLevel": 0, "_bridge": { "username": "0E:7C:48:A3:67:15", "port": 46277 }, "platform": "WyzeRoboVac" }

Environment:

  • Plugin Version: V1.5.1
  • Homebridge Version: V1.7.0
  • Node.js Version: V20.11.0
  • NPM Version: Not sure, should be the latest
  • Operating System: macOS Sonoma 14.3

Unsupported Devices Trigger STDOut on python getVacuumDevices

Describe The Bug:

see title
To Reproduce:

Have a leak sensor, client instanciation will trigger STD out. where its piped into the javascript runtime it short circuits and breaks
Expected behavior:

Dont check stderr, scream really loud, reassign to std out for inter package communication.
Logs:

[30/11/2022, 21:08:17] [WyzeRoboVac] stderr: Unknown device type detected ({'mac': '79E68BD8', 'first_activation_ts': 1669737831000, 'first_binding_ts': 1669737832000, 'enr': 'j6vs7k0JdufBj3et', 'nickname': 'Sump Pump', 'timezone_name': 'America/Los_Angeles', 'product_model': 'WS3U', 'product_model_logo_url': 'https://wyze-file.s3.us-west-2.amazonaws.com/system-logo/device/small/wyze_icon_device_water_sensor.png', 'product_type': 'LeakSensor', 'hardware_ver': '0.0.0.0', 'firmware_ver': '0.0.0.11', 'user_role': 1, 'binding_user_nickna

not showing rest of info because its irrelevant and PII. Could solve 2 ways. one with reassigning stderr with context manager when client is called (error logs happening in external library) or checking std out for context (much more brittle). Would submit PR but only have work laptops :/)

Moving Away from Connected Home

Hi @RMCob ,

I was wondering why you decided to start using the python library for Wyze API calls instead of the functionality already present in your Wyze-connected-home repo? Is there a specific reason for not using the existing infrastructure in that repo? Thanks!

Error: command failed

Describe The Bug:
Just getting it set up and I am running into this error:

[WyzeRoboVac] error: Command failed: python3 /usr/lib/node_modules/homebridge-wyze-robovac/py_helpers/getVacuumRoomList.py [myemail] [mypassword] Home Vacuum
USAGE: /usr/lib/node_modules/homebridge-wyze-robovac/py_helpers/getVacuumRoomList.py wyze_email wyze_password robovac_nickname

To Reproduce:
Enter credentials for Wyze and restart HomeBridge.

Expected behavior:
Automatically load Wyze devices into HomeBridge

Logs:

[WyzeRoboVac] error: Command failed: python3 /usr/lib/node_modules/homebridge-wyze-robovac/py_helpers/getVacuumRoomList.py [myemail] [mypassword] Home Vacuum
USAGE: /usr/lib/node_modules/homebridge-wyze-robovac/py_helpers/getVacuumRoomList.py wyze_email wyze_password robovac_nickname

Plugin Config:

{
"name": "WyzeRoboVac",
"username": "myemail",
"password": "my password",
"statusCheckRefreshInterval": 30,
"idleBatteryCheckRefreshInterval": 1800,
"busyBatteryCheckRefreshInterval": 120,
"path2py_stubs": "/usr/lib/node_modules/homebridge-wyze-robovac/py_helpers",
"debugLevel": 0,
"platform": "WyzeRoboVac"
}

Environment:

  • Plugin Version: 1.2.1
  • Homebridge Version: 1.4.0
  • Node.js Version: v16.14.2
  • NPM Version: v8.5.0
  • Operating System: Ubuntu

As of July 2023, users must provide an api key and key id to create an access token.

Describe The Bug:
Unable to connect to wyze.com

To Reproduce:
start home bridge, first connection to wyze. getVaccuumDeviceList method.

Expected behavior:
Connection and authentication successful.

Logs:

Traceback (most recent call last):
  File "/usr/local/lib/node_modules/homebridge-wyze-robovac/py_helpers/getVacuumDeviceList.py", line 13, in <module>
    client = Client(email=sys.argv[1], password=os.sys.argv[2])
  File "/Users/dbutler/Library/Python/3.9/lib/python/site-packages/wyze_sdk/api/client.py", line 72, in __init__
    self.login()
  File "/Users/dbutler/Library/Python/3.9/lib/python/site-packages/wyze_sdk/api/client.py", line 176, in login
    raise WyzeClientConfigurationError(
wyze_sdk.errors.WyzeClientConfigurationError: Must provide a Wyze API key and id.

As of July 2023, users must provide an api key and key id to create an access token. For more information, please visit https://support.wyze.com/hc/en-us/articles/16129834216731.

Plugin Config:

{
    "name": "WyzeRoboVac",
    "username": "xxxxxx",
    "password": "xxxxxxxx",
    "mfaCode": "781419",
    "statusCheckRefreshInterval": 30,
    "idleBatteryCheckRefreshInterval": 1800,
    "busyBatteryCheckRefreshInterval": 120,
    "path2py_stubs": "/usr/local/lib/node_modules/homebridge-wyze-robovac/py_helpers",
    "debugLevel": 0,
    "platform": "WyzeRoboVac"
}

Screenshots:

Environment:

  • Plugin Version: homebridge-wyze-robovac v1.2.1
  • Homebridge Version: v1.6.1
  • Node.js Version: v16.16.0
  • NPM Version: 8.11.0
  • Operating System: macOS ->

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.