Template binary_sensor using AND logic not working

In order to reduce false alarm, I wanted to combine 2 other binary sensors in a template binary_sensor so that the template binary sensor is ON only when both binary sensors in value_template is ON. Here is my template binary_sensor…

- platform: template 
  sensors:
    car_porch_intrusion:
      friendly_name: 'Car Porch Intrusion'
      sensor_class: 'motion'
      value_template: >-
        {%- if is_state("binary_sensor.carporch_motion_sensor", "on") 
            and is_state("binary_sensor.cam_1_field_detection", "on") -%}
        on
        {%- else -%}
        off
        {%- endif %}
      entity_id:
        - binary_sensor.carporch_motion_sensor
        - binary_sensor.cam_1_field_detection

Unfortunately this is not working. When both binary_sensor.carporch_motion_sensor and binary_sensor.cam_1_field_detection are on, the binary_sensor.car_porch_intrusion remains off.

Please help.

I used this example from ih8gates which might help you. It watches the sensor every second.

  nate_tech_shop_end:
    friendly_name: Tech Shop ends in 15 minutes
    entity_id: sensor.date__time
    value_template: >
      {% if states.calendar.nathan_tech_shop %}
      {% if is_state("calendar.nathan_tech_shop", "on") and as_timestamp(states.calendar.nathan_tech_shop.attributes.end_time) - as_timestamp(now()) < 900  %}on{% else %}off{% endif %}
      {% else %}off{% endif %}