JurajNyiri / HomeAssistant-Tapo-Control

Control for Tapo cameras as a Home Assistant component
Apache License 2.0
953 stars 80 forks source link

2024.2.2 need to reload integration several times after restart #526

Closed RedNo7 closed 4 months ago

RedNo7 commented 4 months ago

Description

Since 2024.2.2 I have had to reload the integration 2 or even 3 times after restarting before both my (C325WB) cameras are showing correctly.

They are always stable Ince this happens. Sometimes both cameras need reloading, sometimes it is only one that one can change.

I have not modified any settings since installing the integration under 2023.12.x

Reproduction Steps

  1. Restart
  2. Cameras are both OK for a few seconds.
  3. One or both camera become unknown.
  4. Reload the integration for the unknown camera(s)
  5. Maybe it is OK, maybe the other camera now becomes unknown, maybe both are now unknown.
  6. Reload the integration for the unknown camera(s)
  7. Most times, it will now be OK. Sometimes I have to repeat steps 4-6.

Expected behavior

  1. Restart
  2. All cameras are OK.

If applicable, add error logs.

Logs

```log 024-02-24 11:41:06.289 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration tapo_control which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-02-24 11:41:06.293 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration dyson_local which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-02-24 11:41:06.296 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration sun2 which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-02-24 11:41:06.300 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hypervolt_charger which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-02-24 11:41:06.303 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration feedparser which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-02-24 11:41:06.307 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-02-24 11:41:39.238 WARNING (MainThread) [homeassistant.setup] Setup of bluetooth is taking over 10 seconds. 2024-02-24 11:41:54.980 WARNING (MainThread) [homeassistant.setup] Setup of rest is taking over 10 seconds. 2024-02-24 11:41:56.200 ERROR (MainThread) [custom_components.hypervolt_charger] Async_setup_entry exception: 2024-02-24 11:42:14.796 ERROR (MainThread) [custom_components.hypervolt_charger] Async_setup_entry exception: 2024-02-24 11:42:57.263 ERROR (MainThread) [custom_components.tapo_control] Error: -40214, Response: {"error_code": -40214} 2024-02-24 11:43:07.374 ERROR (MainThread) [custom_components.tapo_control] Error: -40214, Response: {"error_code": -40214} 2024-02-24 11:43:23.851 ERROR (MainThread) [homeassistant.helpers.script.tapo_front_camera] Tapo: front camera: Error executing script. Unexpected error for call_service at pos 1: Error: -40214, Response: {"error_code": -40214} Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 485, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 723, in _async_call_service_step response_data = await self._async_run_long_action( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 685, in _async_run_long_action return long_task.result() ^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2279, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2316, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 892, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 962, in _handle_entity_call result = await task ^^^^^^^^^^ File "/config/custom_components/tapo_control/switch.py", line 472, in async_turn_off result = await self._hass.async_add_executor_job( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pytapo/__init__.py", line 1023, in setPrivacyMode return self.executeFunction( ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pytapo/__init__.py", line 491, in executeFunction data = self.performRequest( ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pytapo/__init__.py", line 619, in performRequest raise Exception( Exception: Error: -40214, Response: {"error_code": -40214} 2024-02-24 11:43:23.901 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [548029547200] Error: -40214, Response: {"error_code": -40214} Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 240, in handle_call_service response = await hass.services.async_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2279, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2316, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 892, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 962, in _handle_entity_call result = await task ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/template/switch.py", line 161, in async_turn_on await self.async_run_script(self._on_script, context=self._context) File "/usr/src/homeassistant/homeassistant/components/template/template_entity.py", line 562, in async_run_script await script.async_run( File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1600, in async_run return await asyncio.shield(run.async_run()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 435, in async_run await self._async_step(log_exceptions=False) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 487, in _async_step self._handle_exception( File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 512, in _handle_exception raise exception File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 485, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 723, in _async_call_service_step response_data = await self._async_run_long_action( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 685, in _async_run_long_action return long_task.result() ^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2279, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2316, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 892, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 962, in _handle_entity_call result = await task ^^^^^^^^^^ File "/config/custom_components/tapo_control/switch.py", line 472, in async_turn_off result = await self._hass.async_add_executor_job( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pytapo/__init__.py", line 1023, in setPrivacyMode return self.executeFunction( ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pytapo/__init__.py", line 491, in executeFunction data = self.performRequest( ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pytapo/__init__.py", line 619, in performRequest raise Exception( Exception: Error: -40214, Response: {"error_code": -40214} 2024-02-24 11:43:27.263 ERROR (MainThread) [custom_components.tapo_control] Error: -40214, Response: {"error_code": -40214} 2024-02-24 11:43:37.355 ERROR (MainThread) [custom_components.tapo_control] Error: -40214, Response: {"error_code": -40214} 2024-02-24 11:43:57.272 ERROR (MainThread) [custom_components.tapo_control] Error: -40214, Response: {"error_code": -40214} 2024-02-24 11:44:07.407 ERROR (MainThread) [custom_components.tapo_control] Error: -40214, Response: {"error_code": -40214} 2024-02-24 11:44:27.276 ERROR (MainThread) [custom_components.tapo_control] Error: -40214, Response: {"error_code": -40214} 2024-02-24 11:44:37.388 ERROR (MainThread) [custom_components.tapo_control] Error: -40214, Response: {"error_code": -40214} 2024-02-24 11:44:57.290 ERROR (MainThread) [custom_components.tapo_control] Error: -40214, Response: {"error_code": -40214} 2024-02-24 11:45:07.390 ERROR (MainThread) [custom_components.tapo_control] Error: -40214, Response: {"error_code": -40214} 2024-02-24 11:45:27.273 ERROR (MainThread) [custom_components.tapo_control] Error: -40214, Response: {"error_code": -40214} 2024-02-24 11:45:37.400 ERROR (MainThread) [custom_components.tapo_control] Error: -40214, Response: {"error_code": -40214} 2024-02-24 11:45:57.302 ERROR (MainThread) [custom_components.tapo_control] Error: -40214, Response: {"error_code": -40214} 2024-02-24 11:46:07.410 ERROR (MainThread) [custom_components.tapo_control] Error: -40214, Response: {"error_code": -40214} 2024-02-24 11:46:27.275 ERROR (MainThread) [custom_components.tapo_control] Error: -40214, Response: {"error_code": -40214} 2024-02-24 11:46:37.367 ERROR (MainThread) [custom_components.tapo_control] Error: -40214, Response: {"error_code": -40214} 2024-02-24 11:46:57.296 ERROR (MainThread) [custom_components.tapo_control] Error: -40214, Response: {"error_code": -40214} 2024-02-24 11:47:05.841 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry 192.168.1.213 for camera Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 444, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 460, in async_setup_entry return await component.async_setup_entry(entry) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 183, in async_setup_entry raise ValueError("Config entry has already been setup!") ValueError: Config entry has already been setup! 2024-02-24 11:47:05.878 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry 192.168.1.213 for switch Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 444, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 99, in async_setup_entry return await component.async_setup_entry(entry) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 183, in async_setup_entry raise ValueError("Config entry has already been setup!") ValueError: Config entry has already been setup! 2024-02-24 11:47:05.889 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry 192.168.1.213 for button Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 444, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/button/__init__.py", line 72, in async_setup_entry return await component.async_setup_entry(entry) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 183, in async_setup_entry raise ValueError("Config entry has already been setup!") ValueError: Config entry has already been setup! 2024-02-24 11:47:05.901 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry 192.168.1.213 for light Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 444, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 676, in async_setup_entry return await component.async_setup_entry(entry) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 183, in async_setup_entry raise ValueError("Config entry has already been setup!") ValueError: Config entry has already been setup! 2024-02-24 11:47:05.917 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry 192.168.1.213 for number Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 444, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/number/__init__.py", line 119, in async_setup_entry return await component.async_setup_entry(entry) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 183, in async_setup_entry raise ValueError("Config entry has already been setup!") ValueError: Config entry has already been setup! 2024-02-24 11:47:05.936 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry 192.168.1.213 for select Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 444, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/select/__init__.py", line 109, in async_setup_entry return await component.async_setup_entry(entry) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 183, in async_setup_entry raise ValueError("Config entry has already been setup!") ValueError: Config entry has already been setup! 2024-02-24 11:47:05.948 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry 192.168.1.213 for siren Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 444, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/siren/__init__.py", line 153, in async_setup_entry return await component.async_setup_entry(entry) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 183, in async_setup_entry raise ValueError("Config entry has already been setup!") ValueError: Config entry has already been setup! 2024-02-24 11:47:05.960 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry 192.168.1.213 for update Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 444, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/update/__init__.py", line 122, in async_setup_entry return await component.async_setup_entry(entry) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 183, in async_setup_entry raise ValueError("Config entry has already been setup!") ValueError: Config entry has already been setup! 2024-02-24 11:47:05.973 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry 192.168.1.213 for binary_sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 444, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/binary_sensor/__init__.py", line 238, in async_setup_entry return await component.async_setup_entry(entry) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 183, in async_setup_entry raise ValueError("Config entry has already been setup!") ValueError: Config entry has already been setup! 2024-02-24 11:47:05.983 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry 192.168.1.213 for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 444, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 141, in async_setup_entry return await component.async_setup_entry(entry) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 183, in async_setup_entry raise ValueError("Config entry has already been setup!") ValueError: Config entry has already been setup! ```

