Checking State Attiributes being < or > than

Im trying to identify whether there is a way to see if a my state attribute is < 6 for greenwaste.

Something like this is what I want

          {% if is_state_attr('sensor.bin_greenwaste', 'days',  < 6 ) %}
            GreenWaste

This is what I have in place for testing so far.

  - platform: template
    sensors:
      binstatus:
        friendly_name: "Bin Status"
        value_template: >-
          {% if is_state_attr('sensor.bin_greenwaste', 'days',  '1' ) %}
            GreenWaste
          {% else %}
            Recycling
          {% endif %}
        entity_picture_template: >-
          {% if is_state_attr('sensor.bin_greenwaste', 'days',  '1' ) %}
            /local/images/bins/greenbin.jpg
          {% else %}
            /local/images/bins/yellowbin.png
          {% endif %}  

Can any templating ninjas tell me how to do it?

- platform: template
   sensors:
     binstatus:
       friendly_name: "Bin Status"
       value_template: >-
         {% if state_attr('sensor.bin_greenwaste', 'days') < 6 %}
           GreenWaste
         {% else %}
           Recycling
         {% endif %}
       entity_picture_template: >-
         {% if state_attr('sensor.bin_greenwaste', 'days') < 6 %}
           /local/images/bins/greenbin.jpg
         {% else %}
           /local/images/bins/yellowbin.png
         {% endif %}

May need to pipe to an int depending on how the attribute is output.