Grabing one bit of json data from MQTT

I would like to execute an automation based off a trigger that looks for the word “true” from the “occupancy” field of the following MQTT message"

zigbee2mqtt/Theater {"battery":100,"illuminance":0,"illuminance_lux":0,"linkquality":92,"occupancy":true,"temperature":23,"voltage":3005}

I tried to use the flowing as the information in the payload to look for, but it throws an error:

{{ value_json.occupancy = true }}

And here is the error:

 Message malformed: invalid template (TemplateSyntaxError: expected token 'end of print statement', got '=') for dictionary value @ data['payload'] 

== is a comparison between two items.
= sets one thing to the value of another.

{{ value_json.occupancy == true }}

Thanks tom_i for that information. I tired it out, but it does not work. It works however if I leave the Payload field empty and just trigger off of the MQTT topic, but that will not do in this scenario.

P.S.
I just now did a test by making a sensor out of the following yaml:

  - platform: mqtt
    name: "TPIR"
    state_topic: "zigbee2mqtt/Theater"
    value_template: "{{ value_json.occupancy }}"

and I shows either the values of either True or False (in uppercase). I then made this automation:

alias: APIR
description: ''
trigger:
  - platform: state
    entity_id: sensor.tpir
    from: 'false'
    to: 'true'
  ...... DO SOMETHING .....

but that did not work. But when I changed the condition to uppercase, it then worked. I then went back to your code example and made that uppercase, but that still doesn’t work. Strange.

My side question here is now why is it changing the MQTT data to uppercase?