Alter a sensor's text value to make use of visability condition

In this example I am using Picnic. I want to show a tile card on my dashboard when the deliverytime is less than 10 hours.
The entity where this is given, a sensor, has the value of “in 7 hours”. So when I use a numerical condition it is never true.
How can I extract that 7 as a numerical value with the least possible effort?

Is this in an automation or what are you expecting.
Your post is a bit confusing where you need this value

Sorry for the confusion.It’s about this condition for showing/not showing the tile card

You probably need to create a separate sensor for that