Smart Lighting Automation with Motion Sensors and Lux Levels

Hello everyone, I’m new to the world of Home Assistant and I’m trying to wrap my head around automations. I’ve used Node-RED before, which was pretty straightforward, but I’m excited to dive deeper into HA’s blueprint system. I came across a blueprint for motion and light devices, and I was wondering if anyone could help me expand on that.

My goal is to create an automation where, when motion is detected and the light level is low, a specific light turns on. Then, after a certain period of inactivity, the light should turn off automatically. I’ve tried setting this up, but I’m stuck on how to incorporate the lux level condition and the delay for turning off.

I’ve attached a screenshot of my current setup, and I’m hoping someone can guide me on how to tweak this or suggest a better approach. I’m also curious if there are any best practices for ensuring smooth transitions between states or handling edge cases, like if the light level fluctuates slightly.

Any tips or shared blueprints would be incredibly helpful! I’m really looking forward to getting this automation up and running to enhance my home’s lighting system. Thanks in advance for your support!