I have recently added another Yeelight RGB bulb to my set up and have started to get this error in the HA log when I run a script to change the color of 2 bulbs in a group.
[homeassistant.components.light.yeelight] Error when calling <function YeelightLight.set_default at 0x6e1735d0>: {'message': 'general error', 'code': -5000}
This error has only started to occur since I have added the new bulb, and performing a color change using a script on 2 bulbs (1 older and the 1 new) in a group. The color changes without issue, but throws this error each time.
@kanga_who I have the same issue, did you get it fixed? I read somewhere that someone with the same issue was also unable to set a default ‘scene’ within the Yeelight app… got an error in chinese . This might be a clue.
The scenes and lights activate without any issues, it’s just a log issue that bothers me. IF we can remove that error from producing in the logs, that would be good enough for me at the moment.
From there I made these adjustments (without knowing python at all - so I am not suggesting this is best practice and someone may well offer to improve it ) - I changed lines 115-116 from this:
except yeelight.BulbException as ex:
_LOGGER.error("Error while calling %s: %s", func, ex)
to this:
except yeelight.BulbException as ex:
exstr = str(ex)
if "general error" in exstr:
_LOGGER.debug("Error while calling %s: %s", func, ex)
else:
_LOGGER.error("Error while calling %s: %s", func, ex)
What this does is checks the exception text, and if it is the pointless ‘general error’ we keep seeing, it downgrades it from an ‘error’ to a ‘debug’ entry. So it won’t be in your logs unless (I assume) you specify you want debug logging for your light components.
Hope that helps. My lights are dimming/brightening and I get no more errors.