Device Firmware

1.1.5 Build 231107

Integration Version

5.4.14

Using stream component

No

Does camera work via official integrations?

N/A

Camera has all attributes filled out in developer tools

Yes

HASS Environment

Docker on DietPi (R-Pi lightweight Debian OS)

Search for similar issues

Yes

Additional information

No response

JurajNyiri commented 4 months ago

Hi, what is the script you are executing? What happens if you leave the camera be and wait? Try to launch it without executing anything and make a screenshot of entities and log.

RedNo7 commented 4 months ago

Hi!

I am not executing any script - sorry if I gave that impression.

If I leave the camera to be and wait, everything is unavailable. This used not to happen. If I reload the integration, it works (maybe after 2 reloads).

JurajNyiri commented 4 months ago
2024-02-24 11:43:23.851 ERROR (MainThread) [homeassistant.helpers.script.tapo_front_camera] Tapo: front camera: Error executing script. Unexpected error for call_service at pos 1: Error: -40214, Response: {"error_code": -40214}

This shows script being executed.

Please provide logs of clean launch and screenshots with no scripts being executed.

RedNo7 commented 4 months ago

This shows script being executed.

Gotcha. That's not actually a script, it's a template switch:

switch:
  - platform: template
    switches:
      tapo_front_camera:
        friendly_name: "Tapo: front camera"
        value_template: "{{ is_state('switch.tapo_front_privacy', 'off') }}"
        turn_on:
          # privacy
          - service: switch.turn_off
            target:
              entity_id: switch.tapo_front_privacy
          # tamper
          - service: select.select_option
            target:
              entity_id: select.tapo_front_tamper_detection
            data:
              option: normal
          # notify
          - service: script.turn_on
            target:
              entity_id: script.tapo_notify_status
        turn_off:
          # tamper
          - service: select.select_option
            target:
              entity_id: select.tapo_front_tamper_detection
            data:
              option: "off"
          # privacy
          - service: switch.turn_on
            target:
              entity_id: switch.tapo_front_privacy
          # notify
          - service: script.turn_on
            target:
              entity_id: script.tapo_notify_status
        icon_template: >-
          {% if is_state('switch.tapo_front_privacy', 'off') %}  mdi:cctv
          {% else %}  mdi:cctv-off
          {% endif %}

