Yeelight exception after adding new devices

Hello,

I’ve recently added two more yeelight rgbw to my home setup and all the yeelights disappeared and there is an exception is the logs. Home Assistant version is 0.49.0. Also tried the 0.50 dev version and the problem is still there.
Any help is appreciated.

The setup:

light:
  - platform: yeelight
    devices:
      192.168.1.180:
        name: room180
        transition: 350
        use_music_mode: False #(defaults to False)
        save_on_change: False #(defaults to True)
      192.168.1.181:
        name: room181
        transition: 350
        use_music_mode: False #(defaults to False)
        save_on_change: False #(defaults to True)
      192.168.1.182:
        name: room182
        transition: 350
        use_music_mode: False #(defaults to False)
        save_on_change: False #(defaults to True)

This is the error I am having:

2017-07-22 00:16:38 DEBUG (Thread-4) [yeelight.main] Bulb<192.168.1.180:55443, type=BulbType.Color> > {'id': 1, 'params': ['power', 'bright', 'ct', 'rgb', 'hue', 'sat', 'color_mode', 'flowing', 'delayoff', 'flow_params', 'music_on', 'name'], 'method': 'get_prop'}
2017-07-22 00:16:38 DEBUG (Thread-7) [yeelight.main] Bulb<192.168.1.182:55443, type=BulbType.Unknown> < {'id': 0, 'result': ['off', '100', '4000', '16712448', '240', '100', '3', '0', '0', '', '0', '']}
2017-07-22 00:16:38 INFO (MainThread) [homeassistant.components.notify] Setting up notify.ios
2017-07-22 00:16:38 DEBUG (Thread-5) [yeelight.main] Bulb<192.168.1.181:55443, type=BulbType.Unknown> < {'id': 0, 'result': ['off', '100', '4000', '16711680', '240', '100', '3', '0', '0', '', '0', '']}
2017-07-22 00:16:38 DEBUG (Thread-7) [yeelight.main] Bulb<192.168.1.182:55443, type=BulbType.Color> > {'id': 1, 'params': ['power', 'bright', 'ct', 'rgb', 'hue', 'sat', 'color_mode', 'flowing', 'delayoff', 'flow_params', 'music_on', 'name'], 'method': 'get_prop'}
2017-07-22 00:16:38 DEBUG (Thread-5) [yeelight.main] Bulb<192.168.1.181:55443, type=BulbType.Color> > {'id': 1, 'params': ['power', 'bright', 'ct', 'rgb', 'hue', 'sat', 'color_mode', 'flowing', 'delayoff', 'flow_params', 'music_on', 'name'], 'method': 'get_prop'}
2017-07-22 00:16:38 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=notify, service=ios_darksuns_iphone6s>
2017-07-22 00:16:38 DEBUG (Thread-4) [yeelight.main] Bulb<192.168.1.180:55443, type=BulbType.Color> < {'id': 1, 'result': ['off', '100', '6329', '262139', '238', '100', '3', '0', '0', '', '0', '']}
2017-07-22 00:16:38 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=notify, service=notify>
2017-07-22 00:16:38 DEBUG (Thread-7) [yeelight.main] Bulb<192.168.1.182:55443, type=BulbType.Color> < {'id': 1, 'result': ['off', '100', '4000', '16712448', '240', '100', '3', '0', '0', '', '0', '']}
2017-07-22 00:16:38 DEBUG (Thread-5) [yeelight.main] Bulb<192.168.1.181:55443, type=BulbType.Color> < {'id': 1, 'result': ['off', '100', '4000', '16711680', '240', '100', '3', '0', '0', '', '0', '']}
    2017-07-22 00:10:31 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
    Traceback (most recent call last):
      File "/usr/lib/python3.4/asyncio/tasks.py", line 233, in _step
    result = coro.throw(exc)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/entity_component.py", line 381, in async_process_entity
    new_entity, self, update_before_add=update_before_add
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/entity_component.py", line 212, in async_add_entity
    yield from self.hass.async_add_job(entity.update)
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/light/yeelight.py", line 258, in update
    self._rgb = self._get_rgb_from_properties()
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/light/yeelight.py", line 198, in _get_rgb_from_properties
    return colorsys.hsv_to_rgb(hue, sat, val)
  File "/usr/lib/python3.4/colorsys.py", line 146, in hsv_to_rgb
    i = int(h*6.0) # XXX assume int() truncates!
