Last Triggered more than 10min in node red

Hey Guys,
I’m trying to work out how to get node red to check when a script was last triggered and compare it to the time now and then activate that script if more than 10 minutes has past. I have an automation with a template in home assistant which works, however I wanted to switch it to node red.

Here is the home assistant automation code:

alias: Temp High >> LR AC ON

  description: ''

  trigger:

  - platform: template

    value_template: '{{ states(''sensor.hue_motion_sensor_1_temperature'')|float >

      states(''input_number.room_temp_max'')|float }}'

  condition:

  - condition: template

    value_template: "{% set last = state_attr('automation.high_temp_sense_lounge_room', 'last_triggered') %}  {{ last is none or (now() - last).total_seconds() > 120 }}"

  action:

  - service: script.ac_high_temp_on

    data: {}

Kind Regards,
Dan

In NodeRED, start with an events: all node. In that node, enter call_service in the event type field.

Now, add a switch node after that and qualify the message output with the == operator and add the name of your script script.ac_high_temp_on. Now, every time a call service of type script.ac_high_temp_on is seen, it will allow the message through.

From there, you can start a 10 minute timer using the stoptimer node. When the stop timer node expires, it passes the message on, at which point you could do anything with it, like triggering the script again, which would repeat the loop.

You could also use a javascript node to dig into the state information for the triggering devices/scripts and then use those values to make your comparison, but it seems that a countdown timer would achieve the same goal.