Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias: Frigate Telegram Notification
- description: ""
- trigger:
- - platform: mqtt
- topic: frigate/events
- payload: reolink-entrance
- value_template: "{{ value_json['after']['camera'] }}"
- condition:
- - condition: template
- value_template: "{{ trigger.payload_json['type'] != 'end' }}"
- action:
- - choose:
- - conditions:
- - condition: state
- entity_id: input_boolean.home_occupancy
- state: "on"
- sequence:
- - service: rest_command.telegram_send_photo
- data:
- token: TELEGRAM_TOKEN
- chat_id: TELEGRAM_CHAT_ID
- disable_notification: 1
- url: >-
- https://home-assistant.domain/api/frigate/notifications/{{trigger.payload_json['after']['id']}}/snapshot.jpg
- - repeat:
- sequence:
- - wait_for_trigger:
- - platform: mqtt
- topic: frigate/events
- payload: "{{ trigger.payload_json['after']['id'] }}"
- value_template: "{{ value_json['after']['id'] }}"
- timeout: 180
- continue_on_timeout: false
- - condition: template
- value_template: "{{ wait.trigger.payload_json['type'] == 'end' }}"
- - delay:
- hours: 0
- minutes: 0
- seconds: 10
- milliseconds: 0
- - service: rest_command.telegram_send_video
- data:
- token: TELEGRAM_TOKEN
- chat_id: TELEGRAM_CHAT_ID
- disable_notification: 1
- width: 2560
- height: 1440
- url: >-
- https://home-assistant.domain/api/frigate/notifications/{{trigger.payload_json['after']['id']}}/reolink-entrance/clip.mp4
- until:
- - condition: template
- value_template: "{{ wait.trigger.payload_json['type'] == 'end' }}"
- - conditions:
- - condition: state
- entity_id: input_boolean.home_occupancy
- state: "off"
- sequence:
- - service: rest_command.telegram_send_photo
- data:
- token: TELEGRAM_TOKEN
- chat_id: TELEGRAM_CHAT_ID
- url: >-
- https://home-assistant.domain/api/frigate/notifications/{{trigger.payload_json['after']['id']}}/snapshot.jpg
- - repeat:
- sequence:
- - wait_for_trigger:
- - platform: mqtt
- topic: frigate/events
- payload: "{{ trigger.payload_json['after']['id'] }}"
- value_template: "{{ value_json['after']['id'] }}"
- timeout: 180
- continue_on_timeout: false
- - condition: template
- value_template: "{{ wait.trigger.payload_json['type'] == 'end' }}"
- - delay:
- hours: 0
- minutes: 0
- seconds: 10
- milliseconds: 0
- - service: rest_command.telegram_send_video
- data:
- token: TELEGRAM_TOKEN
- chat_id: TELEGRAM_CHAT_ID
- width: 2560
- height: 1440
- url: >-
- https://home-assistant.domain/api/frigate/notifications/{{trigger.payload_json['after']['id']}}/reolink-entrance/clip.mp4
- until:
- - condition: template
- value_template: "{{ wait.trigger.payload_json['type'] == 'end' }}"
- mode: single
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement