I have been trying to get the following automation to trigger:
alias: Person in Garage
description: Person detected in garage
triggers:
- trigger: mqtt
topic: frigate/events
payload: "True"
value_template: >
{{ payload_json['type'] == 'end' }}
actions:
- action: notify.mobile_app_doug_12
data:
message: >-
Person detected in garage. Type: {{ trigger.payload_json['type'] }}
Label: {{ trigger.payload_json['after']['label'] }}
mode: single
However, it never fires unless I remove the payload and value_template lines. If I ever get it working, I will add a couple more conditions to the value_template, and it should evaluate to True if all the conditions are true. All the conditions will inspect the mqtt payload.
You are correct, i pasted the wrong version of the template in. Fixed.
payload: “True” does not work, as I need the script to trigger only when trigger.payload_json['type'] is true (and once that is working, if the source is from a specific camera which will be another condition).