Using value_json for availability_template

Hi,

I’m trying to set the availability of a sensor according to the value_json variable, but the availability is not affect, what am I doing wrong?

{
  "name": "WiFi ACM-ESP volume",
  "dev_cla": "gas",
  "stat_t": "home/acm-esp/state",
  "stat_cla": "total_increasing",
  "unit_of_meas": "m³",
  "val_tpl": "{{ value_json['vol_m3'] }}",
  "avty_tpl": "{{ value_json['vol_m3' !== undefined}}"
}

Kind regards