Template for RESTfull sensor in markdown

I’m trying to get notified in a markdown when my iMac’s mouse needs to be charged.
the template editor gives me this:

"{{ states.sensor.imac_mouse_battery.state }}"

result is : “75%”

I want to get a notification when battery level drops below 75%, but it doesn’t work …

  {% if states.sensor.imac_mouse_battery.state  | float < 75 %}
   Please charge iMac mouse! {% endif %}

Is this because it is a Restful sensor?

The above is probably a string, and you’re trying to compare it to a float.
What do you get if you put

{% if states.sensor.imac_mouse_battery.state  | float < 75 %}
   Please charge iMac mouse! {% endif %}

Into Developer Tools / Template ?

and

I now use it just like this (and working), but of course it is not ideal. I prefer a constant notification

          &nbsp;{% if "73%" in states('sensor.imac_mouse_battery') %}
          {{'\u26A0\uFE0F'}} &nbsp;  Muis van iMac opladen!  {% endif %}