Backup Strategies

Backup Strategies#

1. Backrest & Restic Google Drive Backup#

Encrypts TrueNAS/DSM network shares with Restic and stores them in Google Drive through Rclone. See Backrest & Restic Google Drive Backup Setup.

2. Proxmox PBS Backup to Google Drive#

Synchronizes the deduplicated PBS datastore from the UNAS-Pro NAS to Google Drive through MMDocker and Rclone. See Proxmox - PBS Backups via NAS with to GDrive.

3. UNAS-Pro to TrueNAS Rsync Pull Backups#

TrueNAS nodes pull shared data from UNAS-Pro on staggered hourly schedules into local ZFS datasets. See Unifi UNAS-Pro Backup Strategy.

Frigate Installation Project Plan

Frigate Installation Project Plan#

codex resume 01a010cc-f385-7fb1-bda6-375f3a85e303

UniFi Protect remains the primary NVR. Frigate will be an additional detection and classification layer. No installation or configuration should begin until the read-only validation phase is complete.

1. Project Objectives#

1.1 Functional Objectives#

The system will detect animals using Frigate motion detection, object detection, tracking, and zones.

It will distinguish coyotes from chickens, dogs, cats, deer, raccoons, foxes, and unknown animals. The initial tuning priority is avoiding missed coyote detections; false positives can be reduced afterward.

Home Assistant - Local AI Camera Detection Documentation

Local AI Camera Detection Documentation#

codex resume 01a01163-4a3e-7cd2-b780-30eef5e8f62d Continuation: codex resume 01a01b8f-a60c-7f01-9173-c4c189929d3b

This document describes the working local visual-classification implementation and the information required to recreate it. It is documentation, not a task list.

1. Purpose and Design Principles#

1.1 Purpose#

The system adds a second-stage visual classifier to the existing UniFi Protect and Home Assistant installation.

UniFi Protect remains responsible for recording video and detecting broad event categories such as animal, person, or vehicle. Home Assistant receives the Protect event, obtains an image, sends it to a local vision-capable Ollama model, evaluates the structured result, records the decision, and sends a notification only when the objective-specific policy accepts the result.

Home Assistant - Stale & Unavailable Devices Cleanup Checklist

Home Assistant - Stale & Unavailable Devices Cleanup#

This checklist tracks all stale, orphaned, and currently unavailable entities in Home Assistant grouped by physical/virtual device. Use the interactive checkboxes (- [ ]) to track your manual cleanup in the Home Assistant UI or via SSH.

Summary Stats:

  • Total Devices / Groups: 5
  • Total Affected Entities: 21
  • Stale Restored Entities (Registry Orphans / Deprecated): 10
  • Currently Unavailable Entities (Offline Hardware / Connection Loss): 11

Cleanup Methods#

  1. UI Deletion (Recommended for Stale / Orphaned Entities):
    • Go to Settings > Devices & Services > Entities.
    • Filter by Status: Restored / Unavailable or search the entity ID.
    • Select the checkbox next to the entity and click Delete Selected (red button at top).
  2. Device / Integration Reconfiguration:
    • If an entire device is decommissioned (e.g. old Meross Coop Door opener replaced by ESPHome), go to Settings > Devices & Services > [Integration] > Devices, click the 3 dots on the device card, and click Delete.
  3. Companion App Cleanup:
    • On mobile devices, disable unused tracking sensors in HA App Settings > Companion App > Manage Sensors to remove them cleanly.

1. Meross Smart Plugs, Switches & Openers (1 Devices, 2 Entities)#

  • Garage Driveway Lights (Meross Dimmer) (Garage — 2 entities — Unavailable / Offline)
    • light.garage_driveway_lights_meross_dimmerGarage Driveway Lights (Meross Dimmer) (light) — 🔴 Offline / Unavailable
    • sensor.garage_driveway_lights_meross_dimmer_signal_strengthGarage Driveway Lights (Meross Dimmer) - signal_strength (sensor) — 🔴 Offline / Unavailable

2. Aqara, Zigbee & Matter Sensors (3 Devices, 17 Entities)#

  • Aqara Motion Sensor (No Area — 5 entities — Stale Restored)

UniFi VPN Management

UniFi VPN Management#

1 OpenVPN#

1.1 Client Profile#

The verified iPhone client uses OpenVPN Connect with these settings:

  • Profile name: marcoue.ddns.net [OpenVPN Server]
  • Server hostname: marcoue.ddns.net
  • Username: marcoue
  • Password: Saved in the OpenVPN client; do not document it here.
  • DDNS provider: No-IP (ddns.net)

The profile uses the hostname rather than a fixed IP, so the iPhone profile normally does not need to be edited when the ISP address changes.

The OpenVPN listening port and the exact UniFi port-forward rule were not captured in the available documentation. Verify those values in the UniFi Network application if the VPN still fails after DNS is corrected.

Synology Administration Guide

Synology Administration Guide#

1 Syncthing Deployment#

1.1 Synology DSM Implementation (Docker)#

  1. Inotify Limit:
    echo "fs.inotify.max_user_watches=204800" | sudo tee -a /etc/sysctl.d/90-override.conf
    sudo sysctl -p /etc/sysctl.d/90-override.conf
  2. User IDs: Use Task Scheduler to run id > /volume1/docker/id.txt to find UID/GID (e.g., 1027/100).
  3. Docker Compose Highlights:
    environment:
      - PUID=1027
      - PGID=100
      - TZ=America/New_York
    volumes:
      - ./config:/config
      - /volume2/HP3Storage:/volume2/HP3Storage

