I cant get my following automation to work, could anybody help me what I have done wrong?
I want the following goal:
I have an automation “telegram_marked_done” which is an automation triggered by a telegram chat. So when I write in telegram /done this automation gets triggered.
Now I want another automation: If I havent triggered the automation “telegram_marked done” in the last 2,5 hours at 22:30 o clock and if I am at home (located by google maps) I want my google home to speak “you have forgotten to mark as done”
I believe the following code is wrong: ‘{{ as_timestamp(now()) - as_timestamp(states.automation.telegram_marked_done.last_triggered) | int > 220 }}’
Here is my complete current code:
- alias: 'Not marked as done'
hide_entity: true
initial_state: on
trigger:
- platform: time
at: '22:30'
condition:
condition: and
conditions:
- condition: template
value_template: "{{ states.device_tracker.google_maps_116561.state == 'home' }}"
- condition: template
value_template: '{{ as_timestamp(now()) - as_timestamp(states.automation.telegram_marked_done.last_triggered) | int > 220 }}'
action:
service: tts.google_translate_say
entity_id: media_player.schlafzimmer
data:
message: 'You have forgotten to mark as done'