Sensor state with 2 decimals wrong interpretation

Hi folks,

I am using the HACS integration “Waste Collection Schedule”, and for this several sensors.
So for the Recycling Bin the current state is 25 days.
On my Dashboard Sidebar I am using these code lines to notify about when the next time the bin will be collected.

 <li>
      {% if "1" in states('sensor.abfallblauetonne') %} <li>Blaue/Gelbe Tonne wird morgen abgeholt!</li> {% endif %}
    </li> 
     <li>
      {% if "2" in states('sensor.abfallblauetonne') %} <li>Blaue/Gelbe Tonne wird in 2 Tagen abgeholt!</li> {% endif %}
    </li> 
     <li>
      {% if "3" in states('sensor.abfallblauetonne') %} <li>Blaue/Gelbe Tonne wird in 3 Tagen abgeholt!</li> {% endif %}
    </li> 
     <li>
      {% if "4" in states('sensor.abfallblauetonne') %} <li>Blaue/Gelbe Tonne wird in 4 Tagen abgeholt!</li> {% endif %}
    </li> 

So what it right now displays on the sidebar is that in 2 days the recycling bins are going to be collected. But it will be in 25 days.
How can i fix this?

Thanks :wink:

Found the solution myself.
Today the state for the recycle bin is 24. So both lines for “2” and for “4” where showing up on my sidebar telling me Recycle bin will be collected in 2 and 4 days.

After digging around and reading half the internet, I changed this

{% if "2" in states('sensor.abfallblauetonne') %}

into this

{% if is_state('sensor.abfallblauetonne', '2') %}

And this works now like it should.