Sensor for Sunset to Morning (not sunrise)

I am finding that I have more and more automations and alerts that I only want to trigger at night. The sun being below horizon was working fine until our days started to get shorter. I am trying avoid getting things like garage alerts at 7AM (sun still down, but our day has started).

Thinking that I could use a template sensor to be “on” from sunset until 6AM, but not sure how I would capture that. Would I need two templates: one for sunset to 12:00 and one from 12:00 to 6:00?

I use a TOD binary sensor:

It spans over to the next day (see the bottome of the page above)

- platform: tod
  name: Night
  after: sunset
  before: '06:00:00'

Well that’s awesome. I had no idea. Thanks!