Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PTZ and Telegram Components #788

Open
wants to merge 30 commits into
base: dev
Choose a base branch
from
Open

Conversation

smelis
Copy link

@smelis smelis commented Jul 29, 2024

Adds two components:

ptz - adds a PTZ controller component for cameras that support ONVIF (and pan/tilt/zoom).
telegram - adds a Telegram (bot) component that can do a couple of things:

  1. send video recordings of object detection events and
  2. allows for control of the ptz component
  3. on demand recording
  4. start & stop the camera

Config for the ptz component:

ptz:
  cameras:
     camera_1:
       onvif_port: 80 #
       onvif_username: <username>
       onvif_password: <password>
       camera_min_x: -0.73 # used in "patrol" mode to limit swings to useful fov
       camera_max_x: 0.04 # used in "patrol" mode to limit swings to useful fov
       presets: # allows switching between pre-defined positions
         - name: front # name them
           pan: 0.0
           tilt: 0.0
           on_startup: true # have the camera move to this preset when Viseron starts
         - name: left
           pan: -0.5
           tilt: 0.0
         - name: right
           pan: 0.5
           tilt: 0.0
         - name: path_1 # when preset names are repeated, "moving to a preset" will iterate over the preset and follow a path
           pan: -0.5
           tilt: -0.5 
         - name: path_1
           pan: -0.5
           tilt: 0.5 
         - name: path_1
           pan: 0.5
           tilt: 0.5 
         - name: path_1
           pan: 0.5
           tilt: -0.5
         - name: path_1
           pan: -0.5
           tilt: -0.5
         - name: path_1
           pan: 0.0
           tilt: 0.0

Config for the telegram component:

telegram:
  telegram_bot_token: <ask_the_bot_father>
  telegram_chat_ids: [<ids will be logged and sent back in access denied messages>]
  telegram_user_ids: [<ids will be logged and sent back in access denied messages>]
  detection_label: person
  send_detection_thumbnail: true
  send_detection_video: true
  send_detection_message: false
  telegram_log_ids: true
  cameras:
    camera_1:
    camera_2:

Copy link

netlify bot commented Jul 29, 2024

Deploy Preview for viseron failed.

Name Link
🔨 Latest commit d11834d
🔍 Latest deploy log https://app.netlify.com/sites/viseron/deploys/66eb56266c83380008aae3a2

@roflcoopter
Copy link
Owner

Looks great, thank you! Nice job on decoupling the PTZ component to the Telegram one.
I looked through the code and cant see any obvious issues. Let me know when you think it is ready to be merged and i can take a more thorough look!

smelis added 6 commits July 31, 2024 11:26
…nfig names, removes redundent config, uniform formatting, remove create stop
… commands, fixes only configured cams iso all registered cams, log user_ids for easier setup & audit
… to have the camera follow that path repeatedly. Adds abs_move_wait_complete to wait for a move to complete before sending another move instruction.
@roflcoopter
Copy link
Owner

Hey, just checking in on this PR. Do you think its ready for merge soon or do you need any help to finalize it?

@yangminglong
Copy link

Great job! It seems that I can look forward to "PTZ human tracking" PTZ_PID

@smelis
Copy link
Author

smelis commented Sep 18, 2024

Hey, just checking in on this PR. Do you think its ready for merge soon or do you need any help to finalize it?

Hi! The CI pipeline is failing, but i don't know why :)

@roflcoopter
Copy link
Owner

Hey, just checking in on this PR. Do you think its ready for merge soon or do you need any help to finalize it?

Hi! The CI pipeline is failing, but i don't know why :)

A rebase should fix it! The docker-compose command is no longer available in the CI runner machine and is replaced with docker compose in dev already.

@roflcoopter
Copy link
Owner

Thought the Netlify errors were just intermittent ones but it seems you need to remove the tags from the _meta.tsx files in the docs. and just make it an empty list: tags: [],

These are the only supported tags which none really fits your components.

export type DomainType =
  | "camera"
  | "face_recognition"
  | "image_classification"
  | "license_plate_recognition"
  | "motion_detector"
  | "nvr"
  | "object_detector"
  | "system";

I can add a notifications tag in a follow up PR

@memes-forever
Copy link

Awesome!! I'm really looking forward to this functionality

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants