Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- description: ""
- mode: queued
- triggers:
- - topic: frigate/events
- enabled: true
- alias: Получено сообщение от MQTT Frigate\Event
- trigger: mqtt
- - alias: Получено сообщение от MQTT Frigate\Event
- topic: test/events
- enabled: true
- trigger: mqtt
- conditions: []
- actions:
- - variables:
- type: "{{ trigger.payload_json['type'] }}"
- camera: "{{ trigger.payload_json['after']['camera'] }}"
- id: "{{ trigger.payload_json['after']['id'] }}"
- label: "{{ trigger.payload_json['after']['label'] }}"
- score: "{{ (trigger.payload_json['after']['score'] | float(0) * 100) | int(0) }}"
- area: "{{ trigger.payload_json['after']['area'] }}"
- datetime: >-
- {{ trigger.payload_json['after']['frame_time'] |
- timestamp_custom('%Y-%m-%d %H:%M:%S') }}
- label_rus: |
- {% set object_name = { "cat":
- "кот", "dog": "собака", "person": "человек", "car": "машина" } %}{% set
- object = label %}[{% for key in
- object_name.keys() %}{% if key==object %}{{object_name[key]}}{% endif %}{%
- endfor %}]
- target: "-100XXXXXXXXX"
- ip_base_url: http://192.168.XXX.XXX:8123/api/frigate/notifications/
- domain_base_url: https://domain.ru/api/frigate/notifications/
- disable_notification_sp: false
- label_disable_notification: ""
- indoor_camera1: livingroom
- indoor_camera2: kitchen
- indoor_camera3: hall
- outdoor_camera1: entrance
- alias: Определение переменных
- - alias: Проверочное сообщние, если нужно проверить ПЕРЕМЕННЫЕ
- action: telegram_bot.send_message
- metadata: {}
- data:
- disable_notification: true
- message: |-
- MQTT frigate event:
- <pre>camera: "{{ camera }}"
- id: "{{ id }}"
- area: "{{area}}"
- label: "{{ label }}"
- label_rus: "{{label_rus}}"
- score: "{{ score }}"
- type: "{{ type }}"
- datetime: "{{ datetime }}"
- </pre>
- УСТАНОВОЧНЫЕ:
- <pre>ip_base_url: "{{ ip_base_url }}"
- domain_base_url: "{{ domain_base_url }}"
- disable_notification_sp: "{{ disable_notification_sp }}"
- label_disable_notification: "{{ label_disable_notification }}"
- target: "{{ target }}"
- </pre>
- parse_mode: html
- enabled: false
- - alias: Камеры в помещении (Только New и End)
- if:
- - alias: Если != update
- condition: template
- value_template: "{{ type != 'update' }}"
- enabled: true
- - alias: ЕСЛИ любая камера в доме сработала
- condition: or
- conditions:
- - condition: template
- value_template: "{{ camera == indoor_camera1 }}"
- enabled: true
- - condition: template
- value_template: "{{ camera == indoor_camera2 }}"
- enabled: true
- - condition: template
- value_template: "{{ camera == indoor_camera3 }}"
- enabled: true
- enabled: true
- then:
- - metadata: {}
- data:
- parse_mode: html
- target: "{{ target }}"
- disable_notification: "{{ disable_notification_sp }}"
- url: "{{ip_base_url+id}}/snapshot.jpg?bbox=1&motion=1®ions=1"
- inline_keyboard: |
- 🎥:/send_video {{id}} {{camera}},📴:/disarm_alarm
- caption: >-
- Камера: [ <a href='{{domain_base_url+id}}/clip.mp4'>{{camera}} </a>
- ] {{label_disable_notification}}
- <pre>Тип: {{type}} {{ label_rus }} {{area}}/{{score}}%
- id: {{id}}
- Дата: {{datetime}}</pre>
- action: telegram_bot.send_photo
- enabled: true
- - alias: Камера entrance (Смотрит в подъезд)
- if:
- - alias: "==entrance"
- condition: template
- value_template: "{{ camera == outdoor_camera1 }}"
- enabled: true
- then:
- - alias: Определяем disable_notification
- if:
- - condition: or
- conditions:
- - condition: template
- value_template: |
- {{ is_state('input_boolean.mute_telegram', 'on') }}
- alias: mute_telegram IS on
- - alias: Если == update
- condition: template
- value_template: "{{ type == 'update' }}"
- enabled: true
- - alias: area < 20000
- condition: template
- value_template: "{{ area < 20000 }}"
- then:
- - variables:
- disable_notification_sp: true
- label_disable_notification: (m)
- - metadata: {}
- data:
- parse_mode: html
- target: "{{ target }}"
- disable_notification: "{{ disable_notification_sp }}"
- url: "{{ip_base_url+id}}/snapshot.jpg?bbox=1&motion=1®ions=1"
- inline_keyboard: |
- 🎥:/send_video {{id}} {{camera}},📴:/disarm_alarm
- caption: >-
- Камера: [ <a href='{{domain_base_url+id}}/clip.mp4'>{{camera}} </a>
- ] {{label_disable_notification}}
- <pre>Тип: {{type}} {{ label_rus }} {{area}}/{{score}}%
- id: {{id}}
- Дата: {{datetime}}</pre>
- action: telegram_bot.send_photo
- trace:
- stored_traces: 50
- max: 20
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement