August unlock

Hi I am trying to automate so that when my door is unlocked between sunset and sunrise I would like to open entrance light.
I have been trying this code ( didn’t put sunrise to sunset yet)
When ulocking door the light does not open.
If I go to the automations section in overview and trigger it the light opens.
What am I doing wrong with my code?

- alias: turn on entrance light when august unlocked
  trigger:
    platform: state
    entity_id: unlock.front_door
    to: 'on'
  action:
    service: homeassistant.turn_on
    entity_id: light.53411381807d3a597774

Doesnt seem to be much info for this on the HA wiki, and I dont have one myself but I would assume you need to track the state of the lock entity when it changes to unlocked.

What entity gets created when you add the August lock, and what states does it show (unlocked, locked)? What is unlock.front_door?

here is more info in picture.
Unlock.front_door is the state I wanted to get . IE when front door is unlocked open light

Under developer tools, States (<> button) can you get a screenshot of the entity shown for that?

Since I can’t see the unlocked state, and I assume its just ‘unlocked’, this should work

- alias: turn on entrance light when august unlocked
  trigger:
    platform: state
    entity_id: lock.front_door
    to: 'unlocked'
  action:
    service: homeassistant.turn_on
    entity_id: light.53411381807d3a597774

To prevent any issue where the lock goes unavailable and then back to unlocked, you might want to put ‘from: locked’ before ‘to: unlocked’

it works great thanks " Now I will try it tomorrow morning to see if my below horizon works.
Here is the complete code if anybody needs

- alias: turn on entrance light when august unlocked
  trigger:
    platform: state
    entity_id: lock.front_door
    from: 'locked'
    to: 'unlocked'
  condition:
  - condition: state
    entity_id: sun.sun
    state: 'below_horizon'
  action:
    service: homeassistant.turn_on
    entity_id: switch.03504103840d8e9376ee #entrance light