Light Group = 100% CPU

I was fighting an issue recently and figured I’d share the cause and solution with others in the event it might help someone in the future.

After an upgrade to 0.114 and possibly troubleshooting some other issue (not really sure), I noticed that whenever I would turn on some of my lights (dimmers) they would turn off and on again in rapid succession infinitely and the CPU on the ‘python3 -m homeassistant --config /config’ process would sit at 100% until I restarted Home Assistant. It was so bad that at times I couldn’t SSH into the machine anymore or access the HA web interface, but the lights continued to flash like a strobe light.

After some troubleshooting, I was able to determine the issue was with the Light Group I was using to control the lights. Somehow during the process of upgrading or troubleshooting something else, the entity names for the lights within the light group changed, and one of the entities referenced within the light group was the light group itself! So this somehow caused some kind of infinite loop or race condition in HA by some form of reflective entity reference.

Now that I got that sorted out, the light group is working perfectly again, but still thought I’d share. While this is obviously a misconfiguration, it seems like this condition could probably be handled more gracefully.

3 Likes