Automation always fires with template condition

I have the following automation. Basically, I’m looking to ONLY send an alert at 8am if the latest data available on my oura sensor doesn’t match yesterdays date. I’m using this to remind myself to run the required sync.

The template returns True or False as expected when checked in Template editor (if the strings are the same it’s False, if they’re different it’s True) however the automation always executes.

What am I doing wrong? I’ve spent ages trying to get this logic to work, seems like a simple thing but I just can’t get it to do what I want it to do.

alias: Notify - Oura Download Delay - Tom (Test)
description: ''
trigger:
  - platform: time
    at: '08:00'
condition:
  - condition: template
    value_template: >-
      {{ states('sensor.tom_s_oura_latest_data') != states('sensor.date_yesterday') }}
action:
  - service: notify.mobile_app_tom_s_phone
    data:
      message: Looks like ring data hasn't been downloaded for today. Time for a sync!
      title: 💍 Oura alert!
      data:
        actions:
          - action: URI
            title: Open Oura
            uri: app://com.ouraring.oura
mode: single

Check the automation trace.

Add an id to the automation for traces to show up. Any id, as long as it’s unique.

Thanks.

So I had been running it by hand (manually triggering) and it would always execute the notification. I did not know that conditions are ignored in when manually starting.

When I actually run it according to the schedule it appears to work.

Thanks!

For future reference, from Troubleshooting Automations - Testing your automation

You can manually test an automation with the conditions using Developer Tools / Services.

https://www.home-assistant.io/docs/automation/services/

Thank you. I found this around the same time your reply came through

Thanks both for the general nudge in the right direction. It appears it’s all working.