Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C410] intensity value goes out of range #822

Closed
acolombier opened this issue Jan 13, 2025 · 7 comments
Closed

[C410] intensity value goes out of range #822

acolombier opened this issue Jan 13, 2025 · 7 comments
Labels
Help wanted Extra attention is needed

Comments

@acolombier
Copy link

Description

On the C410, the intensity level seems to only be going in the range 1-5, however it seems that the defined range is the project is 1-100 (source). This is leading to error when setting out of bound level value, and make the user experience very poor since only the first 5% of the slider can be used, leading to poor precision.

Reproduction Steps

  • Go to device
  • Locate the Spotlight Intensity setting
  • Adjust the slider

Expected behavior

Intensity level should gradually change through the whole slider range

If applicable, add error logs.

N/A

Device Firmware

1.0.23 Build 241119 Rel.59219n

Integration Version

6.0.1

Using stream component

Yes

Does camera work via official integrations?

N/A

Camera has all attributes filled out in developer tools

Yes

HASS Environment

Docker

Search for similar issues

Yes

Additional information

I'd be glad to add a config setting if you would be happy with this fix, or alternatively we could add a map of device's known range, and default to the current 100 in order not to break any other device

@JurajNyiri
Copy link
Owner

Please post debug logs for C410. If possible we need to implement a fix dynamically.

We need to find out if we already have the information for min-max available in the getMost call (therefore the ask for debug logs). If not, we will need to investigate the traffic going to camera from tapo app and see if there is any method we can use to find this range.

@acolombier
Copy link
Author

acolombier commented Jan 13, 2025

This is the only relevant message, the rest is a spam of ONVIF unavailable (related to #821)

2025-01-13 10:20:10.377 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [281472169876432] Unexpected exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<7 lines>...
    )
    ^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2795, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2838, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1006, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
        hass, entity, func, data, call.context
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1078, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/number/__init__.py", line 122, in async_set_value
    await entity.async_set_native_value(native_value)
  File "/config/custom_components/tapo_control/number.py", line 453, in async_set_native_value
    result = await self._hass.async_add_executor_job(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        self._controller.setWhitelampConfig, False, int(value)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.13/site-packages/pytapo/__init__.py", line 1221, in setWhitelampConfig
    return self.executeFunction(
           ~~~~~~~~~~~~~~~~~~~~^
        "setWhitelampConfig",
        ^^^^^^^^^^^^^^^^^^^^^
        params,
        ^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/pytapo/__init__.py", line 510, in executeFunction
    raise Exception(
    ...<8 lines>...
    )
Exception: Error: Parameter to set does not exist, Response: {"method": "setWhitelampConfig", "result": {}, "error_code": -40101}

@JurajNyiri
Copy link
Owner

I am not looking for errors, I am looking for debug messages. If you enable debug messages you can see the response from the camera. Please post full debug logs here.

@acolombier
Copy link
Author

Here are the logs - do you need me to restart HA after enabling to see handshake/service discovery logs?

@JurajNyiri
Copy link
Owner

JurajNyiri commented Jan 13, 2025

Logs provided are not sufficient. Please post more, it needs to contain log with "getCamData". Usually this happens every update interval, or after restart of HA.

@keredg
Copy link

keredg commented Jan 17, 2025

FYI, I also get an error on the C100 as it only has 5 possible intensity settings too, if you go to 6 or above you get an error.

@JurajNyiri JurajNyiri added the Help wanted Extra attention is needed label Jan 23, 2025
@JurajNyiri
Copy link
Owner

Closing due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants