JurajNyiri / HomeAssistant-Tapo-Control

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

Unexpected error fetching Tapo resource status data #506

Closed gateriderz closed 4 months ago

gateriderz commented 5 months ago

Description

Receiving this error message:

This error originated from a custom integration.
Logger: custom_components.tapo_control
Source: helpers/update_coordinator.py:300
Integration: Tapo: Cameras Control (documentation, issues)

Unexpected error fetching Tapo resource status data: 'bool' object is not subscriptable

Reproduction Steps

error in the home assistant core logs

Expected behavior

no errors

If applicable, add error logs.

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 300, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 256, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tapo_control/__init__.py", line 482, in async_update_data
    entity["entity"].updateTapo(
  File "/config/custom_components/tapo_control/sensor.py", line 183, in updateTapo
    self._attr_state = camData["connectionInformation"]["ssid"]
                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
TypeError: 'bool' object is not subscriptable

Device Firmware

1.3.11 Build 231121 Rel.39420n(5553) & 1.3.9 Build 231019 Rel.40264n(5553)

Integration Version

5.4.14

Using stream component

No

Does camera work via official integrations?

Yes

Camera has all attributes filled out in developer tools

Yes

HASS Environment

HassOS

Search for similar issues

Yes

Additional information

Looks like this was introduced since the last enhancement: https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/issues/502

I have 4 cameras with 2 type of C100 hardware:

Hardware 4.0 Firmware: 1.3.11 Build 231121 Rel.39420n(5553)

Hardware 2.0 Firmware: 1.3.9 Build 231019 Rel.40264n(5553)

JurajNyiri commented 5 months ago

Could you please enable debug logs and post what happens on integration load?

gateriderz commented 5 months ago

Enabled debugging and restarted home assistant, waiting for the error to show up again.

UPDATE with the log file: [sent via email]

Thank you

JurajNyiri commented 5 months ago

The REDACTED information in your logs is important to find out what exactly happens.

The entity is only added if the camData["connectionInformation"]["ssid"] exists and is set, so I need to understand what happens before the error.

Feel free to email me the full log if you feel more comfortable - juraj.nyiri@gmail.com

Thessa commented 5 months ago

Same error: First occurred: 15:11:23 (1 occurrences) Last logged: 15:11:23

Unexpected error fetching Tapo resource status data: 'bool' object is not subscriptable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 300, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 256, in _async_update_data return await self.update_method() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/tapo_control/init.py", line 482, in async_update_data entity["entity"].updateTapo( File "/config/custom_components/tapo_control/sensor.py", line 183, in updateTapo self._attr_state = camData["connectionInformation"]["ssid"]


TypeError: 'bool' object is not subscriptable
JurajNyiri commented 4 months ago

In order to solve this, I will need debug logs enabled when the error message appears, from the start with not redacted data.

Thessa commented 4 months ago

Logger: custom_components.tapo_control Source: helpers/update_coordinator.py:313 Integration: Tapo: Cameras Control (documentation, issues) First occurred: February 9, 2024 at 16:08:09 (23 occurrences) Last logged: 15:19:41 Unexpected error fetching Tapo resource status data: 'bool' object is not subscriptableTraceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 313, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 269, in _async_update_data return await self.update_method() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/tapo_control/init.py", line 482, in async_update_data entity["entity"].updateTapo( File "/config/custom_components/tapo_control/sensor.py", line 183, in updateTapo self._attr_state = camData["connectionInformation"]["ssid"]


TypeError: 'bool' object is not subscriptable

Greetings, met een vriendelijke groet,
 Ben de Boer,

+31 6 53810083

ATTENTION:

The information in this electronic mail message is private and confidential, and only intended for the addressee. Should you receive this message by mistake, you are hereby notified that any disclosure, reproduction, distribution or use of this message is strictly prohibited. Please inform the sender by reply transmission and delete the message without copying or opening it. 

Messages and attachments are scanned for all viruses known. If this message contains password-protected attachments, the files have NOT been scanned for viruses. Always scan attachments before opening them. 

    Op maandag 12 februari 2024 om 06:11:33 GMT schreef Juraj Nyíri ***@***.***>:  

In order to solve this, I will need debug logs enabled when the error message appears, from the start with not redacted data.

—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>

|  | Virus-free.www.avg.com |
joe7045 commented 4 months ago

Hi. Error "Unexpected error fetching Tapo resource status data: 'bool' object is not subscriptable" still present after updating to 5.4.15. Integration is working fine but the undesired message remains..

JurajNyiri commented 4 months ago

I still need full debug logs including the error message in order to fix this.

joe7045 commented 4 months ago

Sent by mail full log. Let me know if you need something else. Thank you in advance for your great job.

ciclocaffe commented 4 months ago

same issue here. can also send log, if needed

JurajNyiri commented 4 months ago

Fixed in https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/releases/tag/5.4.16.

Thessa commented 4 months ago

Thanks! 

Sent from Yahoo Mail on Android

On Mon, 4 Mar 2024 at 13:46, Juraj @.***> wrote:

Fixed in https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/releases/tag/5.4.16.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

joe7045 commented 4 months ago

Thank you very much for your effort. I can confirm that after update to 5.4.16, the error message has gone. As usual, great job

Thessa commented 3 months ago

None (<class 'custom_components.tapo_control.light.TapoWhitelight'>) does not set supported color modes, this will stop working in Home Assistant Core 2025.3, please create a bug report at https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/issues

Greetings, met een vriendelijke groet, Ben de Boer,

+31 6 53810083

ATTENTION:

The information in this electronic mail message is private and confidential, and only intended for the addressee. Should you receive this message by mistake, you are hereby notified that any disclosure, reproduction, distribution or use of this message is strictly prohibited. Please inform the sender by reply transmission and delete the message without copying or opening it.

Messages and attachments are scanned for all viruses known. If this message contains password-protected attachments, the files have NOT been scanned for viruses. Always scan attachments before opening them.

Op maandag 4 maart 2024 om 13:46:23 GMT schreef Juraj Nyíri ***@***.***>:  

Fixed in https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/releases/tag/5.4.16.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

| | Virus-free.www.avg.com |

Thessa commented 3 months ago

Hallo good am FYI None (<class 'custom_components.tapo_control.light.TapoWhitelight'>) does not set supported color modes, this will stop working in Home Assistant Core 2025.3, please create a bug report at https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/issues

ATTENTION:

The information in this electronic mail message is private and confidential, and only intended for the addressee. Should you receive this message by mistake, you are hereby notified that any disclosure, reproduction, distribution or use of this message is strictly prohibited. Please inform the sender by reply transmission and delete the message without copying or opening it.

Messages and attachments are scanned for all viruses known. If this message contains password-protected attachments, the files have NOT been scanned for viruses. Always scan attachments before opening them.

Op maandag 4 maart 2024 om 13:46:23 GMT schreef Juraj Nyíri ***@***.***>:  

Fixed in https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/releases/tag/5.4.16.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>