HA Rejecting Longtime Automation

Not sure what to make of this automation issue. I’ve had my HA setup running since just before the new year and this was one of the first automations I had running which has been doing just fine until this week. I recently tried updating this original code to add an additional condition so that it wouldn’t trigger late at night. After updating the code, which checked out in yamllint and the configuration
validation, HA wouldn’t come back up again following a restart.

No big deal, I removed that entire automation and restarted, HA works just fine. However, when I re-paste in the original code below that has been working just fine for months, it won’t boot up. I did update to .045, but this issue predates it by several days. Is there something incredibly obvious I’m missing here?

  - alias: Turn On Lights When Coming Home After Dark
    trigger:
      platform: state
      entity_id: device_tracker.mycell
      from: 'not_home'
      to: 'home'
    condition: sun
      after: sunset
      after_offset: "-0:30:00"
    action:
      service: scene.turn_on
      entity_id: scene.come_home_lights_on

When you run the config check (as detailed here), what errors do you get?

2017-05-20 21:46:35 ERROR (Thread-1)
[homeassistant.util.yaml] mapping values are not allowed here in “/home/homeassistant/.homeassistant/configuration.yaml”, line 330, column 12

Where line 330 is the condition

after: sunset

Is that no longer a valid option for sun related measures?

Sunset is fine, I’m still using it (0.45.0).

The problem took me a few minutes to spot, but it’s because your structure is broken. You’ve specified the condition, outside of the condition block. Try the following:

  - alias: Turn On Lights When Coming Home After Dark
    trigger:
      platform: state
      entity_id: device_tracker.mycell
      from: 'not_home'
      to: 'home'
    condition:
      condition: sun
      after: sunset
      after_offset: "-0:30:00"
    action:
      service: scene.turn_on
      entity_id: scene.come_home_lights_on

I am a moron, must have copied and pasted incorrectly when I removed the other condition. Thanks much.