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