Code Monkey home page Code Monkey logo

icsee-ptz's Introduction

"Buy Me A Coffee"

ICSee PTZ control integration for Home Assistant

Home Assistant integration to send ptz commands to ICSee/XMEye/DVR-IP/NetSurveillance/Sofia cameras.

It can also set presets and recall them and synchronize the camera clock.

Installation

Option 1: HACS Link

  1. Click Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.
  2. Restart Home Assistant

Option 2: HACS

  1. Or HACS > Integrations > โ‹ฎ > Custom Repositories
  2. Repository: paste the url of this repo
  3. Category: Integration
  4. Click Add
  5. Close Custom Repositories modal
  6. Click + EXPLORE & DOWNLOAD REPOSITORIES
  7. Search for icsee
  8. Click Download
  9. Restart Home Assistant

Option 2: Manual copy

  1. Copy the icsee_ptz folder inside custom_components of this repo to /config/custom_components in your Home Assistant instance
  2. Restart Home Assistant

Configuration

Go to the integration and add an entry for each of your cameras

Open your Home Assistant instance and show an integration.

image

Usage

This integration exposes services for PTZ and a motion alarm entity.

Motion alarm

First make sure to enable and configure motion alarms in the standard camera application (e.g ICSee or XMEye). Then, you can use the provided entity in your automations.

image

Pan, tilt, zoom (PTZ)

icsee_ptz.move: move, zoom and set/goto preseets.

Requires:

  • WebRTC integration v3.2.0 - 2023-07-11

Test PTZ control from Developer Tools / Services..

image

Example automation

alias: Notify camera motion alarm
description: ""
trigger:
  - platform: state
    entity_id:
      - binary_sensor.garden_motion_alarm
    to: "on"
condition: []
action:
  - service: notify.mobile_app_pixel_7
    data:
      message: TTS
      data:
        tts_text: Attention: motion detected in garden
        ttl: 0
        priority: high
mode: single

Usage in WebRTC card:

# lovelace card
type: custom:webrtc-camera
url: garden_dvrip
ui: true
shortcuts:
  services:
    - name: Sync
      icon: mdi:clock-check
      service: icsee_ptz.synchronize_clock
      service_data:
        entity_id: binary_sensor.garten_motion_alarm
    - name: Force frame
      icon: mdi:play
      service: icsee_ptz.force_frame
      service_data:
        entity_id: binary_sensor.garten_motion_alarm
ptz:
  service: icsee_ptz.move
  data_home:
    entity_id: binary_sensor.garten_motion_alarm
    cmd: GotoPreset
    preset: 0
  data_long_home:
    entity_id: binary_sensor.garten_motion_alarm
    cmd: SetPreset
    preset: 0
  data_start_left:
    entity_id: binary_sensor.garten_motion_alarm
    cmd: DirectionLeft
  data_end_left:
    entity_id: binary_sensor.garten_motion_alarm
    cmd: Stop
  data_start_right:
    entity_id: binary_sensor.garten_motion_alarm
    cmd: DirectionRight
  data_end_right:
    entity_id: binary_sensor.garten_motion_alarm
    cmd: Stop
  data_start_down:
    entity_id: binary_sensor.garten_motion_alarm
    cmd: DirectionDown
  data_end_down:
    entity_id: binary_sensor.garten_motion_alarm
    cmd: Stop
  data_start_up:
    entity_id: binary_sensor.garten_motion_alarm
    cmd: DirectionUp
  data_end_up:
    entity_id: binary_sensor.garten_motion_alarm
    cmd: Stop

Video stream from go2rtc

# go2rtc.yaml
streams:
  garden_dvrip:
    - dvrip://admin:[email protected]:34567
  garden_dvrip_mini:
    - dvrip://admin:[email protected]:34567?channel=0&subtype=1
  garden: # try this if the video is choppy or audio is out of synch
    - ffmpeg:garden_dvrip#audio=copy#async#video=copy#async

Miscelaneous

With https://xmeye.org/xmeye-for-pc/ you can configure the fps and encoding params of ICSee cameras.

Recommended configuration:

in device config / encode config select:

  • fps: 30 (maximum available)
  • Iframe interval: 1 (minimum available)
  • Static encode config: high profile
  • H264+ enable: disabled

in device config / camera param select:

  • Clear fog: ON
  • Level: 100

icsee-ptz's People

Contributors

dbuezas avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.