Change colour of light based on energy consumption

In case anyone else is looking for a similar solution check out this thread.