Hi,
I have a automation and script to open my frontdoor for multiple users.
I want a picture to be sent to the person who gives the /frontdoor_unlock command in telegram bot and to myself.
But when I open the door by myself I get the picture twice.
How can I prevent a duplicate picture when opening the frontdoor by myself?
scripts.yaml
unlock_frontdoor:
alias: Frontdoor Unlock
sequence:
- data:
entity_id: switch.frontdoor_lock
service: switch.turn_on
- delay: 00:00:02
- data:
entity_id: switch.frontdoor_lock
service: switch.turn_off
- data:
message: Frontdoor unlocked
service: notify.donald
automation.yaml
- id: '1550932164881'
alias: Frontdoor Unlock via Telegram Chatbot
trigger:
- event_data:
command: /frontdoor_unlock
event_type: telegram_command
platform: event
condition: []
action:
- data:
message: Unlock Frontdoor via Telegram Chatbot
service: script.unlock_frontdoor
- data:
entity_id: camera.hallway
filename: /tmp/camera-hallway.jpg
service: camera.snapshot
- data_template:
caption: Unlocking Frontdoor for {{ trigger.event.data["from_first"] }}
file: /tmp/camera-hallway.jpg
target: ['{{ trigger.event.data.user_id }}',!secret telegram_id_donald]
service: telegram_bot.send_photo
Any help would be appreciated!