If you are redoing the hue integration you should look at @bertabcd1234's CoCoHue app as it is more feature rich.