ep1cman/unifi-protect-backup

Setting option to ignore cameras still downloads events for those cameras

Closed this issue · 5 comments

  • Unifi Protect Backup version: 0.9.1
  • Unifi Protect version: 2.7.34
  • Python version: 3.10.6
  • Operating System: Ubuntu 22.04 (in WSL)
  • Are you using a docker container or native?: Native

Description

When using multiple --ignore-camera options to try and export footage from just one camera, all cameras still had their footage exported when the command was first run.

What I Did

unifi-protect-backup --address 192.168.1.1 --username myuser --password mypassword --ignore-camera 6274df2e0287700387001540 --ignore-camera 61249146028ca703870003ee --ignore-camera 6274daf702e1700387001506 --ignore-camera 61249146026da703870003ed --ignore-camera 6274e2b3031570038700158d --rclone-destination test:/Videos/unifi-test --no-verify-ssl

Could you share a startup log with the verbosity set to -vv

2023-05-21 11:12:00 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup_core :  Config:
2023-05-21 11:12:00 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup_core :    address='192.168.1.1'
2023-05-21 11:12:00 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup_core :    port=443
2023-05-21 11:12:00 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup_core :    username='homeassistant'
2023-05-21 11:12:00 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup_core :    password=REDACTED
2023-05-21 11:12:00 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup_core :    verify_ssl=False
2023-05-21 11:12:00 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup_core :    rclone_destination='test:/Videos/unifi-test'
2023-05-21 11:12:00 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup_core :    retention='7d'
2023-05-21 11:12:00 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup_core :    rclone_args=''
2023-05-21 11:12:00 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup_core :    rclone_purge_args=''
2023-05-21 11:12:00 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup_core :    ignore_cameras=('6274df2e0287700387001540', '61249146028ca703870003ee', '6274daf702e1700387001506', '61249146026da703870003ed', '6274e2b3031570038700158d')
2023-05-21 11:12:00 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup_core :    verbose=2
2023-05-21 11:12:00 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup_core :    detection_types=['motion', 'person', 'vehicle', 'ring']
2023-05-21 11:12:00 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup_core :    file_structure_format='{camera_name}/{event.start:%Y-%m-%d}/{event.end:%Y-%m-%dT%H-%M-%S} {detection_type}.mp4'
2023-05-21 11:12:00 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup_core :    sqlite_path='events.sqlite'
2023-05-21 11:12:00 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup_core :    download_buffer_size=512.0MiB
2023-05-21 11:12:00 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup_core :    purge_interval='1d'
2023-05-21 11:12:00 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup_core :    apprise_notifiers=()
2023-05-21 11:12:00 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup_core :    skip_missing=False
2023-05-21 11:12:00 [   INFO    ] unifi_protect_backup.unifi_protect_backup_core :  Starting...
2023-05-21 11:12:00 [   INFO    ] unifi_protect_backup.unifi_protect_backup_core :  Checking rclone configuration...
2023-05-21 11:12:00 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup_core :  rclone found: /usr/bin/rclone
2023-05-21 11:12:00 [EXTRA_DEBUG] unifi_protect_backup.utils                 :  stdout:
	test:
2023-05-21 11:12:00 [EXTRA_DEBUG] unifi_protect_backup.utils                 :  stderr:
	2023/05/21 11:12:00 DEBUG : rclone: Version "v1.62.2" starting with parameters ["rclone" "listremotes" "-vv"]
	2023/05/21 11:12:00 DEBUG : Using config file from "/home/alex/.config/rclone/rclone.conf"
	2023/05/21 11:12:00 DEBUG : rclone: Version "v1.62.2" finishing with parameters ["rclone" "listremotes" "-vv"]
2023-05-21 11:12:00 [EXTRA_DEBUG] unifi_protect_backup.utils                 :  stdout:
	
2023-05-21 11:12:00 [EXTRA_DEBUG] unifi_protect_backup.utils                 :  stderr:
	2023/05/21 11:12:00 DEBUG : rclone: Version "v1.62.2" starting with parameters ["rclone" "mkdir" "-vv" "test:/Videos/unifi-test"]
	2023/05/21 11:12:00 DEBUG : Creating backend with remote "test:/Videos/unifi-test"
	2023/05/21 11:12:00 DEBUG : Using config file from "/home/alex/.config/rclone/rclone.conf"
	2023/05/21 11:12:00 DEBUG : smb://alex@stablingyard.localserver:445/Videos/unifi-test: Using root directory "Videos/unifi-test"
	2023/05/21 11:12:00 DEBUG : fs cache: renaming cache item "test:/Videos/unifi-test" to be canonical "test:Videos/unifi-test"
	2023/05/21 11:12:00 DEBUG : smb://alex@stablingyard.localserver:445/Videos/unifi-test: Making directory
	2023/05/21 11:12:00 DEBUG : 4 go routines active
	2023/05/21 11:12:00 DEBUG : smb://alex@stablingyard.localserver:445/Videos/unifi-test: Closing 1 unused connections
2023-05-21 11:12:00 [   INFO    ] unifi_protect_backup.unifi_protect_backup_core :  Connecting to Unifi Protect...
2023-05-21 11:12:01 [   INFO    ] unifi_protect_backup.unifi_protect_backup_core :  Found cameras:
2023-05-21 11:12:01 [   INFO    ] unifi_protect_backup.unifi_protect_backup_core :   - 61249146028ca703870003ee: Birds
2023-05-21 11:12:01 [   INFO    ] unifi_protect_backup.unifi_protect_backup_core :   - 62743ede016c7003870003ef: Trains
2023-05-21 11:12:01 [   INFO    ] unifi_protect_backup.unifi_protect_backup_core :   - 6274df2e0287700387001540: Back yard
2023-05-21 11:12:01 [   INFO    ] unifi_protect_backup.unifi_protect_backup_core :   - 6274daf702e1700387001506: Driveway
2023-05-21 11:12:01 [   INFO    ] unifi_protect_backup.unifi_protect_backup_core :   - 6274e2b3031570038700158d: Shed
2023-05-21 11:12:01 [   INFO    ] unifi_protect_backup.unifi_protect_backup_core :   - 61249146026da703870003ed: Pool
2023-05-21 11:12:01 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup_core :  NVR TZ: Pacific/Auckland
2023-05-21 11:12:01 [   DEBUG   ] unifi_protect_backup.unifi_protect_backup_core :  Local TZ: NZST
2023-05-21 11:12:01 [   INFO    ] unifi_protect_backup.unifi_protect_backup_core :  Starting Tasks...
2023-05-21 11:12:01 [   INFO    ] unifi_protect_backup.downloader            :  Starting Downloader
2023-05-21 11:12:01 [   INFO    ] unifi_protect_backup.uploader              :  Starting Uploader
2023-05-21 11:12:01 [   DEBUG   ] unifi_protect_backup.event_listener        :  Subscribed to websocket

I believe I have identified the issue, the cameras were being ignored in the websocket listener, but not in the periodic check for missed downloads. There should be a new dev container published soon once the CI completes the build. Can you please try that and let me know if the issue has been resolved?

Looks like that change did the trick 😄

Thanks for confirming. I will get this rolled out into a new release asap