mdz / python-smarttub

Python API for SmartTub enabled hot tubs
MIT License
6 stars 9 forks source link

KeyError: 'FULL_DYNAMIC_RGB' #4

Closed mdz closed 3 years ago

mdz commented 3 years ago

Reported by @curt7000:

Unexpected error fetching smarttub data: 'FULL_DYNAMIC_RGB'
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/update_coordinator.py", line 149, in async_refresh
self.data = await self._async_update_data()
File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/update_coordinator.py", line 137, in _async_update_data
return await self.update_method()
File "/home/homeassistant/.homeassistant/custom_components/smarttub/controller.py", line 82, in async_update_data
data[spa.id] = await self._get_spa_data(spa)
File "/home/homeassistant/.homeassistant/custom_components/smarttub/controller.py", line 89, in _get_spa_data
status, pumps, lights = await asyncio.gather(
File "/srv/homeassistant/lib/python3.8/site-packages/smarttub/api.py", line 188, in get_lights
return [
File "/srv/homeassistant/lib/python3.8/site-packages/smarttub/api.py", line 189, in
SpaLight(self, **light_info)
File "/srv/homeassistant/lib/python3.8/site-packages/smarttub/api.py", line 403, in init
self.mode = self.LightMode[properties["mode"]]
File "/usr/lib/python3.8/enum.py", line 349, in getitem
return cls.member_map[name]
KeyError: 'FULL_DYNAMIC_RGB'
mdz commented 3 years ago

@curt7000 could you send me a screenshot or something showing which lighting modes your unit supports? Prior to this report, the only ones I knew about were: PURPLE ORANGE RED YELLOW GREEN AQUA BLUE HIGH_SPEED_COLOR_WHEEL OFF.

I'll add FULL_DYNAMIC_RGB to the list, but if there are others we can fix those too

mdz commented 3 years ago

@curt7000 python-smarttub 0.0.19 adds this mode

curt7000 commented 3 years ago

Tried updating api.py, deleting the integration and adding back, but everything is still unavailable.

curt7000 commented 3 years ago

Tried updating api.py, deleting the integration and adding back, but everything is still unavailable.

ok, tried changing light color to Blue, and everything came back.

mdz commented 3 years ago

Upgrading your python-smarttub to 0.0.19 should also resolve the issue permanently.

On Mon, Mar 1, 2021 at 6:38 PM curt7000 notifications@github.com wrote:

Tried updating api.py, deleting the integration and adding back, but everything is still unavailable.

ok, tried changing light color to Blue, and everything came back.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/mdz/python-smarttub/issues/4#issuecomment-788531382, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADKVLY4VQT3MTJ7WEEMSYTTBRFSNANCNFSM4YL3GDIQ .

mdz commented 3 years ago

@curt7000 if you could share more information about the lighting modes on your unit, that would be great. Mine only supports the modes above, but yours seems to have more.

curt7000 commented 3 years ago

I have these options on the App.

IMG_1813 IMG_1814

mdz commented 3 years ago

Thanks for that. Interesting, how does the "aftermarket light kit" work?

It would be great to see the debug output from the CLI with python -m smarttub -u email -p password -vv info --lights (just the part after == Lights == is good. If there are any modes or settings you can change on the Exterior tab, it would be helpful to see how the output changes.

curt7000 commented 3 years ago

Apparently, I can hook up low voltage lights to the light relay board and control them. I suppose its for a step light or surrounding ambient light. No plan to do so. But ... hey ... because I can ... I probably will at some point!

Here you go:

== Lights == DEBUG:smarttub.api:GET spas/MYSERIAL/lights successful: {'lights': [{'zone': 1, 'mode': 'OFF', 'cycleSpeed': 0, 'color': {'red': 0, 'blue': 0, 'green': 0, 'white': 0}, 'intensity': 0, 'lastUpdated': '2021-03-04T12:03:59.967Z', 'createdBy': 'SYSTEM'}, {'zone': 2, 'mode': 'FULL_DYNAMIC_RGB', 'cycleSpeed': 0, 'color': {'red': 0, 'blue': 0, 'green': 0, 'white': 0}, 'intensity': 100, 'lastUpdated': '2021-03-04T23:58:02.521Z', 'createdBy': 'SYSTEM'}]} Traceback (most recent call last): File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/srv/homeassistant/lib/python3.8/site-packages/smarttub/main.py", line 143, in asyncio.run(main(sys.argv[1:])) File "/usr/lib/python3.8/asyncio/runners.py", line 43, in run return loop.run_until_complete(main) File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "/srv/homeassistant/lib/python3.8/site-packages/smarttub/main.py", line 140, in main await args.func(spas, args) File "/srv/homeassistant/lib/python3.8/site-packages/smarttub/main.py", line 40, in info_command for light in await spa.get_lights(): File "/srv/homeassistant/lib/python3.8/site-packages/smarttub/api.py", line 188, in get_lights return [ File "/srv/homeassistant/lib/python3.8/site-packages/smarttub/api.py", line 189, in SpaLight(self, **light_info) File "/srv/homeassistant/lib/python3.8/site-packages/smarttub/api.py", line 403, in init self.mode = self.LightMode[properties["mode"]] File "/usr/lib/python3.8/enum.py", line 349, in getitem return cls._membermap[name] KeyError: 'FULL_DYNAMIC_RGB'

curt7000 commented 3 years ago

Just installed 2021.3.1 on my test VM, also a VENV, Ubuntu 20.04 LTS. All entities are showing as unavailable.

curt7000 commented 3 years ago

weird, aftermarket kit was on. Here it is now off.

== Lights == DEBUG:smarttub.api:GET spas/MYSERIAL/lights successful: {'lights': [{'zone': 1, 'mode': 'OFF', 'cycleSpeed': 0, 'color': {'red': 0, 'blue': 0, 'green': 0, 'white': 0}, 'intensity': 0, 'lastUpdated': '2021-03-05T03:04:23.450Z', 'createdBy': 'SYSTEM'}, {'zone': 2, 'mode': 'OFF', 'cycleSpeed': 0, 'color': {'red': 0, 'blue': 0, 'green': 0, 'white': 0}, 'intensity': 0, 'lastUpdated': '2021-03-05T03:04:40.370Z', 'createdBy': 'SYSTEM'}]} <SpaLight 1: OFF (R 0/G 0/B 0/W 0) @ 0> <SpaLight 2: OFF (R 0/G 0/B 0/W 0) @ 0>

curt7000 commented 3 years ago

and now on

== Lights == DEBUG:smarttub.api:GET spas/MYSERIAL/lights successful: {'lights': [{'zone': 1, 'mode': 'OFF', 'cycleSpeed': 0, 'color': {'red': 0, 'blue': 0, 'green': 0, 'white': 0}, 'intensity': 0, 'lastUpdated': '2021-03-05T03:06:14.749Z', 'createdBy': 'SYSTEM'}, {'zone': 2, 'mode': 'HIGH_SPEED_COLOR_WHEEL', 'cycleSpeed': 6, 'color': {'red': 0, 'blue': 0, 'green': 0, 'white': 0}, 'intensity': 50, 'lastUpdated': '2021-03-05T03:06:20.309Z', 'createdBy': 'SYSTEM'}]} <SpaLight 1: OFF (R 0/G 0/B 0/W 0) @ 0> <SpaLight 2: HIGH_SPEED_COLOR_WHEEL (R 0/G 0/B 0/W 0) @ 50>

curt7000 commented 3 years ago

and interior lights, on, blue, 100% intensity

== Lights == DEBUG:smarttub.api:GET spas/MYSERIAL/lights successful: {'lights': [{'zone': 1, 'mode': 'BLUE', 'cycleSpeed': 0, 'color': {'red': 0, 'blue': 255, 'green': 0, 'white': 0}, 'intensity': 100, 'lastUpdated': '2021-03-05T03:08:22.885Z', 'createdBy': 'SYSTEM'}, {'zone': 2, 'mode': 'OFF', 'cycleSpeed': 0, 'color': {'red': 0, 'blue': 0, 'green': 0, 'white': 0}, 'intensity': 0, 'lastUpdated': '2021-03-05T03:07:07.665Z', 'createdBy': 'SYSTEM'}]} <SpaLight 1: BLUE (R 0/G 0/B 255/W 0) @ 100> <SpaLight 2: OFF (R 0/G 0/B 0/W 0) @ 0>

curt7000 commented 3 years ago

No Light Entity created.

Screen Shot 2021-03-04 at 10 24 01 PM
mdz commented 3 years ago

Please open an issue on home-assistant/core about the problem you're having with 2021.3.1. include your logs and tag me on it.

Thanks for the light info. You should be able to control both of those lights with the current implementation once you get it working again.

On Thu, Mar 4, 2021, 19:03 curt7000 notifications@github.com wrote:

Just installed 2021.3.1 on my test VM, also a VENV, Ubuntu 20.04 LTS. All entities are showing as unavailable.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/mdz/python-smarttub/issues/4#issuecomment-791116245, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADKVL3QFJMX64ZUPO4J3LTTCBCZTANCNFSM4YL3GDIQ .

curt7000 commented 3 years ago

well ... I disabled the integration (new feature in 2021.3.1) and re-enabled it to grab logs and the Light entities appeared! I'll monitor and issue a ticket if it continues.

Regardless, great work! If you've got a Buy Me Coffee / Beer, let me know.

On Thu, Mar 4, 2021 at 10:42 PM Matt Zimmerman notifications@github.com wrote:

Please open an issue on home-assistant/core about the problem you're having with 2021.3.1. include your logs and tag me on it.

Thanks for the light info. You should be able to control both of those lights with the current implementation once you get it working again.

On Thu, Mar 4, 2021, 19:03 curt7000 notifications@github.com wrote:

Just installed 2021.3.1 on my test VM, also a VENV, Ubuntu 20.04 LTS. All entities are showing as unavailable.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub <https://github.com/mdz/python-smarttub/issues/4#issuecomment-791116245 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AADKVL3QFJMX64ZUPO4J3LTTCBCZTANCNFSM4YL3GDIQ

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mdz/python-smarttub/issues/4#issuecomment-791129449, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALI3FOLLCUL5MOWWUOMFEODTCBHKDANCNFSM4YL3GDIQ .

mdz commented 3 years ago

Thank you. Glad to hear it's working for now. Do open an issue if you have further problems.

On Thu, Mar 4, 2021, 20:01 curt7000 notifications@github.com wrote:

well ... I disabled the integration (new feature in 2021.3.1) and re-enabled it to grab logs and the Light entities appeared! I'll monitor and issue a ticket if it continues.

Regardless, great work! If you've got a Buy Me Coffee / Beer, let me know.

On Thu, Mar 4, 2021 at 10:42 PM Matt Zimmerman notifications@github.com wrote:

Please open an issue on home-assistant/core about the problem you're having with 2021.3.1. include your logs and tag me on it.

Thanks for the light info. You should be able to control both of those lights with the current implementation once you get it working again.

On Thu, Mar 4, 2021, 19:03 curt7000 notifications@github.com wrote:

Just installed 2021.3.1 on my test VM, also a VENV, Ubuntu 20.04 LTS. All entities are showing as unavailable.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub < https://github.com/mdz/python-smarttub/issues/4#issuecomment-791116245 , or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AADKVL3QFJMX64ZUPO4J3LTTCBCZTANCNFSM4YL3GDIQ

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <https://github.com/mdz/python-smarttub/issues/4#issuecomment-791129449 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ALI3FOLLCUL5MOWWUOMFEODTCBHKDANCNFSM4YL3GDIQ

.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/mdz/python-smarttub/issues/4#issuecomment-791135806, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADKVLZRFYBXU4VUXNBWVW3TCBJQPANCNFSM4YL3GDIQ .