Why is this automation turning light on when entering, but not off after 10 minutes inactivity?

Take a look at this post about unique_id and entity_id: