iobroker-community-adapters/ioBroker.unifi-protect

Implementierung Smart Detections?

honk95 opened this issue · 40 comments

Gibt es Bestrebungen Motions von den Smart Detections zu unterscheiden? Die scheinen für Personenerkennung in Verbindung mit G4 Kameras nämlich einen guten Zweck zu tun.

Zusätzliche Frage am Rande: Auch bei den Motions bekomme ich mit dem Telegram Skript scheinbar nicht sämtliche Bewegungen geschickt. Die, die ich bekomme sind aber dann direkt 3-4x vorhanden. Gibt es da Abhilfe?

Hast du irgendwie nen link zu der Beschreibung? Meine Kameras können das wohl nicht :(

Hast du irgendwie nen link zu der Beschreibung? Meine Kameras können das wohl nicht :(

https://help.ui.com/hc/en-us/articles/360056987954-UniFi-Protect-Manage-motion-detection-and-privacy-zones#:~:text=To%20set%20up%20Smart%20Detection,dragging%20them%20with%20your%20cursor.

Einzug gehalten hat das in Protect 1.15.0 für die G4 Kameras:
https://community.ui.com/releases/UniFi-Protect-1-15-0/2dd6ca3b-54ae-4261-a9d2-d4908cb48da1

Und was soll ich sagen: Es funktioniert echt prima. Bis dato hatte ich eigentlich keinen Fehlalarm mehr. Einzig komisch war mal eine erkannte Person außerhalb des festgelegten Bereichs.

Hast du zudem da noch was zu meinen Skript-Problemen für Telegram ausfindig machen können? Mit den Smart Detections, derzeit ja nur Personen aber für mich völlig ausreichend, könnte das eine völlig neue Dimension an Nutzen bekommen - sicher nicht nur für mich :)

An dem Skript bin ich gerade dran, hab das bei mir mal wieder aktiviert und beobachte es die Tage.

Das mit den smart detections schau ich mir an, hoffe ich bekomm das irgendwie hin ohne g4 :D

@honk95

https://HOST/proxy/protect/api/events?end&limit=30&orderDirection=DESC&smartDetectTypes=&start&type=smartDetectZone

kannste darauf mal zugreifen, HOST natürlich anpassen und das ergebnis posten? Das würde mir helfen.

Gruß
Peter

@honk95

https://HOST/proxy/protect/api/events?end&limit=30&orderDirection=DESC&smartDetectTypes=&start&type=smartDetectZone

kannste darauf mal zugreifen, HOST natürlich anpassen und das ergebnis posten? Das würde mir helfen.

Gruß
Peter

Sorry für die späte Antwort. Hier das Ergebnis, hoffe da sind nun keine störenden Absätze drin gelandet!

[{"id":"6006fd37007c900387007440","type":"smartDetectZone","start":1611070771962,"end":1611070788336,"score":95,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5feb0a0503a08003870003fb","partition":null,"thumbnail":"e-6006fd37007c900387007440","heatmap":"e-6006fd37007c900387007440","modelKey":"event"},{"id":"6006f91c00e8900387007427","type":"smartDetectZone","start":1611069721065,"end":1611069734105,"score":14,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5feb0a0503a08003870003fb","partition":null,"thumbnail":"e-6006f91c00e8900387007427","heatmap":"e-6006f91c00e8900387007427","modelKey":"event"},{"id":"6006e02300619003870073b0","type":"smartDetectZone","start":1611063327904,"end":1611063347233,"score":97,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5feb0a0503a08003870003fb","partition":null,"thumbnail":"e-6006e02300619003870073b0","heatmap":"e-6006e02300619003870073b0","modelKey":"event"},{"id":"6006ccea01ad900387007352","type":"smartDetectZone","start":1611058407279,"end":1611058430532,"score":90,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5feb0a0503a08003870003fb","partition":null,"thumbnail":"e-6006ccea01ad900387007352","heatmap":"e-6006ccea01ad900387007352","modelKey":"event"},{"id":"6006ccde01f990038700734b","type":"smartDetectZone","start":1611058395331,"end":1611058409746,"score":94,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5feb0a0503a08003870003fb","partition":null,"thumbnail":"e-6006ccde01f990038700734b","heatmap":"e-6006ccde01f990038700734b","modelKey":"event"},{"id":"6006bb9102369003870072fb","type":"smartDetectZone","start":1611053966420,"end":1611053979836,"score":81,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5feb0a0503a08003870003fb","partition":null,"thumbnail":"e-6006bb9102369003870072fb","heatmap":"e-6006bb9102369003870072fb","modelKey":"event"},{"id":"6006a09901c4900387007278","type":"smartDetectZone","start":1611047062243,"end":1611047080431,"score":92,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5feb0a0503a08003870003fb","partition":null,"thumbnail":"e-6006a09901c4900387007278","heatmap":"e-6006a09901c4900387007278","modelKey":"event"},{"id":"6005abbe0173900387006e19","type":"smartDetectZone","start":1610984379208,"end":1610984392665,"score":89,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5feb0a0503a08003870003fb","partition":null,"thumbnail":"e-6005abbe0173900387006e19","heatmap":"e-6005abbe0173900387006e19","modelKey":"event"},{"id":"6005aaa000db900387006e0b","type":"smartDetectZone","start":1610984093073,"end":1610984106862,"score":96,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5feb0a0503a08003870003fb","partition":null,"thumbnail":"e-6005aaa000db900387006e0b","heatmap":"e-6005aaa000db900387006e0b","modelKey":"event"},{"id":"6005970302b7900387006db0","type":"smartDetectZone","start":1610979072571,"end":1610979091729,"score":89,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5feb0a0503a08003870003fb","partition":null,"thumbnail":"e-6005970302b7900387006db0","heatmap":"e-6005970302b7900387006db0","modelKey":"event"},{"id":"600581da0087900387006d4b","type":"smartDetectZone","start":1610973654942,"end":1610973672395,"score":84,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5feb0a0503a08003870003fb","partition":null,"thumbnail":"e-600581da0087900387006d4b","heatmap":"e-600581da0087900387006d4b","modelKey":"event"},{"id":"60057d46005a900387006d2f","type":"smartDetectZone","start":1610972482907,"end":1610972501615,"score":93,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5feb0a0503a08003870003fb","partition":null,"thumbnail":"e-60057d46005a900387006d2f","heatmap":"e-60057d46005a900387006d2f","modelKey":"event"},{"id":"6005739c01bf900387006d00","type":"smartDetectZone","start":1610970009250,"end":1610970031746,"score":97,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5feb0a0503a08003870003fb","partition":null,"thumbnail":"e-6005739c01bf900387006d00","heatmap":"e-6005739c01bf90038700 d00","modelKey":"event"},{"id":"60056fef0076900387006ce9","type":"smartDetectZone","start":1610969067923,"end":1610969083818,"score":92,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5feb0a0503a08003870003fb","partition":null,"thumbnail":"e-60056fef0076900387006ce9","heatmap":"e-60056fef0076900387006ce9","modelKey":"event"},{"id":"60056fa60104900387006ce1","type":"smartDetectZone","start":1610968995075,"end":1610969011756,"score":84,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5feb0a0503a08003870003fb","partition":null,"thumbnail":"e-60056fa60104900387006ce1","heatmap":"e-60056fa60104900387006ce1","modelKey":"event"},{"id":"60056f830212900387006cda","type":"smartDetectZone","start":1610968960407,"end":1610968977261,"score":96,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5feb0a0503a08003870003fb","partition":null,"thumbnail":"e-60056f830212900387006cda","heatmap":"e-60056f830212900387006cda","modelKey":"event"},{"id":"60053a82020c900387006beb","type":"smartDetectZone","start":1610955391293,"end":1610955409314,"score":97,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5feb0a0503a08003870003fb","partition":null,"thumbnail":"e-60053a82020c900387006beb","heatmap":"e-60053a82020c900387006beb","modelKey":"event"},{"id":"6004823100109003870068ad","type":"smartDetectZone","start":1610908205864,"end":1610908220820,"score":89,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5feb0a0503a08003870003fb","partition":null,"thumbnail":"e-6004823100109003870068ad","heatmap":"e-6004823100109003870068ad","modelKey":"event"},{"id":"60047197029890038700684f","type":"smartDetectZone","start":1610903956486,"end":1610903971888,"score":94,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5feb0a0503a08003870003fb","partition":null,"thumbnail":"e-60047197029890038700684f","heatmap":"e-60047197029890038700684f","modelKey":"event"},{"id":"6004717e031e900387006847","type":"smartDetectZone","start":1610903931620,"end":1610903947942,"score":73,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5feb0a0503a08003870003fb","partition":null,"thumbnail":"e-6004717e031e900387006847","heatmap":"e-6004717e031e900387006847","modelKey":"event"},{"id":"60047138033c900387006841","type":"smartDetectZone","start":1610903861549,"end":1610903885716,"score":88,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5feb0a0503a08003870003fb","partition":null,"thumbnail":"e-60047138033c900387006841","heatmap":"e-60047138033c900387006841","modelKey":"event"},{"id":"6004712e03e690038700683e","type":"smartDetectZone","start":1610903851760,"end":1610903869207,"score":81,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5feb0a0503a08003870003fb","partition":null,"thumbnail":"e-6004712e03e690038700683e","heatmap":"e-6004712e03e690038700683e","modelKey":"event"},{"id":"6004519f00b69003870067a5","type":"smartDetectZone","start":1610895772057,"end":1610895796694,"score":96,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5feb0a0503a08003870003fb","partition":null,"thumbnail":"e-6004519f00b69003870067a5","heatmap":"e-6004519f00b69003870067a5","modelKey":"event"},{"id":"60044eaa0150900387006793","type":"smartDetectZone","start":1610895015138,"end":1610895028138,"score":39,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5feb0a0503a08003870003fb","partition":null,"thumbnail":"e-60044eaa0150900387006793","heatmap":"e-60044eaa0150900387006793","modelKey":"event"},{"id":"60044bd30144900387006784","type":"smartDetectZone","start":1610894288066,"end":1610894301077,"score":60,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5feb0a0503a08003870003fb","partition":null,"thumbnail":"e-60044bd30144900387006784","heatmap":"e-60044bd30144900387006784","modelKey":"event"},{"id":"60043ea20251900387006743","type":"smartDetectZone","start":1610890911433,"end":1610890924438,"score":90,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5feb0a0503a08003870003fb","partition":null,"thumbnail":"e-60043ea20251900387006743","heatmap" "e-60043ea20251900387006743","modelKey":"event"},{"id":"60043cc30267900387006738","type":"smartDetectZone","start":1610890432477,"end":1610890448101,"score":90,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5feb0a0503a08003870003fb","partition":null,"thumbnail":"e-60043cc30267900387006738","heatmap":"e-60043cc30267900387006738","modelKey":"event"},{"id":"6004275d02969003870066d3","type":"smartDetectZone","start":1610884954541,"end":1610884967668,"score":84,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5feb0a0503a08003870003fb","partition":null,"thumbnail":"e-6004275d02969003870066d3","heatmap":"e-6004275d02969003870066d3","modelKey":"event"},{"id":"600424ff01319003870066c2","type":"smartDetectZone","start":1610884348096,"end":1610884368399,"score":98,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5feb0a0503a08003870003fb","partition":null,"thumbnail":"e-600424ff01319003870066c2","heatmap":"e-600424ff01319003870066c2","modelKey":"event"},{"id":"6004213d00799003870066ab","type":"smartDetectZone","start":1610883385894,"end":1610883402768,"score":93,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5feb0a0503a08003870003fb","partition":null,"thumbnail":"e-6004213d00799003870066ab","heatmap":"e-6004213d00799003870066ab","modelKey":"event"}]

@honk95
https://HOST/proxy/protect/api/events?end&limit=30&orderDirection=DESC&smartDetectTypes=&start&type=smartDetectZone
kannste darauf mal zugreifen, HOST natürlich anpassen und das ergebnis posten? Das würde mir helfen.
Gruß
Peter

Sorry für die späte Antwort. Hier das Ergebnis, hoffe da sind nun keine störenden Absätze drin gelandet!

Alles gut, das ist perfekt so danke :)

@honk95
https://HOST/proxy/protect/api/events?end&limit=30&orderDirection=DESC&smartDetectTypes=&start&type=smartDetectZone
kannste darauf mal zugreifen, HOST natürlich anpassen und das ergebnis posten? Das würde mir helfen.
Gruß
Peter

Sorry für die späte Antwort. Hier das Ergebnis, hoffe da sind nun keine störenden Absätze drin gelandet!

Alles gut, das ist perfekt so danke :)

Sehr cool, ich bin gespannt ob es klappt. Ehrliche Sache: Die Erkennung ist soooooo viel besser nun. Lediglich nen "Fehlalarm" von ner Person außerhalb meiner Zone - bisschen komisch. Aber keine Tiere, kein Schnee, kein Regen. Schade, dass das nur der 4. Gen zur Verfügung steht, woher die Limitierung rührt weiß ich leider auch nicht. Da man hier vorerst nur Persons schon tagged gehe ich davon aus da kommt noch mehr an "Smarten" Unterscheidungen. Jedenfalls eine perfekte Grundlage um da nun via Skript echt Shots senden zu lassen.

Hiele commented

Seit der 1.17 geht das mit Fahrzeugen auch super :-)

[{"id":"600d64ea001ab9038700053e","type":"smartDetectZone","start":1611490534824,"end":1611490548785,"score":97,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5f0f48230269620387001782","partition":null,"thumbnail":"e-600d64ea001ab9038700053e","heatmap":"e-600d64ea001ab9038700053e","modelKey":"event"},{"id":"600d64d503c3b90387000538","type":"smartDetectZone","start":1611490514772,"end":1611490527157,"score":96,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5f0f48230269620387001782","partition":null,"thumbnail":"e-600d64d503c3b90387000538","heatmap":"e-600d64d503c3b90387000538","modelKey":"event"},{"id":"600d649001fbb90387000530","type":"smartDetectZone","start":1611490445305,"end":1611490455038,"score":78,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5f0f48230269620387001782","partition":null,"thumbnail":"e-600d649001fbb90387000530","heatmap":"e-600d649001fbb90387000530","modelKey":"event"},{"id":"600d57cf011eb903870004e7","type":"smartDetectZone","start":1611487179088,"end":1611487190041,"score":60,"smartDetectTypes":["vehicle"],"smartDetectEvents":[],"camera":"5f0f3287032c62038700170f","partition":null,"thumbnail":"e-600d57cf011eb903870004e7","heatmap":"e-600d57cf011eb903870004e7","modelKey":"event"},{"id":"600d2aed037d340387000f33","type":"smartDetectZone","start":1611475690748,"end":1611475700756,"score":91,"smartDetectTypes":["person"],"smartDetectEvents":

Seit der 1.17 geht das mit Fahrzeugen auch super :-)

[{"id":"600d64ea001ab9038700053e","type":"smartDetectZone","start":1611490534824,"end":1611490548785,"score":97,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5f0f48230269620387001782","partition":null,"thumbnail":"e-600d64ea001ab9038700053e","heatmap":"e-600d64ea001ab9038700053e","modelKey":"event"},{"id":"600d64d503c3b90387000538","type":"smartDetectZone","start":1611490514772,"end":1611490527157,"score":96,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5f0f48230269620387001782","partition":null,"thumbnail":"e-600d64d503c3b90387000538","heatmap":"e-600d64d503c3b90387000538","modelKey":"event"},{"id":"600d649001fbb90387000530","type":"smartDetectZone","start":1611490445305,"end":1611490455038,"score":78,"smartDetectTypes":["person"],"smartDetectEvents":[],"camera":"5f0f48230269620387001782","partition":null,"thumbnail":"e-600d649001fbb90387000530","heatmap":"e-600d649001fbb90387000530","modelKey":"event"},{"id":"600d57cf011eb903870004e7","type":"smartDetectZone","start":1611487179088,"end":1611487190041,"score":60,"smartDetectTypes":["vehicle"],"smartDetectEvents":[],"camera":"5f0f3287032c62038700170f","partition":null,"thumbnail":"e-600d57cf011eb903870004e7","heatmap":"e-600d57cf011eb903870004e7","modelKey":"event"},{"id":"600d2aed037d340387000f33","type":"smartDetectZone","start":1611475690748,"end":1611475700756,"score":91,"smartDetectTypes":["person"],"smartDetectEvents":

Tatsache. Das ist ja der Hammer. Hab in Eile die Tage geupdated aber es noch gar nicht gesehen!

Hiele commented

Screenshot 2021-01-24 141218

Und ihr würdet dann quasi wollen dass man mit einer option z.b. auf smartdetections alleine umstellt und andere motions einfach ignoriert richtig?

Hiele commented

Ja, da a) die Erkennungsrate wirklich sehr gut ist und b) man auf die unterschiedlichen Ereignisse passend reagieren kann.

Also Person in der Auffahrt gibt nur eine Meldung, aber Auto in der Auffahrt öffnet das Tor etc...
Motionevents können auch durch Büsche etc. getriggert werden, Smartevents hingegen sind meiner Erfahrung nach besser für bestimmte Informationen geeignet.

VG Hiele

Da schließe ich mich an. Ich würde sehr gerne zudem auf Telegram weiterschicken. Da braucht dann nicht jeder nen Account und Telegram unterstützt eine Bildvorschau - die Protect-App sagt immer nur "Person erkannt" etc. zeigt aber keinen Snapshot direkt an, dh. muss man sich erst aufschalten.

Hey Zusammen, unter https://github.com/peterbaumert/ioBroker.unifi-protect/tree/smartDetections sollte es nun eine hoffentlich funktionierende version geben. Kann es mangels G4 nicht testen, das müsstet ihr dann machen :)

Nach dem installieren habt ihm in den Einstellungen ein Feld "motionTypes", da könnt ihr entweder eins oder mehrer wählen.
Wenn ihr mir dann Rückmeldungen gebt wäre super. Vergesst auch nicht die neuen Felder bei den Motions anzumachen mit den smartDetections :)

in der neuen Version ist auch Sentry drin was zentral Fehler an mich meldet. da es noch nicht in der readme steht hier die info.

EDIT: wenn ihr das Passwort neu setzen müsst nach der Installation gebt mir bitte bescheid, weiß nicht ob die neue native Verschlüsselung, das neu setzen nochmal erfordert.

Hiele commented

Moin Peter,

soweit so gut, Umfang der Parameter auch bestens, allerdings kann ich die beiden Optionen smartDetectZone und ring nicht anklicken, bzw. aktivieren.

Hatte zwar am Anfang ein paar Fehler, scheinen aber nun weg zu sein.
Starte nacher den Host mal neu und melde mich nochmal!

VG Hiele

unifi-protect.0 2021-01-27 18:45:21.676 error (2403) Not exists unifi-protect.0 2021-01-27 18:45:21.675 error at processTicksAndRejections (internal/process/task_queues.js:97:5) unifi-protect.0 2021-01-27 18:45:21.675 error at runMicrotasks (<anonymous>) unifi-protect.0 2021-01-27 18:45:21.675 error at ObjectsInRedisClient._delObject (/opt/iobroker/node_modules/@iobroker/db-objects-redis/lib/objects/objectsInRedisClient.js:2805:26) unifi-protect.0 2021-01-27 18:45:21.675 error at Object.maybeCallbackWithError (/opt/iobroker/node_modules/iobroker.js-controller/lib/tools.js:2252:17) unifi-protect.0 2021-01-27 18:45:21.675 error (2403) Error: Not exists unifi-protect.0 2021-01-27 18:45:21.666 error (2403) unhandled promise rejection: Not exists unifi-protect.0 2021-01-27 18:45:21.665 error (2403) Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). unifi-protect.0 2021-01-27 18:41:21.491 warn (2403) State "unifi-protect.0.motions.6011a5740078240387000a88.type" has no existing object, this might lead to an error in future versions unifi-protect.0 2021-01-27 18:41:20.688 info (2403) starting. Version 0.0.11 in /opt/iobroker/node_modules/iobroker.unifi-protect, node: v12.19.0, js-controller: 3.2.11 unifi-protect.0 2021-01-27 18:38:35.576 info (2143) Terminated (ADAPTER_REQUESTED_TERMINATION): Without reason unifi-protect.0 2021-01-27 18:38:35.574 info (2143) terminating unifi-protect.0 2021-01-27 18:38:35.573 info (2143) cleaned everything up... unifi-protect.0 2021-01-27 18:38:35.571 info (2143) Got terminate signal TERMINATE_YOURSELF unifi-protect.0 2021-01-27 18:36:33.665 info (2143) starting. Version 0.0.11 in /opt/iobroker/node_modules/iobroker.unifi-protect, node: v12.19.0, js-controller: 3.2.11

