I ‘upgraded’ ZigBee Coordinator on ZHA from the Sonoff Dongle P to the Sonoff Dongle Max but had lots of lag issues with my lights. I decided to go full AI ballistic and leverage Gemini to help me debug. Below is the new custom quirk for ZHA which seems to have improved my network from being spammed with voltage, power and current updates multiple times per second. Unfortunately the Sonoff Dongle Max is still not working well but at least ZigBee network traffic seems to have improved.
Code was generated by Gemini AI by attaching a copy of the Tuya device handler and asking it to update the quirk to be less chatty for the above.