Closed divemasterjm closed 1 year ago
Right, most likely in this case the object is being detected earlier and the new
message does not have any zones in the after
part.
I'd suggest removing the new condition and adding a this condition
condition: template
value_template: >-
{{ ["calle"]|select("in",
trigger.payload_json["before"]["entered_zones"])|list|length == 0 }}
enabled: true
Right, most likely in this case the object is being detected earlier and the
new
message does not have any zones in theafter
part.I'd suggest removing the new condition and adding a this condition
condition: template value_template: >- {{ ["calle"]|select("in", trigger.payload_json["before"]["entered_zones"])|list|length == 0 }} enabled: true
so i delete the new condition and leave only
condition: template value_template: >- {{ ["calle"]|select("in",trigger.payload_json["before"]["entered_zones"])|list|length == 0 }}
in this case it will fire also on update, so i will get more fired automations
so i delete the new condition and leave only
check what I said, I am suggesting you have 2 conditions
- condition: template
value_template: >-
{{ ["calle"]|select("in",
trigger.payload_json["before"]["entered_zones"])|list|length == 0 }}
enabled: true
- condition: template
value_template: >-
{{ ["calle"]|select("in",
trigger.payload_json["after"]["entered_zones"])|list|length > 0 }}
enabled: true
in this case it will fire also on update, so i will get more fired automations
no, you won't. entered_zones
is a list of all the zones the object has ever entered. By checking that the before.entered_zones
is empty and after.entered_zones
has your zone you are ensuring that you only get notified the first time the object is considered inside the zone
{{ ["calle"]|select("in", trigger.payload_json["before"]["entered_zones"])|list|length == 0 }}
i tried and i've got 2 messages.
Did you include the second condition too?
Did you include the second condition too?
yes
Then most likely it was two different objects that were detected. You can get the MQTT payloads from the automation trace in HA ui
Then most likely it was two different objects that were detected. You can get the MQTT payloads from the automation trace in HA ui
if i add {{ trigger.payload_json['type'] != 'update'}} then i have only one
Different things can happen each time, it's best to use the traces to understand what exactly happened and change the automation.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Describe the problem you are having
in 0.13 beta 1, when in camera config zones are defined ha automation is not receiving new message. in mqttexplorer also new message isn't received but frigate event in frigate is ok.
Version
0.13 beta 1
Frigate config file
Relevant log output
FFprobe output from your camera
Frigate stats
No response
Operating system
Debian
Install method
Docker Compose
Coral version
USB
Network connection
Wired
Camera make and model
dahua
Any other information that may be helpful
ha automation
alias: evento frigate calle description: "" trigger: