Hi,
In my automations, I often use the following condition to prevent the repetition of an action if the event occurred within a specific time frame (20 seconds in this case) since the last occurrence of the event.
conditions:
- condition: template
value_template: >-
{{ (as_timestamp(now()) -
as_timestamp(state_attr('automation.voice_and_video_alert_from_frigate',
'last_triggered') | default(0)) | int > 20)}}
This condition worked for months, but a week ago it stopped working and now returns the following error message:
Errore: In 'template' condition: ValueError: Template error: as_timestamp got invalid input 'None' when rendering template '{{ (as_timestamp(now()) - as_timestamp(state_attr('automation.voice_and_video_alert_from_frigate', 'last_triggered') | default(0)) | int > 20)}}' but no default was specified
I’m not sure what the mistake is, especially since it has always worked before. Could you help identify the issue and suggest a solution?
4 posts - 3 participants