Templates broken after update 2022

I’m using a template binary_sensor. The complete definition is

- binary_sensor:
  - name: "sensor name"
    device_class: motion
    delay_off: >
      {{ 60 if is_state('binary_sensor.sensor_name','on') else 0 }}
    state: >
      {{ is_state('binary_sensor.mqtt_motion','on') }}

The source sensor (binary_sensor.mqtt_motion) is a binary_sensor generated by the MQTT integration.
I’m checking the state of the binary_sensor itself to define the delay_off value.
‘None’ worked for me, but is changed the logic so I could use the ‘on’ state.

I kinda like that idea using on/off for the delay else 0, that also looks more readable to me with the actual value first.

I know this an old topic, but this is the root of the problem I just encountered. Yes, I will use the templated delay_on value.
But two things:

  1. the format people are using is the new binary sensor, but everything I read says only the old format supports “delay_on/off”
  2. how can this log say receiving a value caused the unknown? I thought receiving a value would cause it to go “off” if I only have a delay_on…
    BTW, a delay_on of 1 hr causes no issue and has a value right away, but 3 hrs causes long-term Unknown. Odd.

Post your code, we can’t really explain the behavior without seeing your code.