Availability template

Try this:

  - sensor: 
      name: "meter_a quantity" 
      state: "{{ state_attr('sensor.meter_a','waterquantity')|int(-1) }}" 
      availability: "{{ state_attr('sensor.meter_a','waterquantity')|int(-1) >= 0 }}" 
      state_class: "measurement" 
      unit_of_measurement: "l" 

Anything that can not be converted to an integer, like unavailable or unknown will be given the default value of -1.

The sensor will only be available if its state is 0 or greater.