NEWS
Unifi Protect einbinden?
-
Hallo Zusammen,
ich habe mich jetzt hier im Forum durch einige Threads durchgelesen was ich zum Unifi Protect finden konnte. Installiert habe ich den Unifi Protect Adapter 1.0.1. Verbindung ist hergestellt und meine Testkamera ist auch in den Objekten verbunden. Ich komme bei den Daten wie ein Stream und Standbild nicht klar.
Gibt es einen Datenpunkt, wo ich die Daten finde?Ich kapiere auch noch nicht so ganz, wie ich das Skript einbinden kann, welches als Beispiel hinterlegt ist.
// 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; 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); }); } });
Danke für Unterstützung
Marcus