diff options
| author | Luke Hoersten <[email protected]> | 2026-04-15 20:00:09 -0500 |
|---|---|---|
| committer | Luke Hoersten <[email protected]> | 2026-04-15 20:00:09 -0500 |
| commit | b271a925364616b2d25d3ea6b6492b7412aaf248 (patch) | |
| tree | 26027dceec4d0306cc445d5530c4e98297194b92 /unifi-protect-viewport | |
| parent | 4ec792319b0cc9ab9aa3410c454f4880515c62c0 (diff) | |
Update all references from doorbell-viewport to unifi-protect-viewport
Diffstat (limited to 'unifi-protect-viewport')
| -rw-r--r-- | unifi-protect-viewport/README.md | 70 | ||||
| -rw-r--r-- | unifi-protect-viewport/defaults/main.yaml | 32 | ||||
| -rw-r--r-- | unifi-protect-viewport/files/unifi-protect-viewport-debug | 34 | ||||
| -rw-r--r-- | unifi-protect-viewport/files/unifi-protect-viewport.py | 30 | ||||
| -rw-r--r-- | unifi-protect-viewport/handlers/main.yaml | 4 | ||||
| -rw-r--r-- | unifi-protect-viewport/tasks/main.yaml | 66 | ||||
| -rw-r--r-- | unifi-protect-viewport/templates/unifi-protect-viewport.env.j2 | 20 | ||||
| -rw-r--r-- | unifi-protect-viewport/templates/unifi-protect-viewport.service.j2 | 10 |
8 files changed, 133 insertions, 133 deletions
diff --git a/unifi-protect-viewport/README.md b/unifi-protect-viewport/README.md index a214cef..c81cd75 100644 --- a/unifi-protect-viewport/README.md +++ b/unifi-protect-viewport/README.md @@ -1,4 +1,4 @@ -# doorbell-viewport +# unifi-protect-viewport Raspberry Pi 4 portrait touchscreen that shows a live UniFi Protect doorbell stream when the doorbell is pressed or the screen is touched. Display backlight @@ -37,7 +37,7 @@ will not work. 1. In UniFi OS, go to **OS Settings → Admins & Users → Users** 2. Click **Add User** 3. Fill in: - - **Username**: choose a service account name (e.g. `doorbell-viewport`) + - **Username**: choose a service account name (e.g. `unifi-protect-viewport`) - **Password**: generate a strong password (store in Ansible Vault) - **Account Type**: Local Access Only 4. Click **Add** @@ -63,7 +63,7 @@ Run these two commands from any machine that can reach the Protect host: ```bash curl -sk -c /tmp/prot.cookies \ -H 'Content-Type: application/json' \ - -d '{"username":"doorbell-viewport","password":"YOUR_PASSWORD"}' \ + -d '{"username":"unifi-protect-viewport","password":"YOUR_PASSWORD"}' \ https://YOUR_PROTECT_HOST/api/auth/login ``` @@ -76,14 +76,14 @@ Output looks like: aabbcc1122334455aabbcc00 UVC-G4-Doorbell Front Door ``` -Copy the ID of the doorbell camera and set it as `doorbell_viewport_camera_id`. +Copy the ID of the doorbell camera and set it as `unifi_protect_viewport_camera_id`. ### Verify access Once the role is deployed: ```bash -doorbell-viewport-debug test-protect +unifi-protect-viewport-debug test-protect ``` --- @@ -117,16 +117,16 @@ Edit the file on the Pi: sudo sed -i 's/$/ video=HDMI-A-1:D/' /boot/firmware/cmdline.txt ``` -The connector name (`HDMI-A-1`) is configurable via `doorbell_viewport_drm_connector` if your hardware uses a different name. The Ansible role manages this automatically. +The connector name (`HDMI-A-1`) is configurable via `unifi_protect_viewport_drm_connector` if your hardware uses a different name. The Ansible role manages this automatically. Then reboot. The HDMI output will be dark at the console from that point on, which is exactly what you want — the display is managed entirely by -doorbell-viewport. +unifi-protect-viewport. Verify mpv can open the DRM device after reboot: ```bash -sudo -u doorbell-viewport mpv --vo=drm --length=3 /dev/zero +sudo -u unifi-protect-viewport mpv --vo=drm --length=3 /dev/zero ``` If it exits without a "device busy" error, DRM access is working. @@ -138,23 +138,23 @@ If it exits without a "device busy" error, DRM access is working. ### host_vars (plain) ```yaml -doorbell_viewport_protect_host: "unifi.lan.example.com" # or IP address -doorbell_viewport_camera_id: "abcdef1234567890abcdef12" -doorbell_viewport_timeout: 45 -doorbell_viewport_touch_match: "" # substring match on evdev device name -doorbell_viewport_prebuffer_mode: "warm" # warm | cold -doorbell_viewport_display_backend: "vcgencmd" # vcgencmd | drm | panel -doorbell_viewport_orientation: 270 # degrees: 90 | 180 | 270 -doorbell_viewport_drm_device: "/dev/dri/card1" # RPi4: card1; RPi3: card0 -doorbell_viewport_drm_connector: "HDMI-A-1" -doorbell_viewport_drm_mode: "848x480" # nearest mode advertised by your display +unifi_protect_viewport_protect_host: "unifi.lan.example.com" # or IP address +unifi_protect_viewport_camera_id: "abcdef1234567890abcdef12" +unifi_protect_viewport_timeout: 45 +unifi_protect_viewport_touch_match: "" # substring match on evdev device name +unifi_protect_viewport_prebuffer_mode: "warm" # warm | cold +unifi_protect_viewport_display_backend: "vcgencmd" # vcgencmd | drm | panel +unifi_protect_viewport_orientation: 270 # degrees: 90 | 180 | 270 +unifi_protect_viewport_drm_device: "/dev/dri/card1" # RPi4: card1; RPi3: card0 +unifi_protect_viewport_drm_connector: "HDMI-A-1" +unifi_protect_viewport_drm_mode: "848x480" # nearest mode advertised by your display ``` ### host_vars (vault) ```yaml -vault_doorbell_viewport_protect_username: "doorbell-viewport" -vault_doorbell_viewport_protect_password: "secret" +vault_unifi_protect_viewport_protect_username: "unifi-protect-viewport" +vault_unifi_protect_viewport_protect_password: "secret" ``` Create and encrypt the vault file: @@ -173,7 +173,7 @@ Uses `vcgencmd display_power 0/1` (Raspberry Pi firmware command). Cuts the HDMI signal. Displays that support DPMS will cut their backlight. ```yaml -doorbell_viewport_display_backend: "vcgencmd" +unifi_protect_viewport_display_backend: "vcgencmd" ``` ### drm @@ -182,7 +182,7 @@ Writes `0` / `max_brightness` to the first device under `/sys/class/backlight/`. Use when the display exposes a sysfs backlight node. ```yaml -doorbell_viewport_display_backend: "drm" +unifi_protect_viewport_display_backend: "drm" ``` Check available devices on the Pi: `ls /sys/class/backlight/` @@ -195,7 +195,7 @@ label would be confusing. ### Testing ```bash -doorbell-viewport-debug test-display # on -> 3s -> off +unifi-protect-viewport-debug test-display # on -> 3s -> off ``` --- @@ -209,7 +209,7 @@ framebuffer while the display stays off. Activation just turns on the backlight — essentially zero latency. The live frame is already there. ```yaml -doorbell_viewport_prebuffer_mode: "warm" +unifi_protect_viewport_prebuffer_mode: "warm" ``` ### cold @@ -219,7 +219,7 @@ activation latency (stream connect + first keyframe decode). Use as fallback if warm mode causes problems (power draw, memory pressure). ```yaml -doorbell_viewport_prebuffer_mode: "cold" +unifi_protect_viewport_prebuffer_mode: "cold" ``` --- @@ -229,14 +229,14 @@ doorbell_viewport_prebuffer_mode: "cold" The daemon discovers the touch device via evdev at startup and re-discovers it automatically if it disappears and re-enumerates (e.g. USB replug). -If `doorbell_viewport_touch_match` is set, the daemon matches on any device +If `unifi_protect_viewport_touch_match` is set, the daemon matches on any device whose name contains that substring (case-insensitive). Otherwise it finds the first device advertising `ABS_MT_POSITION_X` (multitouch absolute position). To find the right match string for your display: ```bash -doorbell-viewport-debug test-touch +unifi-protect-viewport-debug test-touch ``` Example output: @@ -245,7 +245,7 @@ Example output: ``` ```yaml -doorbell_viewport_touch_match: "waveshare" +unifi_protect_viewport_touch_match: "waveshare" ``` --- @@ -253,12 +253,12 @@ doorbell_viewport_touch_match: "waveshare" ## Debug Commands ```bash -doorbell-viewport-debug show # turn display on -doorbell-viewport-debug hide # turn display off -doorbell-viewport-debug test-display # power cycle: on -> 3s -> off -doorbell-viewport-debug test-touch # list touch devices -doorbell-viewport-debug test-stream # fetch RTSP URL and play via mpv -doorbell-viewport-debug test-protect # verify Protect API + camera info +unifi-protect-viewport-debug show # turn display on +unifi-protect-viewport-debug hide # turn display off +unifi-protect-viewport-debug test-display # power cycle: on -> 3s -> off +unifi-protect-viewport-debug test-touch # list touch devices +unifi-protect-viewport-debug test-stream # fetch RTSP URL and play via mpv +unifi-protect-viewport-debug test-protect # verify Protect API + camera info ``` --- @@ -266,7 +266,7 @@ doorbell-viewport-debug test-protect # verify Protect API + camera info ## Logs ```bash -journalctl -u doorbell-viewport -f +journalctl -u unifi-protect-viewport -f ``` --- diff --git a/unifi-protect-viewport/defaults/main.yaml b/unifi-protect-viewport/defaults/main.yaml index e89c04e..f812cf2 100644 --- a/unifi-protect-viewport/defaults/main.yaml +++ b/unifi-protect-viewport/defaults/main.yaml @@ -1,19 +1,19 @@ --- -doorbell_viewport_user: "doorbell-viewport" -doorbell_viewport_protect_host: "" -doorbell_viewport_camera_id: "" -doorbell_viewport_timeout: 45 -doorbell_viewport_touch_match: "" -doorbell_viewport_orientation: 270 -doorbell_viewport_drm_connector: "HDMI-A-1" -doorbell_viewport_drm_device: "/dev/dri/card1" -doorbell_viewport_drm_mode: "" -doorbell_viewport_poe_fan: true -doorbell_viewport_poe_fan_temp0: 60000 -doorbell_viewport_poe_fan_temp1: 70000 -doorbell_viewport_poe_fan_temp2: 80000 -doorbell_viewport_poe_fan_temp3: 85000 +unifi_protect_viewport_user: "unifi-protect-viewport" +unifi_protect_viewport_protect_host: "" +unifi_protect_viewport_camera_id: "" +unifi_protect_viewport_timeout: 45 +unifi_protect_viewport_touch_match: "" +unifi_protect_viewport_orientation: 270 +unifi_protect_viewport_drm_connector: "HDMI-A-1" +unifi_protect_viewport_drm_device: "/dev/dri/card1" +unifi_protect_viewport_drm_mode: "" +unifi_protect_viewport_poe_fan: true +unifi_protect_viewport_poe_fan_temp0: 60000 +unifi_protect_viewport_poe_fan_temp1: 70000 +unifi_protect_viewport_poe_fan_temp2: 80000 +unifi_protect_viewport_poe_fan_temp3: 85000 -# vault_doorbell_viewport_protect_username: — required, set in host_vars -# vault_doorbell_viewport_protect_password: — required, set in host_vars +# vault_unifi_protect_viewport_protect_username: — required, set in host_vars +# vault_unifi_protect_viewport_protect_password: — required, set in host_vars diff --git a/unifi-protect-viewport/files/unifi-protect-viewport-debug b/unifi-protect-viewport/files/unifi-protect-viewport-debug index 1305c13..65f67b0 100644 --- a/unifi-protect-viewport/files/unifi-protect-viewport-debug +++ b/unifi-protect-viewport/files/unifi-protect-viewport-debug @@ -1,5 +1,5 @@ #!/bin/bash -# doorbell-viewport-debug: CLI debug tool +# unifi-protect-viewport-debug: CLI debug tool # # Commands: # show Turn display on @@ -11,7 +11,7 @@ set -e -ENV_FILE="/etc/doorbell-viewport/doorbell-viewport.env" +ENV_FILE="/etc/unifi-protect-viewport/unifi-protect-viewport.env" CMD="${1:-help}" _load_env() { @@ -100,19 +100,19 @@ PYEOF cmd_test_stream() { _load_env - if [ -z "$DOORBELL_VIEWPORT_PROTECT_HOST" ]; then - echo "Error: DOORBELL_VIEWPORT_PROTECT_HOST not set" >&2 + if [ -z "$UNIFI_PROTECT_VIEWPORT_PROTECT_HOST" ]; then + echo "Error: UNIFI_PROTECT_VIEWPORT_PROTECT_HOST not set" >&2 exit 1 fi - echo "Fetching RTSP URL from $DOORBELL_VIEWPORT_PROTECT_HOST..." + echo "Fetching RTSP URL from $UNIFI_PROTECT_VIEWPORT_PROTECT_HOST..." RTSP_URL=$(python3 - <<PYEOF import os, sys, requests, urllib3 urllib3.disable_warnings() -host = os.environ['DOORBELL_VIEWPORT_PROTECT_HOST'] -user = os.environ['DOORBELL_VIEWPORT_PROTECT_USERNAME'] -passwd = os.environ['DOORBELL_VIEWPORT_PROTECT_PASSWORD'] -camera_id = os.environ['DOORBELL_VIEWPORT_CAMERA_ID'] +host = os.environ['UNIFI_PROTECT_VIEWPORT_PROTECT_HOST'] +user = os.environ['UNIFI_PROTECT_VIEWPORT_PROTECT_USERNAME'] +passwd = os.environ['UNIFI_PROTECT_VIEWPORT_PROTECT_PASSWORD'] +camera_id = os.environ['UNIFI_PROTECT_VIEWPORT_CAMERA_ID'] s = requests.Session() s.verify = False r = s.post(f'https://{host}/api/auth/login', @@ -138,7 +138,7 @@ PYEOF echo "(press q to quit)" mpv \ --vo=drm \ - "--video-rotate=${DOORBELL_VIEWPORT_ORIENTATION:-270}" \ + "--video-rotate=${UNIFI_PROTECT_VIEWPORT_ORIENTATION:-270}" \ --fullscreen \ --no-border \ --no-osc \ @@ -149,18 +149,18 @@ PYEOF cmd_test_protect() { _load_env - if [ -z "$DOORBELL_VIEWPORT_PROTECT_HOST" ]; then - echo "Error: DOORBELL_VIEWPORT_PROTECT_HOST not set" >&2 + if [ -z "$UNIFI_PROTECT_VIEWPORT_PROTECT_HOST" ]; then + echo "Error: UNIFI_PROTECT_VIEWPORT_PROTECT_HOST not set" >&2 exit 1 fi python3 - <<PYEOF import os, requests, urllib3 urllib3.disable_warnings() -host = os.environ['DOORBELL_VIEWPORT_PROTECT_HOST'] -user = os.environ['DOORBELL_VIEWPORT_PROTECT_USERNAME'] -passwd = os.environ['DOORBELL_VIEWPORT_PROTECT_PASSWORD'] -camera_id = os.environ['DOORBELL_VIEWPORT_CAMERA_ID'] +host = os.environ['UNIFI_PROTECT_VIEWPORT_PROTECT_HOST'] +user = os.environ['UNIFI_PROTECT_VIEWPORT_PROTECT_USERNAME'] +passwd = os.environ['UNIFI_PROTECT_VIEWPORT_PROTECT_PASSWORD'] +camera_id = os.environ['UNIFI_PROTECT_VIEWPORT_CAMERA_ID'] s = requests.Session() s.verify = False @@ -193,7 +193,7 @@ case "$CMD" in test-stream) cmd_test_stream ;; test-protect) cmd_test_protect ;; help|*) - echo "Usage: doorbell-viewport-debug <command>" + echo "Usage: unifi-protect-viewport-debug <command>" echo "" echo "Commands:" echo " show Turn display on" diff --git a/unifi-protect-viewport/files/unifi-protect-viewport.py b/unifi-protect-viewport/files/unifi-protect-viewport.py index 455a3cd..f5283ae 100644 --- a/unifi-protect-viewport/files/unifi-protect-viewport.py +++ b/unifi-protect-viewport/files/unifi-protect-viewport.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 """ -doorbell-viewport: UniFi Protect doorbell display daemon +unifi-protect-viewport: UniFi Protect doorbell display daemon Connects to UniFi Protect, listens for doorbell ring events, and manages display power + video playback on a Raspberry Pi portrait touchscreen. @@ -13,7 +13,7 @@ Transitions: ring event : IDLE -> ACTIVE (or extend timer if already ACTIVE) touch (idle) : IDLE -> ACTIVE touch (active): ACTIVE -> IDLE (immediate) - timeout : ACTIVE -> IDLE (after doorbell_viewport_timeout seconds) + timeout : ACTIVE -> IDLE (after unifi_protect_viewport_timeout seconds) """ import asyncio @@ -46,7 +46,7 @@ logging.basicConfig( format="%(asctime)s %(levelname)s %(message)s", stream=sys.stdout, ) -log = logging.getLogger("doorbell-viewport") +log = logging.getLogger("unifi-protect-viewport") class State(Enum): @@ -56,16 +56,16 @@ class State(Enum): class Config: def __init__(self): - self.protect_host = os.environ["DOORBELL_VIEWPORT_PROTECT_HOST"] - self.protect_username = os.environ["DOORBELL_VIEWPORT_PROTECT_USERNAME"] - self.protect_password = os.environ["DOORBELL_VIEWPORT_PROTECT_PASSWORD"] - self.camera_id = os.environ["DOORBELL_VIEWPORT_CAMERA_ID"] - self.timeout = int(os.environ.get("DOORBELL_VIEWPORT_TIMEOUT", "45")) - self.touch_match = os.environ.get("DOORBELL_VIEWPORT_TOUCH_MATCH", "") - self.orientation = int(os.environ.get("DOORBELL_VIEWPORT_ORIENTATION", "270")) - self.drm_device = os.environ.get("DOORBELL_VIEWPORT_DRM_DEVICE", "/dev/dri/card1") - self.drm_connector = os.environ.get("DOORBELL_VIEWPORT_DRM_CONNECTOR", "HDMI-A-1") - self.drm_mode = os.environ.get("DOORBELL_VIEWPORT_DRM_MODE", "") + self.protect_host = os.environ["UNIFI_PROTECT_VIEWPORT_PROTECT_HOST"] + self.protect_username = os.environ["UNIFI_PROTECT_VIEWPORT_PROTECT_USERNAME"] + self.protect_password = os.environ["UNIFI_PROTECT_VIEWPORT_PROTECT_PASSWORD"] + self.camera_id = os.environ["UNIFI_PROTECT_VIEWPORT_CAMERA_ID"] + self.timeout = int(os.environ.get("UNIFI_PROTECT_VIEWPORT_TIMEOUT", "45")) + self.touch_match = os.environ.get("UNIFI_PROTECT_VIEWPORT_TOUCH_MATCH", "") + self.orientation = int(os.environ.get("UNIFI_PROTECT_VIEWPORT_ORIENTATION", "270")) + self.drm_device = os.environ.get("UNIFI_PROTECT_VIEWPORT_DRM_DEVICE", "/dev/dri/card1") + self.drm_connector = os.environ.get("UNIFI_PROTECT_VIEWPORT_DRM_CONNECTOR", "HDMI-A-1") + self.drm_mode = os.environ.get("UNIFI_PROTECT_VIEWPORT_DRM_MODE", "") self.rtsp_url = None def log_config(self): @@ -231,7 +231,7 @@ class DoorbellViewport: self._running = True async def run(self): - log.info("doorbell-viewport starting") + log.info("unifi-protect-viewport starting") self.config.log_config() self.display.off() @@ -511,7 +511,7 @@ async def main(): log.info("Shutting down") await viewport.stop_mpv() viewport.display.off() - log.info("doorbell-viewport stopped") + log.info("unifi-protect-viewport stopped") if __name__ == "__main__": diff --git a/unifi-protect-viewport/handlers/main.yaml b/unifi-protect-viewport/handlers/main.yaml index 18fec0f..833cc39 100644 --- a/unifi-protect-viewport/handlers/main.yaml +++ b/unifi-protect-viewport/handlers/main.yaml @@ -1,5 +1,5 @@ --- -- name: restart doorbell-viewport +- name: restart unifi-protect-viewport become: yes - systemd: name="doorbell-viewport.service" state="restarted" daemon_reload="yes" + systemd: name="unifi-protect-viewport.service" state="restarted" daemon_reload="yes" diff --git a/unifi-protect-viewport/tasks/main.yaml b/unifi-protect-viewport/tasks/main.yaml index c0ba715..9a51e0b 100644 --- a/unifi-protect-viewport/tasks/main.yaml +++ b/unifi-protect-viewport/tasks/main.yaml @@ -1,19 +1,19 @@ --- -- name: add doorbell-viewport user +- name: add unifi-protect-viewport user become: yes user: - name: "{{doorbell_viewport_user}}" + name: "{{unifi_protect_viewport_user}}" shell: "/bin/false" system: "yes" create_home: "no" groups: "video,input,render,tty" append: "yes" -- name: allow doorbell-viewport user to control sysfs backlight +- name: allow unifi-protect-viewport user to control sysfs backlight become: yes copy: - dest: "/etc/udev/rules.d/99-doorbell-viewport-backlight.rules" + dest: "/etc/udev/rules.d/99-unifi-protect-viewport-backlight.rules" owner: "root" group: "root" mode: "0644" @@ -27,75 +27,75 @@ group: "video" mode: "0664" -- name: apt install doorbell-viewport dependencies +- name: apt install unifi-protect-viewport dependencies become: yes apt: name="{{item}}" - notify: restart doorbell-viewport + notify: restart unifi-protect-viewport loop: - "mpv" - "python3-evdev" - "python3-requests" - "python3-websockets" -- name: create doorbell-viewport config dir +- name: create unifi-protect-viewport config dir become: yes file: - path: "/etc/doorbell-viewport" + path: "/etc/unifi-protect-viewport" owner: "root" - group: "{{doorbell_viewport_user}}" + group: "{{unifi_protect_viewport_user}}" mode: "0750" state: "directory" -- name: install doorbell-viewport daemon +- name: install unifi-protect-viewport daemon become: yes copy: - src: "doorbell-viewport.py" - dest: "/usr/local/bin/doorbell-viewport" + src: "unifi-protect-viewport.py" + dest: "/usr/local/bin/unifi-protect-viewport" owner: "root" group: "root" mode: "0755" - notify: restart doorbell-viewport + notify: restart unifi-protect-viewport -- name: install doorbell-viewport debug tool +- name: install unifi-protect-viewport debug tool become: yes copy: - src: "doorbell-viewport-debug" - dest: "/usr/local/bin/doorbell-viewport-debug" + src: "unifi-protect-viewport-debug" + dest: "/usr/local/bin/unifi-protect-viewport-debug" owner: "root" group: "root" mode: "0755" -- name: configure doorbell-viewport environment +- name: configure unifi-protect-viewport environment become: yes template: - src: "doorbell-viewport.env.j2" - dest: "/etc/doorbell-viewport/doorbell-viewport.env" + src: "unifi-protect-viewport.env.j2" + dest: "/etc/unifi-protect-viewport/unifi-protect-viewport.env" owner: "root" - group: "{{doorbell_viewport_user}}" + group: "{{unifi_protect_viewport_user}}" mode: "0640" - notify: restart doorbell-viewport + notify: restart unifi-protect-viewport no_log: true -- name: install doorbell-viewport systemd service +- name: install unifi-protect-viewport systemd service become: yes template: - src: "doorbell-viewport.service.j2" - dest: "/lib/systemd/system/doorbell-viewport.service" + src: "unifi-protect-viewport.service.j2" + dest: "/lib/systemd/system/unifi-protect-viewport.service" mode: "0644" - notify: restart doorbell-viewport + notify: restart unifi-protect-viewport - name: configure PoE HAT fan temperature thresholds become: yes blockinfile: path: "/boot/firmware/config.txt" - marker: "# {mark} doorbell-viewport poe fan" + marker: "# {mark} unifi-protect-viewport poe fan" block: | dtoverlay=rpi-poe - dtparam=poe_fan_temp0={{doorbell_viewport_poe_fan_temp0}},poe_fan_temp0_hyst=5000 - dtparam=poe_fan_temp1={{doorbell_viewport_poe_fan_temp1}},poe_fan_temp1_hyst=5000 - dtparam=poe_fan_temp2={{doorbell_viewport_poe_fan_temp2}},poe_fan_temp2_hyst=5000 - dtparam=poe_fan_temp3={{doorbell_viewport_poe_fan_temp3}},poe_fan_temp3_hyst=5000 - when: doorbell_viewport_poe_fan + dtparam=poe_fan_temp0={{unifi_protect_viewport_poe_fan_temp0}},poe_fan_temp0_hyst=5000 + dtparam=poe_fan_temp1={{unifi_protect_viewport_poe_fan_temp1}},poe_fan_temp1_hyst=5000 + dtparam=poe_fan_temp2={{unifi_protect_viewport_poe_fan_temp2}},poe_fan_temp2_hyst=5000 + dtparam=poe_fan_temp3={{unifi_protect_viewport_poe_fan_temp3}},poe_fan_temp3_hyst=5000 + when: unifi_protect_viewport_poe_fan register: fan_result - name: remind to reboot for PoE fan config to take effect @@ -130,6 +130,6 @@ msg: "cmdline.txt updated — reboot {{inventory_hostname}} for fbcon=map:99 to take effect" when: cmdline_result.changed -- name: ensure doorbell-viewport is started +- name: ensure unifi-protect-viewport is started become: yes - systemd: name="doorbell-viewport.service" enabled="yes" state="started" daemon_reload="yes" + systemd: name="unifi-protect-viewport.service" enabled="yes" state="started" daemon_reload="yes" diff --git a/unifi-protect-viewport/templates/unifi-protect-viewport.env.j2 b/unifi-protect-viewport/templates/unifi-protect-viewport.env.j2 index 9fa8830..6d5dc9c 100644 --- a/unifi-protect-viewport/templates/unifi-protect-viewport.env.j2 +++ b/unifi-protect-viewport/templates/unifi-protect-viewport.env.j2 @@ -1,10 +1,10 @@ -DOORBELL_VIEWPORT_PROTECT_HOST={{doorbell_viewport_protect_host}} -DOORBELL_VIEWPORT_PROTECT_USERNAME={{vault_doorbell_viewport_protect_username}} -DOORBELL_VIEWPORT_PROTECT_PASSWORD={{vault_doorbell_viewport_protect_password}} -DOORBELL_VIEWPORT_CAMERA_ID={{doorbell_viewport_camera_id}} -DOORBELL_VIEWPORT_TIMEOUT={{doorbell_viewport_timeout}} -DOORBELL_VIEWPORT_TOUCH_MATCH={{doorbell_viewport_touch_match}} -DOORBELL_VIEWPORT_ORIENTATION={{doorbell_viewport_orientation}} -DOORBELL_VIEWPORT_DRM_DEVICE={{doorbell_viewport_drm_device}} -DOORBELL_VIEWPORT_DRM_CONNECTOR={{doorbell_viewport_drm_connector}} -DOORBELL_VIEWPORT_DRM_MODE={{doorbell_viewport_drm_mode}} +UNIFI_PROTECT_VIEWPORT_PROTECT_HOST={{unifi_protect_viewport_protect_host}} +UNIFI_PROTECT_VIEWPORT_PROTECT_USERNAME={{vault_unifi_protect_viewport_protect_username}} +UNIFI_PROTECT_VIEWPORT_PROTECT_PASSWORD={{vault_unifi_protect_viewport_protect_password}} +UNIFI_PROTECT_VIEWPORT_CAMERA_ID={{unifi_protect_viewport_camera_id}} +UNIFI_PROTECT_VIEWPORT_TIMEOUT={{unifi_protect_viewport_timeout}} +UNIFI_PROTECT_VIEWPORT_TOUCH_MATCH={{unifi_protect_viewport_touch_match}} +UNIFI_PROTECT_VIEWPORT_ORIENTATION={{unifi_protect_viewport_orientation}} +UNIFI_PROTECT_VIEWPORT_DRM_DEVICE={{unifi_protect_viewport_drm_device}} +UNIFI_PROTECT_VIEWPORT_DRM_CONNECTOR={{unifi_protect_viewport_drm_connector}} +UNIFI_PROTECT_VIEWPORT_DRM_MODE={{unifi_protect_viewport_drm_mode}} diff --git a/unifi-protect-viewport/templates/unifi-protect-viewport.service.j2 b/unifi-protect-viewport/templates/unifi-protect-viewport.service.j2 index 01cce45..43dfce6 100644 --- a/unifi-protect-viewport/templates/unifi-protect-viewport.service.j2 +++ b/unifi-protect-viewport/templates/unifi-protect-viewport.service.j2 @@ -1,14 +1,14 @@ [Unit] -Description=Doorbell Viewport +Description=UniFi Protect Viewport After=network-online.target Wants=network-online.target [Service] Type=simple -User={{doorbell_viewport_user}} -Group={{doorbell_viewport_user}} -EnvironmentFile=/etc/doorbell-viewport/doorbell-viewport.env -ExecStart=/usr/local/bin/doorbell-viewport +User={{unifi_protect_viewport_user}} +Group={{unifi_protect_viewport_user}} +EnvironmentFile=/etc/unifi-protect-viewport/unifi-protect-viewport.env +ExecStart=/usr/local/bin/unifi-protect-viewport Restart=always RestartSec=5 StandardOutput=journal |