Ja diese Fehler habe ich auch zwei drei mal, dann startet er aber. Habe noch nicht 100% gefunden woran das liegt. Bzgl Auswahl muss ich mir nochmal anschauen. Welchen browser nutzt du?

Hiele commented

Firefox 84 teste mal chrome, nach dem Neustart auch keine Änderung, aber auch keine Fehler :-)

Uff, du teste mal nicht auf den text zu klicken sondern bisschen nebendran, ka warum aber das geht bei mir. Sobald ich den Text oder das Kästchen treffe tut sich gar nix.

Hiele commented

Also mit den Pfeiltasten auf ring oder smartDetectZone gehen und mit Enter (nicht Space) auswählen/aktivieren.
Danach erkennt der Adapter zwar keine Änderung, aber wenn man einen anderen Wert ändert dann ja und dann speichert, übernimmt er die Einstellungen!

Also mit den Pfeiltasten auf ring oder smartDetectZone gehen und mit Enter (nicht Space) auswählen/aktivieren.
Danach erkennt der Adapter zwar keine Änderung, aber wenn man einen anderen Wert ändert dann ja und dann speichert, übernimmt er die Einstellungen!

danke fürs testen, muss ich schauen ob ich dieses auswahlfenster gefixt bekomme ( liegt aber denke an dem materialize teil der das baut ) oder ne andere lösung baue. Nun wo du es ausgewählt hast wäre nur noch spannend ob die smartDetections auch ankommen :D

Hiele commented

Nach den Neustart des Adapter kommen folgende Meldungungen im Log:

unifi-protect.0 2021-01-27 19:05:33.119 error (992) Not exists
unifi-protect.0 2021-01-27 19:05:33.117 error (992) Error: Not exists at Object.maybeCallbackWithError (/opt/iobroker/node_modules/iobroker.js-controller/lib/tools.js:2252:17) at ObjectsInRedisClient._delObject (/opt/iobroker/node_modules
unifi-protect.0 2021-01-27 19:05:33.116 error (992) unhandled promise rejection: Not exists
unifi-protect.0 2021-01-27 19:05:33.115 error (992) Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch().
unifi-protect.0 2021-01-27 19:05:33.112 error (992) Not exists
unifi-protect.0 2021-01-27 19:05:33.111 error (992) Error: Not exists at Object.maybeCallbackWithError (/opt/iobroker/node_modules/iobroker.js-controller/lib/tools.js:2252:17) at ObjectsInRedisClient._delObject (/opt/iobroker/node_modules
unifi-protect.0 2021-01-27 19:05:33.110 error (992) unhandled promise rejection: Not exists
unifi-protect.0 2021-01-27 19:05:33.109 error (992) Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch().
unifi-protect.0 2021-01-27 19:05:33.090 error (992) Not exists
unifi-protect.0 2021-01-27 19:05:33.090 error (992) Error: Not exists at Object.maybeCallbackWithError (/opt/iobroker/node_modules/iobroker.js-controller/lib/tools.js:2252:17) at ObjectsInRedisClient._delObject (/opt/iobroker/node_modules
unifi-protect.0 2021-01-27 19:05:33.078 error (992) unhandled promise rejection: Not exists
unifi-protect.0 2021-01-27 19:05:33.077 error (992) Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch().
 

Nach den Neustart des Adapter kommen folgende Meldungungen im Log:

unifi-protect.0 2021-01-27 19:05:33.119 error (992) Not exists
unifi-protect.0 2021-01-27 19:05:33.117 error (992) Error: Not exists at Object.maybeCallbackWithError (/opt/iobroker/node_modules/iobroker.js-controller/lib/tools.js:2252:17) at ObjectsInRedisClient._delObject (/opt/iobroker/node_modules
unifi-protect.0 2021-01-27 19:05:33.116 error (992) unhandled promise rejection: Not exists
unifi-protect.0 2021-01-27 19:05:33.115 error (992) Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch().
unifi-protect.0 2021-01-27 19:05:33.112 error (992) Not exists
unifi-protect.0 2021-01-27 19:05:33.111 error (992) Error: Not exists at Object.maybeCallbackWithError (/opt/iobroker/node_modules/iobroker.js-controller/lib/tools.js:2252:17) at ObjectsInRedisClient._delObject (/opt/iobroker/node_modules
unifi-protect.0 2021-01-27 19:05:33.110 error (992) unhandled promise rejection: Not exists
unifi-protect.0 2021-01-27 19:05:33.109 error (992) Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch().
unifi-protect.0 2021-01-27 19:05:33.090 error (992) Not exists
unifi-protect.0 2021-01-27 19:05:33.090 error (992) Error: Not exists at Object.maybeCallbackWithError (/opt/iobroker/node_modules/iobroker.js-controller/lib/tools.js:2252:17) at ObjectsInRedisClient._delObject (/opt/iobroker/node_modules
unifi-protect.0 2021-01-27 19:05:33.078 error (992) unhandled promise rejection: Not exists
unifi-protect.0 2021-01-27 19:05:33.077 error (992) Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch().

ja die sollten nach 2-3 mal weg sein und er starten, das meinte ich da bin ich noch dran zu schauen was das problem genau ist.

Hiele commented

Ja, hinter dem Text klicken geht

Und ja, ko
SmartDetect
mmt an, Auto kann ich dunkeln noch nicht testen ;-)

Oh super, das freut mich! Jetzt muss ich nur noch die kleinen dummen fehler da irgendwie behoben kommen :D

Hiele commented

DANKE dir!!!

Das auswahl problem ist in der neuesten github version in der smartDetections branch behoben. Das problem mit der Not Exist fehlermeldung sollte mit dem jscontroller 3.2.12 behoben sein.

Hiele commented

Moin Peter,

läuft sehr gut so, Fehler sind soweit weg :-) Danke....

Hui das sieht ja schon klasse aus. Da muss ich mich wohl doch mal zu Testzwecken tiefgründiger in das Telegram-Skript reinfuchsen um jenes entsprechend anzupassen! :)

Ich kam nun endlich auch zu. Mein Log schmeißt zumindest auf Anhieb die folgenden Warnungen:
`

2021-02-20 11:46:54.312 - warn: javascript.0 (10079) getState "unifi-protect.0.motions.lastMotion.camera" not found (3)

2021-02-20 11:46:54.334 - warn: javascript.0 (10079) at Object. (script.js.Kamera_Telegram:14:22)
2021-02-20 11:46:54.335 - warn: javascript.0 (10079) at Object.callback (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1071:38)
2021-02-20 11:46:54.336 - warn: javascript.0 (10079) at Object.stateChange (/opt/iobroker/node_modules/iobroker.javascript/main.js:487:29)
2021-02-20 11:46:54.336 - warn: javascript.0 (10079) at Immediate._onImmediate (/opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:5384:37)
2021-02-20 11:46:54.337 - warn: javascript.0 (10079) at processImmediate (internal/timers.js:461:21)
2021-02-20 11:46:54.337 - warn: javascript.0 (10079) getState "unifi-protect.0.motions.lastMotion.score" not found (3)
2021-02-20 11:46:54.339 - warn: javascript.0 (10079) at Object. (script.js.Kamera_Telegram:15:19)
2021-02-20 11:46:54.339 - warn: javascript.0 (10079) at Object.callback (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:1071:38)
2021-02-20 11:46:54.340 - warn: javascript.0 (10079) at Object.stateChange (/opt/iobroker/node_modules/iobroker.javascript/main.js:487:29)
2021-02-20 11:46:54.340 - warn: javascript.0 (10079) at Immediate._onImmediate (/opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:5384:37)
2021-02-20 11:46:54.341 - warn: javascript.0 (10079) at processImmediate (internal/timers.js:461:21)
2021-02-20 11:46:54.419 - warn: unifi-protect.0 (13814) writeFile will not write this file (/unifi-protect/lastMotion/5feb0a0503a08003870003fb.jpg) in future versions: vis.0 is not an object of type "meta"
2021-02-20 11:46:54.494 - warn: writeFile will not write this file (unifi-protect/lastMotion/5feb0a0503a08003870003fb.jpg) in future versions: vis.0 is not an object of type "meta"
2021-02-20 11:46:55.101 - warn: unifi-protect.0 (13814) writeFile will not write this file (/unifi-protect/lastMotion/5feb0a0503a08003870003fb_snapshot.jpg) in future versions: vis.0 is not an object of type "meta"
2021-02-20 11:46:55.107 - warn: writeFile will not write this file (unifi-protect/lastMotion/5feb0a0503a08003870003fb_snapshot.jpg) in future versions: vis.0 is not an object of type "meta"

`

Hmm und als type bekomme ich nicht "person" sondern "smart detect zone" da bin ich noch nicht ganz durchgestiegen.
Edit: Ausklappen soll helfen.

Hast du vielleicht adhoc parat, wie ich das Telegram-Skript auch entsprechend anpassen müsste? Bevor ich mich da wohl in den kompletten Code als "Laie" reindenke hast du da als "Coder" sicher noch parat, was du da verfasst hast einigermaßen

Hiele commented

Hallo Honk95,

der Typ der Erkennung findest du unter Lastmotion und dann diesen wilden Unterordnern, siehe Bild.
Da würde ich auch dafür plädiern die Info unter lastmotion zu packen, da sonst eine Weiterverarbeitung nicht möglich ist.
Denn diese Unterordnernamen ändern sich ja stetig...

@peterbaumert : Meinst du, du könntest die Typenerkennung mit in lastMotion unterbringen siehe 2. Bild...

VG Hiele

lastMotion
lastMotion2

Hallo Honk95,

der Typ der Erkennung findest du unter Lastmotion und dann diesen wilden Unterordnern, siehe Bild.

Da würde ich auch dafür plädiern die Info unter lastmotion zu packen, da sonst eine Weiterverarbeitung nicht möglich ist.

Denn diese Unterordnernamen ändern sich ja stetig...

@peterbaumert : Meinst du, du könntest die Typenerkennung mit in lastMotion unterbringen siehe 2. Bild...

VG Hiele

lastMotion

lastMotion2

War ja klar dass ich irgendwas vergesse 😂 ja ich versuche das heute abend noch zu machen. Und das mit dem not found schau ich mir an.

iobroker url https://github.com/peterbaumert/ioBroker.unifi-protect/tree/smartDetections oder eben mit dem link ausm github über die gui installieren und mal testen bitte, habe ja leider keine mit SmartDetections. Man kann nun auch bei den einzelnen Kameras bei "lastMotion" das SmartDetection zeug auswählen.

Hiele commented

Noch etwas verwirrend... Soll ich dir nicht eine eine G4 schicken? ;-)

lastMotion3

VG Hiele

haha ja gerne, dann könnte ich das zumindest einfacher bauen :D hm ja ok das ist wirklich komisch. Muss ich mir nochmal anschauen. kannst du mal die Instanz stoppen und alle Objekte löschen und dann wieder starten?

Kannst du nochmal die ausgabe von https://DEINEIP/proxy/protect/api/events?end&limit=30&orderDirection=DESC&start&types=smartDetectZone hier anhängen. Da muss irgendwas anders sein als oben, oder ich verkack noch irgendwas im code ( nicht auszuschließen :D )

Hiele commented

So, 1. Instanz angehalten
2. Objekte gelöscht
3. Instanz neu gestartet

Beim Aufruf des Links bekomme ich ein: Unauthorized

Schick mir mal per PN dein Adresse...

VG Hiele
lastMotion4

So, 1. Instanz angehalten
2. Objekte gelöscht
3. Instanz neu gestartet

Beim Aufruf des Links bekomme ich ein: Unauthorized

Schick mir mal per PN dein Adresse...

VG Hiele
lastMotion4

Ja musst dich erst einmal bei deinem Protect anmelden. Schreib mir ne mail an ioBroker.unifi-protect@outlook.com dann kann ich dir darauf anworten, hier gibts kein PM :D

Hi @Hiele

allererstes mal vielen vielen Dank für das bereitstellen der Hardware!

Ich habe nun einige Änderungen gemacht am code also einmal bitte das hier alles machen:

  • iobroker url https://github.com/peterbaumert/ioBroker.unifi-protect/tree/smartDetections oder eben mit dem link ausm github über die gui installieren
  • Einstellungen in der Instanz überprüfen und sicherstellen, dass auch nur "smartDetectZone" an ist
  • Einstellungen im Tab Cameras prüfen da ich "lastMotion" in "lastMotionEvent" umbenannt habe, da ich sonst einige Probleme bekommen hatte
  • Instanz stoppen
  • alle Objekte löschen
  • Instanz starten

Nun Sollte eigentlich alles mit lastMotion unter Motions stimmen und auch das lastMotionEvent pro Camera.

Als script habe ich bei mir exakt das hier:

// Settings
const path = '/opt/iobroker/tmp/temp.jpg';
const threshold = 50;

// Send to Telegram ( or what you prefer )
function sendImage(path) {
    sendTo('telegram.0', path);
}

//Trigger Script
on({ id: 'unifi-protect.0.motions.lastMotion.thumbnail', change: "ne" }, function () {
    const thumb = getState('unifi-protect.0.motions.lastMotion.thumbnail'/*thumbnail*/).val;
    const end = getState('unifi-protect.0.motions.lastMotion.end'/*thumbnail*/).val;
    const cameraid = getState('unifi-protect.0.motions.lastMotion.camera'/*thumbnail*/).val;
    const score = getState('unifi-protect.0.motions.lastMotion.score'/*thumbnail*/).val;
    const home = getState('geofency.0.atHomeCount'/*atHomeCount*/).val;

    //if (home > 0 /*&& cameraid != '5e71f3d103037d03e70006b9'*/) { return; }
    if (score < threshold) { return; }
    // if Event has ended send the Thumbnail otherwise get current Snapshot
    if (end != null) {
        sendTo('unifi-protect.0', 'getThumbnail', { "thumbnail": thumb, "path": path }, function (res) {
            sendImage(path);
        });
    } else {
        sendTo('unifi-protect.0', 'getSnapshot', { "cameraid": cameraid, "path": path }, function (res) {
            sendImage(path);
        });
    }
});

wichtig ist dass es den pfad gibt und er auf 775 steht mkdir -p /opt/iobroker/tmp && chmod 775 /opt/iobroker/tmp

Kannst es ja mal testen, wenn was nicht passt bin ich auch in dem https://discord.com/invite/HwUCwsH als Pete

Implemented in #22