코딩정보


● ha작업) amcrest camera 를 HAOS에 붙여 사용 하기




컨텐츠 정보


본문

● ha작업) amcrest camera  를 HAOS에 붙여 사용 하기

카메라 보기 및  카메라 영상 찍어  텔레그램으로 전송 하기 및

hub_speaker로 카메라 보기

와 센서 활용을  위하여 amcrest2mqtt-addon 을 설치 사용 하기

# amcrest camera setting 2024_0516_1123_20
# https://amcrest.com/4mp-wifi-camera-pan-tilt-ip4m-1041b.html
# https://www.home-assistant.io/integrations/amcrest

# ffmpeg integration, see https://www.home-assistant.io/integrations/ffmpeg/
ffmpeg:
# Stream integration, see https://www.home-assistant.io/integrations/stream
stream:
# Amcrest integration, see https://www.home-assistant.io/integrations/amcrest/

amcrest:
  - host: 192.168.0.30
    username: !secret amcrest_user1
    password: !secret amcrest_pass1
    # resolution: high
    # stream_source: rtsp
    binary_sensors:
      - motion_detected
      - crossline_detected
      - online
    sensors:
      - sdcard      
      - ptz_preset

3232235521_1716038242.5244.png

텔레그램 전송을 위한 조건을 사전에 구성 해야 합니다

상기 카메라 소스 적용

show_state: true
show_name: true
camera_view: auto
type: picture-entity
entity: camera.amcrest_camera
image: /config/www/snapshot/main_entrance.jpg
camera_image: camera.amcrest_camera_amcrest_camera_2
name: AMCREST_telegram전송(더블snap,롱sending)
hold_action:
  action: call-service
  service: script.camera_snap_photo_sending_2
  target: {}
tap_action:
  action: call-service
  service: camera.snapshot
  target:
    entity_id:
      - camera.amcrest_camera
  data:
    filename: /config/www/snapshot/main_entrance.jpg


hub_speaker로 카메라 보기

카드구성으로 script를 불러 옵니다,

  - type: custom:button-card
    name: CCTV_ip30
    entity: script.cctvview_ip30
    size: 50px
    tap_action:
      action: toggle
    hold_action:
      action: more-info
    styles:
      name:
        - font-size: 9px
    style:
      opacity: 100%
      width: 5%
      height: 5%
      top: 80%
      left: 96%


3232235521_1716040397.9742.png


카메라 화면을 hub_speaker로 전송 >> 10초 delay

3232235521_1716040476.768.png



상기 카드구성을 위한 scropt 구성 파일

entity: script.cctvview_ip30

alias: CCTVView_ip30
sequence:
  - service: media_player.play_media
    target:
      entity_id: media_player.nest_hub_seojae
    data:
      media_content_id: media-source://camera/camera.amcrest_camera
      media_content_type: application/vnd.apple.mpegurl
    metadata:
      title: Amcrest Camera
      thumbnail: /api/camera_proxy/camera.amcrest_camera
      media_class: video
      children_media_class: null
      navigateIds:
        - {}
        - media_content_type: app
          media_content_id: media-source://camera
mode: single
icon: mdi:cctv


3232235521_1716040320.4301.png


amcrest2mqtt-addon

https://github.com/ikifar2012/amcrest2mqtt-addon/blob/main/README.md

3232235521_1716120764.1602.png

을 연결하여  live camera  실시간 보기 

기본으로 연결이  쉬운 dsm 시놀로지로 붙이기가 haos에서 사용이 편하게 연결 가능 하나

live camra 보기가 10초후의 영상만 보기가 가능하여

실제 붙여 있는 ip로 연결하면 실시간 영상을 볼수 있다

여기에  

amcrest2mqtt-addon

를 연결 동작시 haos 연결 동작이  빠르게 연결 동작 합니다

아울러 카메라를 센서로 활용이 가능합니다

binary_sensor.amcrest_ip2m_841b_v3_amc_camera_motion


3232235521_1716121251.7466.png

3232235521_1716121103.0562.png

영상과 pc의 시간을 같이 보면 live 실시간 camer view가 가능  합니다

3232235521_1716120919.4949.png


실시간  캡춰 텔레그램으로 전송하기

3232235521_1716121646.0255.png


type: picture-elements
image: /config/www/snapshot/main_entrance.jpg
elements:
  - type: image
    entity: camera.amcrest_camera
    camera_image: camera.amcrest_camera
    camera_view: live
    aspect_ratio: '16:9'
    show_state: true
    show_name: true
    name: AMCREST_telegram전송
    style:
      top: 50%
      left: 50%
      width: 100%
      height: 100%
      opacity: 100%
  - type: icon
    icon: mdi:camera-plus
    tap_action:
      action: call-service
      service: camera.snapshot
      service_data:
        entity_id: camera.amcrest_camera
        filename: >-
          /config/www/snapshot/snapshot_{{ now().strftime("%Y%m%d-%H%M%S")
          }}.jpg
    style:
      top: 90%
      left: 10%
      '--transform': translate(-50%, -50%)
      background: white
      border-radius: 50%
      padding: 10px
      box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1)
  - type: icon
    icon: mdi:camera-outline
    tap_action:
      action: call-service
      service: camera.snapshot
      service_data:
        entity_id: camera.amcrest_camera
        filename: /config/www/snapshot/main_entrance.jpg
    style:
      top: 90%
      left: 50%
      '--transform': translate(-50%, -50%)
      background: white
      border-radius: 50%
      padding: 10px
      box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1)
  - type: icon
    icon: mdi:send
    tap_action:
      action: call-service
      service: script.camera_snap_photo_sending_2
    style:
      top: 90%
      left: 85%
      '--transform': translate(-50%, -50%)
      background: white
      border-radius: 50%
      padding: 10px
      box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1)


상기 소스에  적용한

script.camera_snap_photo_sending_2

3232235521_1716121896.5544.png


alias: camera_snap_photo_sending_2
sequence:
  - wait_for_trigger: []
    timeout:
      hours: 0
      minutes: 0
      seconds: 2
      milliseconds: 0
  - service: notify.telegram
    data:
      title: Send an images__camera_snap_photo_sending_2
      message: Thats an example that sends an image._camera_snap_photo_sending_2
      data:
        photo:
          - file: /config/www/snapshot/main_entrance.jpg
            caption: 현관문 카메라2
icon: mdi:cctv
mode: single


주) notify.telegram 는 기본 설치 조건임


☞ https://11q.kr 에 등록된 자료 입니다. ♠ 정보찾아 공유 드리며 출처는 링크 참조 바랍니다♠1.png

뷰PDF add1,add2



관련자료




♥간단_메모글♥


최근글


새댓글



PHP 안에 HTML ☞ 홈페이지 화면갱신 시간은 ♨
▶ 2024-06-02 08:25:18

오늘의 홈 현황


  • 현재 접속자♨ 626 명
  • 오늘 가입자※ 0 명
  • 어제 가입자※ 4 명
  • 주간 가입자※ 7 명
  • 오늘 방문자 1,462 명
  • 어제 방문자 2,099 명
  • 최대 방문자 13,042 명
  • 전체 방문자 4,354,707 명
  • 전체 게시물※ 8,612 개
  • 전체 댓글수※ 24,675 개
  • 전체 회원수 11,004 명

QR코드


☞ QR코드 스캔은 kakao앱 자체 QR코드

알림 0








최신글↑