It's called by an automation at startup:

automation:
  - alias: "Tapo: Switch off when home"
    id: tapo_on_off
    mode: single
    trigger:
      # someone enters/leaves
      - platform: state
        entity_id: zone.home
      # HA startup
      - platform: homeassistant
        event: start
    action:
      - if:
          # when last person leaves
          - "{{ states('zone.home') == '0' }}"
          # and camera is off
          - condition: state
            entity_id: switch.tapo_camera
            state: "off"
        then:
          # turn camera on
          - service: switch.turn_on
            target:
              entity_id:
                - switch.tapo_front_camera
                - switch.tapo_garage_camera
      - if:
          # when first person arrives
          - "{{ states('zone.home') != '0' }}"
          # and camera is on
          - condition: state
            entity_id: switch.tapo_camera
            state: "on"
        then:
          # turn camera off
          - service: switch.turn_off
            target:
              entity_id:
                - switch.tapo_front_camera
                - switch.tapo_garage_camera

It's been working for for months without alteration.

OK, I have switched that automation off and restarted - same problem (logs below):

2024-02-25 17:23:20.902 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration tapo_control which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-02-25 17:23:20.906 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration dyson_local which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-02-25 17:23:20.908 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration sun2 which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-02-25 17:23:20.910 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hypervolt_charger which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-02-25 17:23:20.911 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration feedparser which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-02-25 17:23:20.913 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-02-25 17:23:47.100 WARNING (MainThread) [homeassistant.setup] Setup of zone is taking over 10 seconds.
2024-02-25 17:23:48.133 WARNING (MainThread) [homeassistant.setup] Setup of rest is taking over 10 seconds.
2024-02-25 17:23:48.503 ERROR (MainThread) [custom_components.hypervolt_charger] Async_setup_entry exception: 
2024-02-25 17:25:13.135 ERROR (MainThread) [custom_components.tapo_control] Error: -40214, Response: {"error_code": -40214}
2024-02-25 17:25:13.198 ERROR (MainThread) [custom_components.tapo_control] Error: -40214, Response: {"error_code": -40214}
2024-02-25 17:25:36.710 ERROR (MainThread) [custom_components.tapo_control] Error: -40214, Response: {"error_code": -40214}
2024-02-25 17:25:36.811 ERROR (MainThread) [custom_components.tapo_control] Error: -40214, Response: {"error_code": -40214}
2024-02-25 17:25:46.807 ERROR (MainThread) [custom_components.tapo_control] Error: -40214, Response: {"error_code": -40214}
2024-02-25 17:25:46.913 ERROR (MainThread) [custom_components.tapo_control] Error: -40214, Response: {"error_code": -40214}

