SQL integration WHERE condition using entity state does not work

hi guys, my SQL below works when the condition is hardcoded like

day_ts >= '2025-10-08'

but does not work when i try to use datetime entity

day_ts >= '{{ states(''input_datetime.utility_bill_energy_curr_start_date'') }}'

my start_date entity has the value 2025-10-08. could someone show me on what i did wrong?

sql:
  - name: SQL_energy_curr_aircond
    query: >
      SELECT
        json_group_array(
          json_object(
            'date_ts', day_ts,
            'state', max_state,
            'last_reported_ts', last_reported_ts
          )
        ) as row
        FROM (
          SELECT 
            strftime('%Y-%m-%d', s1.last_reported_ts, 'unixepoch') AS day_ts,
            max(cast(s1.state AS real)) as max_state,
            s1.last_reported_ts as last_reported_ts
          FROM states s1
          INNER JOIN states_meta m1 
          ON s1.metadata_id = m1.metadata_id
           WHERE m1.entity_id = 'sensor.aircond_today_s_consumption'
            AND
            day_ts >= 
            '{{ states(''input_datetime.utility_bill_energy_curr_start_date'') }}'
          GROUP BY day_ts
          ORDER BY day_ts DESC
          ) 
        ;
    column: "row"

You can see in the documentation that the query is expected to be a string, which means that templates are not supported for that field.

Someone has created a pull request to add this feature, but it hasn’t been merged yet.