TypeError: can't multiply sequence by non-int of type 'float'
2017-07-22 00:10:31 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/tasks.py", line 233, in _step
    result = coro.throw(exc)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/entity_component.py", line 381, in async_process_entity
    new_entity, self, update_before_add=update_before_add
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/entity_component.py", line 212, in async_add_entity
    yield from self.hass.async_add_job(entity.update)
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/light/yeelight.py", line 258, in update
    self._rgb = self._get_rgb_from_properties()
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/light/yeelight.py", line 198, in _get_rgb_from_properties
    return colorsys.hsv_to_rgb(hue, sat, val)
  File "/usr/lib/python3.4/colorsys.py", line 146, in hsv_to_rgb
    i = int(h*6.0) # XXX assume int() truncates!
TypeError: can't multiply sequence by non-int of type 'float'
2017-07-22 00:10:31 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/tasks.py", line 233, in _step
    result = coro.throw(exc)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/entity_component.py", line 381, in async_process_entity
    new_entity, self, update_before_add=update_before_add
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/entity_component.py", line 212, in async_add_entity
    yield from self.hass.async_add_job(entity.update)
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/light/yeelight.py", line 258, in update
    self._rgb = self._get_rgb_from_properties()
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/light/yeelight.py", line 198, in _get_rgb_from_properties
    return colorsys.hsv_to_rgb(hue, sat, val)
  File "/usr/lib/python3.4/colorsys.py", line 146, in hsv_to_rgb
    i = int(h*6.0) # XXX assume int() truncates!
TypeError: can't multiply sequence by non-int of type 'float'

I’m also having issues since recently adding a new Yeelight to my set up. Not sure if the issue is related, but see my thread here.

I will capture the error logs I have similar to yours next time the appear and post here also.

The yeelights work with HASS version 0.48.0. So the problem should have occured after that release. Which version are you using?

I’m currently on the latest version at the time of writing this (49.0).

As mentioned in my thread, the error only started to occur when a new bulb was added and a script was used to change both bulbs at once.

I previously had 1 x LIFX RGB bulb and 1 x Yeelight RGB running off the same script to perform a color change, and it threw no errors. The errors only occur since removing the LIFX bulb from the script and replacing it with a 2nd Yeelight

Can you try to downgrade with:

pip3 install homeassistant==0.48.1

@sendorm Done, would you like me to see if the same error occurs while running the script?

edit
Downgrade won’t stick, retrying

edit 2
Downgrade seemingly not working. Shows as done in putty, reboot, then HASS still shows version 49.0

After a cycle of downgrades and upgrades. My problem has resolved.

I am unable to downgrade for some reason. Have tried 5 times, still shows as 49.0 on reboot

I am sorry. Maybe someone with more experience could help.

Finally got the downgrade to work - 47.1. Errors still persist when running script.

2017-07-22 18:38:34 ERROR (Thread-3) [homeassistant.components.light.yeelight] Error when calling <function YeelightLight.set_default at 0x6e179858>: {‘code’: -5000, ‘message’: ‘general error’}
2017-07-22 18:38:34 ERROR (Thread-1) [homeassistant.components.light.yeelight] Error when calling <function YeelightLight.set_default at 0x6e179858>: {‘code’: -5000, ‘message’: ‘general error’}

How did you get the downgrade to stick? I am trying to downgrade but have the same issue you describe; putty shows it is all successful but after reboot i’m still on the original version. Did you just keep trying or is there another trick you used?

NVM: I found the solution. I was running the command under the pi user; I had to switch to the homeassistant user and the virtual environment. All good now.

1 Like