Did you replace all of the automation or just the value template? your original automation had a number of errors that were corrected in my example.
If you replaced the entire thing, what does "{{ states.sun.sun.attributes.elevation | int < 5 }}" render in the templates developer tool? It should render true or else the trigger will not fire.
Also, I should have asked this at first but you do have the sun component loaded, correct?
I had replaced everything in the trigger section, just replaced it all now though, checked the template editor and it does return true, I believe I have the sun component loaded, it shows in the overview at the top.
I think it may have triggered at one point as the light did go on. Will it keep on triggering until the template is no longer true? If so how often?
It is triggering, haven’t got it to trigger again once I turn it off, may it just takes a little while to activate again, but shouldn’t really matter as should only really be triggered on once a day!