I currently have this condition block which works great:
condition:
- condition: or
conditions:
- condition: template
value_template: "{{ trigger.payload_json['type'] == 'new' }}"
- condition: template
value_template: "{{ before_zones | length == 0 }}"
- condition: time
after: input_datetime.camera_arm_start
before: input_datetime.camera_arm_end
- condition: template
value_template: >-
{{ not state_attr('automation.frigate_alarm_driveway_night',
'last_triggered') or (now() -
state_attr('automation.frigate_alarm_driveway_night', 'last_triggered') >
timedelta(minutes=int(states('input_number.camera_cooldown')))) }}
My logic and reason is that I am using this as a âcooling off periodâ configured against a number Helper (time of 3 minutes).
Is it possible to not hard code the autonation name into the automation itself to determine last triggered?