I’m so glad I’m not the only one with crazy template sensors! I wasn’t sure if it was a good thing to do but I haven’t noticed any issues so far. If It’s ok with you I might use your template and see if adding my new open weather map cloudiness percentage sensor as the base for illuminance estimation returns finer results. I’m no Python programmer.