I then stopped my home bridge container and restarted HA - working fine (logs below):

2024-02-25 17:28:04.431 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration tapo_control which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-02-25 17:28:04.433 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration dyson_local which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-02-25 17:28:04.436 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration sun2 which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-02-25 17:28:04.437 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hypervolt_charger which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-02-25 17:28:04.439 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration feedparser which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-02-25 17:28:04.441 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-02-25 17:28:30.602 WARNING (MainThread) [homeassistant.setup] Setup of zone is taking over 10 seconds.
2024-02-25 17:28:30.633 WARNING (MainThread) [homeassistant.setup] Setup of rest is taking over 10 seconds.
2024-02-25 17:28:31.571 ERROR (MainThread) [custom_components.hypervolt_charger] Async_setup_entry exception: 

I then restarted that automation and restarted HA - working fine although there is an warning that I haven't seen before (logs below):

2024-02-25 17:32:03.133 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration tapo_control which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-02-25 17:32:03.135 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration dyson_local which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-02-25 17:32:03.136 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration sun2 which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-02-25 17:32:03.139 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hypervolt_charger which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-02-25 17:32:03.141 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration feedparser which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-02-25 17:32:03.142 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-02-25 17:32:27.183 WARNING (MainThread) [homeassistant.setup] Setup of timer is taking over 10 seconds.
2024-02-25 17:32:27.183 WARNING (MainThread) [homeassistant.setup] Setup of input_boolean is taking over 10 seconds.
2024-02-25 17:32:28.588 WARNING (MainThread) [homeassistant.setup] Setup of zone is taking over 10 seconds.
2024-02-25 17:32:28.589 WARNING (MainThread) [homeassistant.setup] Setup of rest is taking over 10 seconds.
2024-02-25 17:32:28.609 ERROR (MainThread) [custom_components.hypervolt_charger] Async_setup_entry exception: 
2024-02-25 17:32:38.902 WARNING (MainThread) [homeassistant.helpers.script] Error in 'if[1]' evaluation: In 'state':
  In 'state' condition: unknown entity switch.tapo_camera
2024-02-25 17:32:48.882 ERROR (MainThread) [custom_components.hypervolt_charger] Async_setup_entry exception: 

I had forgotten that I only recently added homebridge (with a Tapo-bridge) - I was trying to get the camera feed through to Apple HomeKit without burdening HA. Sorry that I didn't spot that myself.

I guess there may be a conflict with this integration and homebridge?

RedNo7 commented 4 months ago

it's just happened again - this time ~15 hrs after restart...

