Overnight calendar events triggering events at midnight as of 2024.3.1

All of a sudden since installing 2024.3.1 my template sensor which tells HA when to turn off our kids tv and turn it back on (the outlet behind it. Not the TV itself) has been triggering at midnight instead of 6am. The template sensor is set to trigger on “start” and “end” so it makes no sense for it to trigger at midnight.

`template:

  • trigger:
    • platform: calendar
      event: start
      entity_id: calendar.home
    • platform: calendar
      event: end
      entity_id: calendar.home
      binary_sensor:
    • name: “Kids TV Event Active”
      unique_id: “c5dbb65b-c741-4fa5-92b9-f0b0c17d8a1a”
      state: ‘{{ “Kids TV Off” in trigger.calendar_event.summary and trigger.event == “start” }}’`

I would like to report this as a bug, but not sure where to do so.

I’m also wondering if anyone else has seen this issue since 2024.3.1 or knows a workaround?

You can see it started 2 days ago which is when I upgraded to 2024.3.1

image

I actually think this is on me. I apparently added trash pickup calendar events to the same calendar and the template sensor template is returning false on the start and end of that event (which is Wednesday all day, so 12am then 12am the next day).

So it’s all me.

I also found that you can’t do conditions which would be nice, but I have a solution. i"ll report back when I have it all written up and implemented.

So here was my solution. I tested it with another all day event I created for today as a a test and it worked

template:
  - trigger:
      - platform: calendar
        event: start
        entity_id: calendar.home
      - platform: calendar
        event: end
        entity_id: calendar.home
    binary_sensor:
      - name: "Kids TV Event Active"
        unique_id: "c5dbb65b-c741-4fa5-92b9-f0b0c17d8a1a"
        state: >
          {% if "Kids TV Off" in trigger.calendar_event.summary %}
            {{  trigger.event == "start" }}
          {% else %}
            {{ states('binary_sensor.kids_tv_event_active')}}
          {% endif %}