ReoLink Video Door Bell Widget

Für welche Projekte verwendet Ihr OpenHAB? Was habt Ihr automatisiert? Stellt eure Projekte hier vor.

Moderatoren: Cyrelian, seppy

Antworten
Sharki
Beiträge: 21
Registriert: 20. Feb 2022 13:56
Answers: 0

ReoLink Video Door Bell Widget

Beitrag von Sharki »

Moin

falls jemand Interesse hat, anbei ein Widget für die ReoLink VideoDoorBell Kamera.
Das Widget stellt ein kleines Video Fenster zur Verfügung.
Dort können Bewegungsalarme bzw. Audioalarme und ein Button zum öffnen der Haustür zur Verfügung gestellt werden.
Wird die Klingel gedrückt öffnet sich ein größeres Popup Fenster mit einem Tür Öffner Button. (getestet auf WinPC und Android Tablet)

Das ganze habe ich aus den zwei Lösungen für
"Open popup/popover by rule or item state" und
dem Widget
"Camera: Clickable thumbnail opens to a larger stream"
zusammengefriemelt. (https://community.openhab.org/)

Es sollte die aktuelle Openhab Version mit dem aktuellen IPCamera Binding (4.1.1) laufen.
Die Video Door Bell sollte automatisch eingebunden werden. Manuell ging bei mir nicht.
Aktuell geht es nur mit User und Password, der Token läuft wohl zeitlich bei der Camera ab und wird nicht erneuert.

Um den Türöffner zu nutzen muss ein entsprechendes Item bestehen. Bei mir eine Shelly Relay. Hier wird auch die Türöffner Zeit eingestellt.
Das Camera Item ist das Gruppenitem der DoorBell.
Audioalarm habe ich nicht getestet.

Ich habe die zwei Stream URLs beibehalten um die Netzlast gering zu halten. Autofps wird alle 10 sec erneuert.

Die Popupzeit des Fensters liegt bei 10 sec. Das ist die Alarmzeit der Camera.
Wer längere Zeiten haben möchte kann in den Metadaten den Expiration Timer setzen.
Ich habe versucht ohne Rule und Script auszukommen um die Sache einfach zu halten.

Zur Audio Integration bin ich nicht weitergekommen. (Gegensprechen)

Code: Alles auswählen

uid: VideoDoorBellCamera
tags:
  - ReoLink Door Bell
props:
  parameters:
    - description: "example: http://openhab(IP):8080/ipcamera/uniqueID/autofps.mjpeg"
      label: Thumbnail URL
      name: thumbnailURL
      required: true
      type: TEXT
    - description: "example: http://openhab(IP):8080/ipcamera/uniqueID/snapshots.mjpeg"
      label: Stream URL
      name: streamURL
      required: true
      type: TEXT
    - context: item
      label: Select the Camera to Control
      name: camera
      required: true
      type: TEXT
    - label: Show Equipment Controls
      name: showSettings
      required: true
      type: BOOLEAN
    - label: Show Audio Alarms
      name: showAudioAlarms
      required: true
      type: BOOLEAN
    - label: Show Motion Alarms
      name: showMotionAlarms
      required: true
      type: BOOLEAN
    - context: item
      label: item open door
      name: opendoorItem
      required: true
      type: TEXT
timestamp: Jan 21, 2024, 8:16:46 PM
component: f7-card
config:
  style:
    --f7-card-margin-horizontal: 0px
    height: 16rem
    width: 21rem
slots:
  default:
    - component: oh-image-card
      config:
        lazy: true
        titel: Haustür
        url: =props.thumbnailURL
        style:
          border-radius: 10px
          margin: 0px
          width: 100%
    - component: oh-button
      config: {}
      slots:
        default:
          - component: f7-popup
            config:
              closeByBackdropClick: true
              opened: '=(items[props.camera + "_Door_Bell"].state === "ON") ? true : false'
              tabletFullscreen: false
            slots:
              default:
                - component: oh-image-card
                  config:
                    borders: true
                    height: 500px
                    title: Besucher
                    url: =props.streamURL
                - component: oh-button
                  config:
                    action: command
                    actionCommand: ON
                    actionItem: =props.opendoorItem
                    fill: true
                    outline: true
                    round: true
                    text: Tür Öffnen
                    style:
                      width: 50%
                      left: 25%
                - component: oh-button
                  config:
                    action: command
                    actionItem: virtualItem
                    actionCommand: OFF
                    style:
                      --f7-button-bg-color: transparent
                      --f7-button-hover-bg-color: transparent
                      --f7-button-pressed-bg-color: transparent
                    height: 100%
                    width: 100%
                    position: absolute
                    left: 0px
                    top: 0px
                    z-index: 999
    - component: f7-card-content
    - component: oh-link
      config:
        action: "=(items[props.opendoorItem].state === 'OFF') ? 'command' : 'NULL'"
        actionCommand: ON
        actionCommandAlt: false
        actionItem: =props.switchItem
        iconF7: "=(items[props.opendoorItem].state === 'ON') ? 'largecircle_fill_circle' : 'largecircle'"
        iconSize: 30
        style:
          color: "=(items[props.opendoorItem].state === 'ON') ? 'red' : 'white'"
          left: 0.2rem
          opacity: "=(items[props.opendoorItem].state === 'ON') ? '1' : '0.5'"
          position: absolute
          top: 0.2rem
        visible: =props.opendoorItem !== undefined
    - component: oh-link
      config:
        action: group
        actionGroupPopupItem: =props.camera
        iconF7: gear_alt
        iconSize: 25
        style:
          color: white
          opacity: 0.4
          position: absolute
          right: 0.2rem
          top: 0rem
        visible: =props.showSettings === true
    - component: oh-link
      config:
        iconF7: '=(items[props.camera + "_Motion_Alarm"].state === "ON") ? "eye" : "eye_slash"'
        iconSize: 18
        visible: =props.showMotionAlarms === true
        style:
          color: '=(items[props.camera + "_Motion_Alarm"].state === "ON") ? "red" : "white"'
          opacity: '=(items[props.camera + "_Motion_Alarm"].state === "ON") ? "1" : "0.5"'
          position: absolute
          left: 3rem
          top: 0.4rem
    - component: oh-link
      config:
        iconF7: '=(items[props.camera + "_Audio_Alarm"].state === "ON") ? "speaker_3" : "speaker_slash"'
        iconSize: 18
        visible: =props.showAudioAlarms === true
        style:
          color: '=(items[props.camera + "_Audio_Alarm"].state === "ON") ? "red" : "white"'
          opacity: '=(items[props.camera + "_Audio_Alarm"].state === "ON") ? "1" : "0.5"'
          position: absolute
          left: 5rem
          top: 0.5rem
Viel Spass.

Grüße Hajo
openHAbian auf einem Raspi 4
openHAB 4.1.1

sauerjo
Beiträge: 17
Registriert: 29. Jan 2022 18:16
Answers: 0

Re: ReoLink Video Door Bell Widget

Beitrag von sauerjo »

Moin,

das ist ja mal geil danke für die Bereitstellung.
Welche URLs hast du verwendet?
Bei mir klappt noch gar nichts.
Bei Select the Camera to Control wüsste ich nicht welches Item ich dort angeben soll.
Kannst du vlt. erläutern was du dort alles eingetragen hast?

Danke und beste Grüße

Hoggle
Beiträge: 217
Registriert: 16. Dez 2017 10:49
Answers: 0

Re: ReoLink Video Door Bell Widget

Beitrag von Hoggle »

Ich habe 1 Frage (eigentlich hunderte, aber ich fange klein an):

- Wo wird die Zeit definiert, die momentan auf 10 Sekunden gesetzt sein sollte?
RPI4/8GB RAM mit openhabian (bullseye) - Kernel Linux 6.1.21-v8+ - openhab 4.0.2 - Release Build - HM-CCU3 - ZWave UZB-USB Stick - Wifi-LED-Stripes - Logitech Harmony Hub - AVM Fritzbox - Enigma2-Box - Gardena HUB - Fronius-Binding - Miele@Home

Antworten