- id: frigate_alert_any_detection
  alias: Frigate Multi-Camera Motion Alert via MQTT
  description: Send push + email when selected cameras detect motion
  triggers:
  - topic: frigate/events
    trigger: mqtt
  conditions:
  - condition: template
    value_template: '{{ trigger.payload_json[''type''] == ''new'' }}'
  actions:
  - variables:
      camera: '{{ trigger.payload_json[''camera''] }}'
      snapshot_url: '{{ trigger.payload_json[''snapshot''] }}'
  - data:
      title: Frigate Alert
      message: Motion detected on {{ camera }}
      data:
        image: '{{ snapshot_url }}'
    action: notify.mobile_app_pixel_10_pro
  - data:
      title: Frigate Alert
      message: Motion detected on {{ camera }}
      data:
        images:
        - '{{ snapshot_url }}'
    action: notify.maplemail
  mode: single
