Caldin-Maldin

фото, frigate-mqtt

Dec 11th, 2022 (edited)
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. alias: Фиксация движения на улице (фото, frigate-mqtt)
  2. description: ""
  3. trigger:
  4. - platform: mqtt
  5. topic: frigate/events
  6. payload: new
  7. value_template: "{{ value_json.type }}"
  8. condition: null
  9. action:
  10. - service: telegram_bot.send_photo
  11. data:
  12. target: xxxxxxxx
  13. url: >
  14. http://192.168.1.13:5000/api/events/{{trigger.payload_json["after"]["id"]}}/snapshot.jpg?bbox=1&crop=1&timestamp=1
  15. caption: |
  16. {% if ((trigger.payload_json["after"]["label"]) == "car")%}
  17. Машина на улице. Время обнаружения {{(trigger.payload_json["after"]["start_time"]) | timestamp_custom("%H-%M") }} {% elif
  18. ((trigger.payload_json["after"]["label"]) == "person")%}
  19. Кто-то на улице. Время обнаружения {{(trigger.payload_json["after"]["start_time"]) | timestamp_custom("%H-%M") }} {% endif %}
  20. - wait_for_trigger:
  21. - platform: mqtt
  22. topic: frigate/events
  23. payload: end
  24. value_template: "{{ value_json.type }}"
  25. - delay:
  26. hours: 0
  27. minutes: 0
  28. seconds: 30
  29. milliseconds: 0
  30. - service: telegram_bot.send_message
  31. data:
  32. message: >-
  33. Видеозапись движения{% if ((trigger.payload_json["after"]["label"]) ==
  34. "car")%} машины {% elif ((trigger.payload_json["after"]["label"]) ==
  35. "person")%} человека {% endif %}в
  36. {{(trigger.payload_json["after"]["start_time"]) |
  37. timestamp_custom("%H-%M") }} часов готова.
  38. target: xxxxxxxx
  39. inline_keyboard:
  40. - Посмотреть видео:/video {{trigger.payload_json['after']['id']}}
  41. mode: single
  42.  
Advertisement
Add Comment
Please, Sign In to add comment