SgtBatten / HA_blueprints

Somewhere to store automation blueprints
151 stars 55 forks source link

[Issue]: Notification sent but Presence filter person was home #193

Closed saschabrockel closed 3 months ago

saschabrockel commented 3 months ago

Description

It sends a notification while it should not. The person was at home at this time. It happens randomly sometimes. I cannot see any pattern yet.

Version

0.12.0.2

Automation Config

alias: Kamera - Papa Schlafzimmer - Frigate Notifications (0.12.0.2)
description: ""
use_blueprint:
  path: SgtBatten/Stable.yaml
  input:
    camera: camera.papa_schlafzimmer
    notify_device: 9544dc2deb9ccc0acb20338639131160
    color: red
    icon: mdi:cctv
    button_1: Clip
    button_2: Foto
    button_3: Stumm (30 Min)
    channel: Motion
    title: Bewegung in {{ camera_name }}
    message: >-
      {{ label }} {{ 'ist aktuell' if loitering else 'erkannt' }} - {{
      camera_name }} um {{ now().strftime('%H:%M:%S') }}.
    critical: "true"
    base_url: https://xxx.xxx.de
    loiter_timer: 1
    ios_live_view: true
    notify_group: smartphones
    presence_filter: person.papa

Frigate Config

No response

Any other relevant information

No response

saschabrockel commented 3 months ago

The trace log was too long for GitHub: https://pastebin.com/giF01xVE

SgtBatten commented 3 months ago

One of the updates says loitering was true which does override all other filters.

You could try extending your loitering timer if you are using it, otherwise set it to 0.

saschabrockel commented 3 months ago

Hmm okay that I didn't know.

But is my template incorrect then? It was never saying loitering (or my custom string) for the notification. It always said detected. But I turned it off now to check it.

I think it is because it is only true in the changed_variables.

saschabrockel commented 3 months ago

@SgtBatten you were right but I'm also. The template example given does not work. I have this set up: {{ label }} {{ 'ist aktuell' if loitering else 'erkannt' }} - {{ camera_name }} um {{ now().strftime('%H:%M:%S') }}.

It will always use else. Never 'ist aktuell'. What is wrong with the syntax?

SgtBatten commented 3 months ago

Thanks for checking.

What is wrong with the syntax?

Nothing, it is a flaw with the stable release not updating the message. It would work in the Beta, or you can wait for the next stable version.