On after a time and before sunrise - hass changing automation

I had after sunset or before sunrise working for months with the following YAML:

  - condition: or
    conditions:
      - condition: sun
        before: sunrise
      - condition: sun
        after: sunset

I want to change it to after Midnight or before sunrise so I edited my YAML as follows:

  - condition: or
    conditions:
      - condition: sun
        before: sunrise
      - condition: time
        after: "00:00:00"

Makes sense. Works exactly like my sunset condition. I save and hass changes my automation to the following which doesn’t work at all.

  - condition: or
    conditions:
      - condition: sun
        before: sunrise
      - condition: time
        after: "00:00:00"
        before: "00:00:00"

Had the thought I could just have two conditions and no or. One condition it’s before sunrise and the other it’s between Midnight and 08:00:00. The bigger issue though is why is hass changing my automation! It’s stupid. Hands off.

As explained in the Time condition docs, if only the before: key is used, the condition will be True from midnight until the specified time. If only the after: key is used, the condition will be True from the specified time until midnight. Having it auto-fill the “00:00:00” is the normal behavior to conform with the documented functionality.

Your current Time condition will actually make the Or condition always True.

In this case you only need the Sun condition. If only the before: key is used, the Sun condition will be True from midnight until sunrise.

What is your goal? From the statement above it seems you want to allow execution between midnight and the earlier of Sunrise and 8:00:00.

If that’s the case that’s what I’ll do. I thought I had to be very explicit with my conditions. “Between these two conditions”. Didn’t know hass operates Midnight to Midnight so that would be assumed. Thanks.