ich benötige mal Unterstützung.
Ich habe eine neu Reolink Kamera integriert und entsprechend eine Automation erstellt, wenn Bewegung erkannt, eine Benachrichtigung gesendet werden soll.
Für den Snapshot wollte ich dass die Snapshots mit Datum und Uhrezeit gespeichert werden.
Das funktioniert auch.
Wie bekomme ich den Snapshot jetzt in die Benachrichtigung, das immer der letze Shot angezeigt wird?
Das ist der Yaml Code für den Snapshot:
action: camera.snapshot
metadata: {}
data:
filename: >-
www/local/reolink_snapshot/reo_snapshot__{{ now ().year }}_{{ now ().month
}}_{{ now ().day }}_{{ now ().hour }}_{{ now ().minute }}.jpg
target:
device_id: 6a51a442f8dd6458cf41b0221ba7307d
Und hier der Yaml Code für die Benachrichtigung:
action: notify.mobile_app_pixel_8_pro
metadata: {}
data:
message: Bewegung Eingangsbereich detektiert!
title: Bewegungserkennung
data:
image: >-
/www/local/reolink_snapshot/reo_snapshot__{{ now ().year }}_{{ now
().month }}_{{ now ().day }}_{{ now ().hour }}_{{ now ().minute }}.jpg
actions:
- action: URI
title: Live-Blick auf die Kamera
uri: /lovelace/15
priority: high
Der Snapshot wird nicht angezeigt.
Wie muss die Image URL aussehen, das immer der letzte Snapshot angezeigt wird?
Vielen Dank.
Die hab das Anhand Deines YAML angepasst.
URL zum Speichern: /config/www/local/reolink_snapshot/reo_snapshot.jpg
URL für Benachrichtigung: /local/reolink_snapshot/reo_snapshot.jpg
Da dieser Shot ja immer Überschrieben wird noch einen zusätzlichen Shot mit
www/local/reolink_snapshot/reo_snapshot__{{ now ().year }}_{{ now ().month
}}_{{ now ().day }}_{{ now ().hour }}_{{ now ().minute }}.jpg
erstellt.
Vielen Dank
Update:
Ok, ganz so gut funktioniert es nicht.
Der Snapshot in der Benachrichtigung wird nicht aktualisiert.
by HarryP: Zusammenführung Doppelpost (bei Änderungen oder hinzufügen von Inhalten bitte die „Bearbeitungsfunktion“ anstatt „Antworten“ zu nutzen)
Die Ordner sind vorhanden und wenn nicht werden diese automatisch angelegt.
Ich habe das jetzt anders gelöst, anstatt Snapshot greife ich über die Notifikation Api-Url zu.
Mal gucken wie das in der Praxis funktioniert. Im Test ist die Benachrichtigung teilweise gut verzögert.
So sieht meine komplette YAML jetzt aus:
alias: Kamera Bewegungserkennung Benachrichtigung
description: ""
triggers:
- type: motion
device_id: 6a51a442f8dd6458cf41b0221ba7307d
entity_id: f2bc59d2c4a79a38173bf0d47a5f7ac0
domain: binary_sensor
trigger: device
conditions: []
actions:
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
- action: notify.mobile_app_pixel_8_pro
metadata: {}
data:
message: Bewegung wurde erkannt!
title: Bewegungsalarm!
data:
image: /api/camera_proxy/camera.eingangsbereich_standardauflosung
clickAction: /lovelace/15
actions:
- action: URI
title: Live-Blick auf die Kamera
uri: /lovelace/15
priority: high
ttl: 0
importance: high
channel: alarm_stream
enabled: true
- action: camera.snapshot
metadata: {}
data:
filename: |-
www/local/reolink_snapshot/{{ now ().year }}_{{ now
().month }}_{{ now ().day }}_{{ now ().hour }}_{{ now ().minute }}.jpg
target:
device_id: 6a51a442f8dd6458cf41b0221ba7307d
enabled: true
mode: single