1.2 Standard .stignore Patterns#

Create a .stignore file in the root of the sync folder:

(?i)#recycle
@eaDir
.DS_Store
.stfolder
.stignore
$RECYCLE.BIN
Thumbs.db
Desktop.ini
.SynologyWorkingDirectory

2 Storage & Maintenance Commands#

2.1 iPerf3#

sudo -i
synogear install
iperf3 -s -p 11111

2.2 Locked Folder Cleanup#

Remove Synology metadata directories when cleaning up a locked folder:

Linux - Aliases

Linux - Aliases#

Quick Setup (Apply Aliases to Any Linux Machine):

  1. Open your bash configuration file:
    nano ~/.bashrc
  2. Append the following alias block to the bottom of the file:
    # --- Homelab Linux Aliases ---
    # System Listings
    alias ll='ls -alF'
    alias la='ls -A'
    alias l='ls -CF'
    
    # Docker & Docker Compose
    alias up='docker compose up'
    alias down='docker compose down'
    alias clean='docker system prune --all --volumes'
    
    # 1Password CLI Compose Integration
    alias 1p='op whoami >/dev/null 2>&1 || eval $(op signin); op run --env-file=".env" -- docker compose up'
    
    # Hugo Site Publishing (NAS-Mounted Scripts)
    alias push='bash /mnt/Software/Software/Scripts/Linux/publish-hugo-homelab.sh && tail -f /home/marc/hugo/homelab/logs/publish-hugo-homelab.log'
    alias pushgen='bash /mnt/Software/Software/Scripts/Linux/publish-hugo-gendash.sh && tail -f /home/marc/hugo/gendash/logs/publish-hugo-gendash.log'
    # -----------------------------
  3. Save, exit, and reload the configuration:
    source ~/.bashrc

1. Core Alias Reference#

These aliases are designed to standardise navigation, Docker compose stacks, and Hugo website publishing across Linux servers.

Home Assistant & UniFi Device Management Standard

📱 Home Assistant & UniFi Device Management Standard#

1. Executive Summary & Architecture#

This document defines the Single Source of Truth (SSOT) Device Management Architecture for the Homelab environment.

To optimize speed, usability, and data integrity:

  1. Google Sheets serves as the Primary User Entry Interface. Adding or editing devices in the spreadsheet is fast, accessible on mobile/desktop, and requires zero complex IPAM UI navigation.
  2. NetBox (v4.2) serves as the Automated IPAM & DCIM System of Record. It is hosted on 10.1.2.202:8082 and reconciled directly from Google Sheets via terminal alias.
flowchart LR
    A["Google Sheets (User Entry)"] -->|Mac Studio Alias: netbox| B["sync_gsheets_to_netbox.py"]
    B -->|Non-Destructive Delta Sync| C["NetBox v4.2 (10.1.2.202:8082)"]
    C -->|API & Interoperability| D["UniFi UDM / Home Assistant / Pi-hole"]

2. Standard Operating Procedure (SOP) for Device Management#

A. Adding or Editing Devices#

  1. Open the Google Sheet inventory (Devices tab).
  2. Add or edit any row (Location, Name, Serial, MAC, IP, Type, Brand).
  3. Open your Mac Studio terminal and type:
    netbox
  4. Outcome: The script fetches your spreadsheet, securely sends the inventory to NetBox on 10.1.2.202:8082, and updates your network records in seconds.

B. Retiring or Deleting a Device#

  • Option 1 (Archive / Keep Record): Change the Location column in Google Sheets to Z-Inactive.
    • Behavior: The sync script automatically skips all Z-Inactive rows during import, removing the device from active NetBox IPAM while preserving historical records in your spreadsheet.
  • Option 2 (Permanent Delete): Delete the row from the Google Sheet and run netbox.

3. Work Completed#

During the system implementation, the following key engineering milestones were achieved:

Mac OS - Aliases Management

Mac OS - Aliases Management#

Quick Restore (Workstation Rebuild):

  1. Clone your scripts: git clone git@github.com:marcoue/Scripts.git ~/Scripts
  2. Run the restore script: source ~/Scripts/MacOS/Aliases/MacOS_Aliases_restore.sh
  3. Retrieve local secrets from your 1Password Homelab Vault under the entry Mac OS .zshrc file and copy them into your local ~/.zshrc (Edit using: nano ~/.zshrc).
  4. Refresh your shell configuration to apply the new tokens: source ~/.zshrc.

Related Recovery Guides: Master Checklist: Mac OS - Recovery | Packages Sync: Mac OS - Brewfile | Repository Standard: Scripts Mangement.

Mac OS - Brewfile

Mac OS - Brewfile#

Daily Sync Shortcuts (Keep Computers Mirrored):

  • Run pushbrew on the machine where you just installed/removed software to scan your system, update the Brewfile, and push it to GitHub.
  • Run pullbrew on your other workstations to pull the update and automatically install/clean up your packages to match.

Quick Restore & Sync (Workstation Rebuild):

  • To Restore (New Computer):
    1. Install Homebrew (if missing): /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    2. Clone scripts: git clone git@github.com:marcoue/Scripts.git ~/Scripts
    3. Reinstall all software: brew bundle --file=~/Scripts/MacOS/Brew/Brewfile
  • To Sync Updates (Ongoing):
    • Pull latest and clean up local packages: pullbrew

Related Recovery Guides: Master Checklist: Mac OS - Recovery | Shortcut Configuration: Mac OS - Aliases Management | Repository Standard: Scripts Mangement.