I’d like to use a timer to turn off the light but its not working. A delay works perfectly fine. It seems that simply having the timer present prevent the light from turning on at all. The timer itself seems to be working perfectly fine and turns off the light as expected.
Any tips as to what I might be overlooking or how I might troubleshoot?
I wager that you have to change your automation mode which is accessible on the top right corner menu so that instead of being in the default Single mode, it changes to Restart mode. If you don’t restart the automation by having it re-trigger when the conditions change, then Home Assistant will not execute the automation again because it’s still running because you set a timer.
Whenever possible, prefer not to leave an automation running for a long time, especially for times where you have to do something critical after that period of time has passed, because the automation will reset to zero and will stop running if you restart home assistant in the middle of it running. I would strongly prefer if Home Assistant restored the state of the automation at the time it was running when you restart Home Assistant. But that just isn’t the case today, and I am not sure this is ever going to be implemented.
Ignore my comment. I am an idiot and I did not read that your automation is already on restart mode. You will have to look at the traces in the automation (top right corner for the traces menu) to see what’s going on. Another useful tool that allows you to see what might be going on is the activity log, especially when filtered by the light itself, because that will tell you what exactly triggered the state change of the light.
The first three State Triggers serve the same purpose as the ones in your example and are responsible for turning the light on and for starting the timer.