sbidy / wiz_light

A WiZ Light integration for Home Assistant
MIT License
341 stars 68 forks source link

A19 Filament Bulb Support (ESP06_SHDW9_01) -- Golden White #23

Closed zimbo0 closed 4 years ago

zimbo0 commented 4 years ago

Spoke too soon. Ran into an issue with Golden White for this bulb. When selecting that scene I get the below error. All other scenes work. I'm thinking it doesn't like "Golden White" as the default full on bulb scene. Suspect it needs to change to Daylight or Warm Light. Since these bulbs don't let you change the temperature. In the Wiz application the setting is just called "White"

Failed to call service light/turn_on. ('Cant read response from the bulb. Debug:', {'method': 'setPilot', 'env': 'pro', 'error': {'code': -32603, 'message': 'Internal error'}})

Traceback (most recent call last): File "/config/custom_components/wiz_light/light.py", line 252, in update_temperature self._light.state.get_colortemp() File "/usr/src/homeassistant/homeassistant/util/color.py", line 515, in color_temperature_kelvin_to_mired return math.floor(1000000 / kelvin_temperature) ZeroDivisionError: division by zero

sbidy commented 4 years ago

Ah, ok. So can you please set the scene in the app and call a getPilot via nc and post the response? I expect that the submitted scene ID is not correct. Unfortunately I can't test it :-\

zimbo0 commented 4 years ago

Is this what you need? {"method":"getPilot","env":"pro","result":{"mac":"a8bb509ee741","rssi":-47,"src":"","state":true,"sceneId":12,"speed":100,"temp":0,"dimming":57}}

zimbo0 commented 4 years ago

I made the below change and it did fix the error I was receiving, changed the "29" to "11". The error went away and the bulb worked correctly

original code: if self._bulbtype == "ESP06_SHDW9_01": return [self._scenes[key] for key in [8, 9, 13, 28, 30, 29, 31]]

Working code: if self._bulbtype == "ESP06_SHDW9_01": return [self._scenes[key] for key in [8, 9, 13, 28, 30, 11, 31]]

sbidy commented 4 years ago

Sorry for the delay. Thank you for the fix. I'll update the code for that bulb.

zimbo0 commented 4 years ago

Appreciate it. Thank you again for this integration. It's the central piece of my HA so am not at all worried about any delay with updates, just very happy you've made it available.