oven-lab / tuya_cloud_map_extractor

Tuya cloud vacuum map extractor for Home Assistant
MIT License
29 stars 6 forks source link

[BUG] - Unable to set up Integration: "Your subscription to cloud development plan has expired." #22

Closed daniel-simpson closed 10 months ago

daniel-simpson commented 10 months ago

Describe the bug When trying to set up the integration, I'm getting the following error messages in the logs:

Error 1:

list index out of range
Traceback (most recent call last):
  File "/config/custom_components/tuya_cloud_map_extractor/config_flow.py", line 57, in async_step_user
    headers, image = await validate(self.hass, user_input)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tuya_cloud_map_extractor/config_flow.py", line 214, in validate
    return await hass.async_add_executor_job(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tuya_cloud_map_extractor/tuya_vacuum_map_extractor/main.py", line 131, in get_map
    raise e
  File "/config/custom_components/tuya_cloud_map_extractor/tuya_vacuum_map_extractor/main.py", line 127, in get_map
    map_link = link["result"][0]["map_url"]
               ~~~~~~~~~~~~~~^^^
IndexError: list index out of range

Error 2:

Encountered an error, please include the following data in your github issue: b'eyJyZXN1bHQiOiBbXSwgInN1Y2Nlc3MiOiB0cnVlLCAidCI6IDE3MDU1Mzc3MDM4NzgsICJ0aWQiOiAiN2QzYTM3M2ZiNTk4MTFlZTg0N2Q5Njg1MjAwOGI0ZjQifQ=='

Error 3:

('Request failed - Response: ', {'code': 28841002, 'msg': 'No permissions. Your subscription to cloud development plan has expired.', 'success': False, 't': 1705537620011, 'tid': '4b5914ecb59811eea621de33209ea800'})

May be due to an unsupported vacuum (Kogan G50), but would've expected a different error is the vacuum itself wasn't supported.

To Reproduce Steps to reproduce the behavior:

  1. Precondition: ensure Sweeping Robot Open Service is enabled in Tuya Cloud Service APIs
  2. Open the configuration flow
  3. Use the same Region (Central EU), Client ID and Client Secret as the Tuya Cloud HA integration
  4. Use the device ID shown in Tuya portal (22 character long, seemingly hexadecimal string)
  5. Click on 'Submit'
  6. Navigate to the Home assistant logs
  7. See attached error

Expected behavior The vacuum map being added

Screenshots The following is the list of Service APIs I have enabled for this Tuya Cloud app: image

Version:

Log entry Include the logs here. If possible, enable debug logging.

daniel-simpson commented 10 months ago

Note: it looks like I'm hitting a known error around Tuya Cloud and IoT Core trial subscription. I've opened up the IoT Core option above, and it has shown that my trial has expired. I've since applied to have my trial extended, to see if I can get this set up 🤞

Closing for now, will reopen if I hit related issues once my trial is extended

daniel-simpson commented 10 months ago

Just following this up, once my IoT cloud trial was renewed this error went away.

Unfortunately my vacuum (Kogan G50) isn't supported, as the following result object is returned from the /v1.0/users/sweepers/file/{{device_id}}/realtime-map endpoint (also tested using postman):

{
    "result": [],
    "success": true,
    "t": 1705627940473,
    "tid": "96969c6fb66a11eeb846e2ba4cc47aff"
}

Looks like my Robot Vac returns an empty result (but no error code), so it doesn't seem to be available.