Your condition is checking for the lights to be off so it should carry on and turn the lights on if the lights are off, if on then it should end the automation. I don’t see where it can turn them off as your action is not a toggle it just turns them on. Do you have a 2nd automation running? Also the editor may not work with ‘complex’ automations, so I would lay it out in the automation.yaml file like this…
id: '1517835053425'
alias: Back home light
trigger:
- platform: state
entity_id: device_tracker.myphone
from: not_home
to: home
- platform: sun
event: sunset
offset: -00:30:00
condition:
- condition: state
entity_id: light.niches
state: 'off'
action:
service: light.turn_on
entity_id: light.niches
data:
brightness_pct: '70'
color_name: peachpuff
transition: '15'
Not sure if the spacing is correct for the automation editor, but that’s how I would do it