Compare date time with a sensor containing date time as text

Hass agent has the ability to report a ‘last active’ sensor which contains the date and time a computer was last used.
I need to create a condition that asks: “if the laptop was last active within the minute, return false”
As the ‘last active’ sensor appears to show its value in plain text, rather than a specific date and time entity, how would I go about comparing this to the current time?


You can use a Template condition:

  - condition: template
    value_template: |
      {{ now() <= states('sensor.laptop_lastactive') | as_datetime
      + timedelta(minutes=1) }}

exactly what I needed, perfect thank you