2024-02-25 17:40:12.633 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration tapo_control which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-02-25 17:40:12.635 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration dyson_local which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-02-25 17:40:12.637 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration sun2 which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-02-25 17:40:12.639 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hypervolt_charger which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-02-25 17:40:12.641 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration feedparser which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-02-25 17:40:12.643 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-02-25 17:40:38.060 WARNING (MainThread) [homeassistant.setup] Setup of input_boolean is taking over 10 seconds.
2024-02-25 17:40:38.061 WARNING (MainThread) [homeassistant.setup] Setup of zone is taking over 10 seconds.
2024-02-25 17:40:38.061 WARNING (MainThread) [homeassistant.setup] Setup of timer is taking over 10 seconds.
2024-02-25 17:40:38.129 WARNING (MainThread) [homeassistant.setup] Setup of input_select is taking over 10 seconds.
2024-02-25 17:40:38.129 WARNING (MainThread) [homeassistant.setup] Setup of input_button is taking over 10 seconds.
2024-02-25 17:40:39.616 WARNING (MainThread) [homeassistant.setup] Setup of rest is taking over 10 seconds.
2024-02-25 17:40:39.825 ERROR (MainThread) [custom_components.hypervolt_charger] Async_setup_entry exception:
2024-02-26 08:15:18.800 ERROR (MainThread) [custom_components.tapo_control] HTTPSConnectionPool(host='192.168.1.206', port=443): Max retries exceeded with url: /stok=jm8S3nxW*Gp0WvMD3DKf0~k3foW3M*2Q/ds (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f6857bbf0>: Failed to establish a new connection: [Errno 111] Connection refused'))
2024-02-26 08:15:28.822 ERROR (MainThread) [custom_components.tapo_control] HTTPSConnectionPool(host='192.168.1.206', port=443): Max retries exceeded with url: /stok=jm8S3nxW*Gp0WvMD3DKf0~k3foW3M*2Q/ds (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f7610dd30>: Failed to establish a new connection: [Errno 111] Connection refused'))
2024-02-26 08:15:48.801 ERROR (MainThread) [custom_components.tapo_control] HTTPSConnectionPool(host='192.168.1.206', port=443): Max retries exceeded with url: /stok=jm8S3nxW*Gp0WvMD3DKf0~k3foW3M*2Q/ds (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f8c729bb0>: Failed to establish a new connection: [Errno 111] Connection refused'))
2024-02-26 08:15:58.820 ERROR (MainThread) [custom_components.tapo_control] HTTPSConnectionPool(host='192.168.1.206', port=443): Max retries exceeded with url: /stok=jm8S3nxW*Gp0WvMD3DKf0~k3foW3M*2Q/ds (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f6258b6e0>: Failed to establish a new connection: [Errno 111] Connection refused'))
2024-02-26 08:16:18.801 ERROR (MainThread) [custom_components.tapo_control] HTTPSConnectionPool(host='192.168.1.206', port=443): Max retries exceeded with url: /stok=jm8S3nxW*Gp0WvMD3DKf0~k3foW3M*2Q/ds (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f68025e50>: Failed to establish a new connection: [Errno 111] Connection refused'))
2024-02-26 08:16:28.986 ERROR (MainThread) [custom_components.tapo_control] HTTPSConnectionPool(host='192.168.1.206', port=443): Max retries exceeded with url: /stok=jm8S3nxW*Gp0WvMD3DKf0~k3foW3M*2Q/ds (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f7608aae0>: Failed to establish a new connection: [Errno 111] Connection refused'))
2024-02-26 08:16:48.797 ERROR (MainThread) [custom_components.tapo_control] HTTPSConnectionPool(host='192.168.1.206', port=443): Max retries exceeded with url: /stok=jm8S3nxW*Gp0WvMD3DKf0~k3foW3M*2Q/ds (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f745ae6f0>: Failed to establish a new connection: [Errno 111] Connection refused'))

...but it did fix itself after a few minutes.

JurajNyiri commented 4 months ago

These logs and the information about Tapo-bridge make more sense, Connection refused means the camera refused connection. It might be overloaded by too many services hitting it, or show network issues. See FAQ for more information about that in this readme.

This is an issue of too many requests going off to camera, unfortunately there is nothing to fix here. I recommend using camera only in one service (HA) and then proxying the streams to other any services as needed (look into go2rtc/webrtc for stream).