home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.11k stars 29.79k forks source link

Smarttub errors and all Smarttub entities unavailable #48958

Closed PacmanR closed 3 years ago

PacmanR commented 3 years ago

The problem

I've tried to use the Smarttub integration since it was released last month and was hoping for bug fixes in the 2021.4.1 release. Unfortunately, it still doesn't work for me. It IS connecting to the service as it correctly identifies my hot tub model. All entities show up as unavailable.
Capture

What is version of Home Assistant Core has the issue?

2021.4.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

smarttub

Link to integration documentation on our website

https://www.home-assistant.io/integrations/smarttub

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.binary_sensor
Source: components/smarttub/binary_sensor.py:31
Integration: Binary sensor (documentation, issues)
First occurred: 9:28:43 AM (2 occurrences)
Last logged: 11:57:03 AM

Error while setting up smarttub platform for binary_sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 205, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/src/homeassistant/homeassistant/components/smarttub/binary_sensor.py", line 31, in async_setup_entry
    for reminder in controller.coordinator.data[spa.id][ATTR_REMINDERS].values()
TypeError: 'NoneType' object is not subscriptable

Logger: homeassistant.components.light
Source: components/smarttub/light.py:36
Integration: Light (documentation, issues)
First occurred: 9:28:43 AM (2 occurrences)
Last logged: 11:57:03 AM

Error while setting up smarttub platform for light
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 205, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/src/homeassistant/homeassistant/components/smarttub/light.py", line 33, in async_setup_entry
    entities = [
  File "/usr/src/homeassistant/homeassistant/components/smarttub/light.py", line 36, in <listcomp>
    for light in controller.coordinator.data[spa.id][ATTR_LIGHTS].values()
TypeError: 'NoneType' object is not subscriptable

Logger: homeassistant.components.switch
Source: components/smarttub/switch.py:24
Integration: Switch (documentation, issues)
First occurred: 9:28:43 AM (2 occurrences)
Last logged: 11:57:03 AM

Error while setting up smarttub platform for switch
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 205, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/src/homeassistant/homeassistant/components/smarttub/switch.py", line 21, in async_setup_entry
    entities = [
  File "/usr/src/homeassistant/homeassistant/components/smarttub/switch.py", line 24, in <listcomp>
    for pump in controller.coordinator.data[spa.id][ATTR_PUMPS].values()
TypeError: 'NoneType' object is not subscriptable

Logger: homeassistant.components.smarttub.controller
Source: components/smarttub/controller.py:97
Integration: SmartTub (documentation, issues)
First occurred: 9:28:43 AM (37 occurrences)
Last logged: 12:08:03 PM

Unexpected error fetching smarttub data: 'BLOWER'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 173, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 143, in _async_update_data
    return await self.update_method()
  File "/usr/src/homeassistant/homeassistant/components/smarttub/controller.py", line 90, in async_update_data
    data[spa.id] = await self._get_spa_data(spa)
  File "/usr/src/homeassistant/homeassistant/components/smarttub/controller.py", line 97, in _get_spa_data
    status, pumps, lights, reminders = await asyncio.gather(
  File "/usr/local/lib/python3.8/site-packages/smarttub/api.py", line 182, in get_pumps
    return [
  File "/usr/local/lib/python3.8/site-packages/smarttub/api.py", line 183, in <listcomp>
    SpaPump(self, **pump_info)
  File "/usr/local/lib/python3.8/site-packages/smarttub/api.py", line 392, in __init__
    self.type = self.PumpType[properties["type"]]
  File "/usr/local/lib/python3.8/enum.py", line 387, in __getitem__
    return cls._member_map_[name]
KeyError: 'BLOWER'
probot-home-assistant[bot] commented 3 years ago

Hey there @mdz, mind taking a look at this issue as its been labeled with an integration (smarttub) you are listed as a codeowner for? Thanks! (message by CodeOwnersMention)

mdz commented 3 years ago

Thanks for reporting this issue. The integration has only been tested with a few models, so we need more reports like this to make it robust.

Would you mind running the following command and sharing the output:

python3 -m smarttub -vv -u YOUR_SMARTTUB_EMAIL -p YOUR_SMARTTUB_PASSWORD info --all

That will help me get this fixed up to work for you in a future release.

Note that the debug output will include some sensitive information, such as your name, email address, and an approximate GPS location, which you may want to redact for your privacy. If you prefer, you can send it to me privately at <redacted>

mdz commented 3 years ago

You can try 2021.4.3, it should fix the immediate issue you encountered, but it's entirely possible there are others right behind it. Sending the info dump should provide more insight

maggar commented 3 years ago

Adding more data for a different model (Jacuzzi 355). My smarttub connects and disconnects every 10 minutes or so.

2021-04-27 19:31:50 ERROR (MainThread) [homeassistant.components.smarttub.controller] Unexpected error fetching smarttub data: 'WHITE' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 173, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 143, in _async_update_data return await self.update_method() File "/usr/src/homeassistant/homeassistant/components/smarttub/controller.py", line 90, in async_update_data data[spa.id] = await self._get_spa_data(spa) File "/usr/src/homeassistant/homeassistant/components/smarttub/controller.py", line 97, in _get_spa_data status, pumps, lights, reminders = await asyncio.gather( File "/usr/local/lib/python3.8/site-packages/smarttub/api.py", line 187, in get_lights return [ File "/usr/local/lib/python3.8/site-packages/smarttub/api.py", line 188, in SpaLight(self, **light_info) File "/usr/local/lib/python3.8/site-packages/smarttub/api.py", line 435, in init self.mode = self.LightMode[properties["mode"]] File "/usr/local/lib/python3.8/enum.py", line 387, in getitem return cls._membermap[name] KeyError: 'WHITE'

maggar commented 3 years ago

More issues

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 205, in _async_setup_platform await asyncio.shield(task) File "/usr/src/homeassistant/homeassistant/components/smarttub/switch.py", line 21, in async_setup_entry entities = [ File "/usr/src/homeassistant/homeassistant/components/smarttub/switch.py", line 24, in for pump in controller.coordinator.data[spa.id][ATTR_PUMPS].values() TypeError: 'NoneType' object is not subscriptable

Logger: homeassistant.components.light Source: components/smarttub/light.py:36 Integration: Light (documentation, issues)

Logger: homeassistant.components.binary_sensor Source: components/smarttub/binary_sensor.py:31 Integration: Binary sensor (documentation, issues) First occurred: 7:53:52 PM (1 occurrences) Last logged: 7:53:52 PM

Error while setting up smarttub platform for binary_sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 205, in _async_setup_platform await asyncio.shield(task) File "/usr/src/homeassistant/homeassistant/components/smarttub/binary_sensor.py", line 31, in async_setup_entry for reminder in controller.coordinator.data[spa.id][ATTR_REMINDERS].values() TypeError: 'NoneType' object is not subscriptable

First occurred: 7:53:52 PM (1 occurrences) Last logged: 7:53:52 PM

Error while setting up smarttub platform for light Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 205, in _async_setup_platform await asyncio.shield(task) File "/usr/src/homeassistant/homeassistant/components/smarttub/light.py", line 33, in async_setup_entry entities = [ File "/usr/src/homeassistant/homeassistant/components/smarttub/light.py", line 36, in for light in controller.coordinator.data[spa.id][ATTR_LIGHTS].values() TypeError: 'NoneType' object is not subscriptable

mdz commented 3 years ago

Hi maggar,

Thanks for reporting your findings. Please open a new issue and include which version of Home Assistant you are running

On Tue, Apr 27, 2021 at 7:58 PM maggar @.***> wrote:

More issues

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 205, in _async_setup_platform await asyncio.shield(task) File "/usr/src/homeassistant/homeassistant/components/smarttub/switch.py", line 21, in async_setup_entry entities = [ File "/usr/src/homeassistant/homeassistant/components/smarttub/switch.py", line 24, in for pump in controller.coordinator.data[spa.id][ATTR_PUMPS].values() TypeError: 'NoneType' object is not subscriptable

Logger: homeassistant.components.light Source: components/smarttub/light.py:36 Integration: Light (documentation, issues)

Logger: homeassistant.components.binary_sensor Source: components/smarttub/binary_sensor.py:31 Integration: Binary sensor (documentation, issues) First occurred: 7:53:52 PM (1 occurrences) Last logged: 7:53:52 PM

Error while setting up smarttub platform for binary_sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 205, in _async_setup_platform await asyncio.shield(task) File "/usr/src/homeassistant/homeassistant/components/smarttub/binary_sensor.py", line 31, in async_setup_entry for reminder in controller.coordinator.data[spa.id ][ATTR_REMINDERS].values() TypeError: 'NoneType' object is not subscriptable

First occurred: 7:53:52 PM (1 occurrences) Last logged: 7:53:52 PM

Error while setting up smarttub platform for light Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 205, in _async_setup_platform await asyncio.shield(task) File "/usr/src/homeassistant/homeassistant/components/smarttub/light.py", line 33, in async_setup_entry entities = [ File "/usr/src/homeassistant/homeassistant/components/smarttub/light.py", line 36, in for light in controller.coordinator.data[spa.id][ATTR_LIGHTS].values() TypeError: 'NoneType' object is not subscriptable

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/48958#issuecomment-828104447, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADKVL6BWE36K3OMWFYZRSLTK52WLANCNFSM42VQZPMQ .