seydx / homebridge-camera-ui

Homebridge plugin for RTSP Cameras with HSV, motion detection support, Image Rekognition, Web UI to manage/watch streams and WebApp support
MIT License
638 stars 92 forks source link

Motion and HSV recording #568

Closed mihailescu2m closed 2 years ago

mihailescu2m commented 2 years ago

I have camera with hardware motion sensor, exposed through MQTT. I enabled HSV, and want to use recording on person detection. Currently, the only way to get that working is to set videoanalysis.active = true. Is there a way to have HSV detecting motion using MQTT camera sensor instead of videoanalysis? My understanding is that object detection is done by Apple in the cloud, so I think videoanalysis only does motion detection and not object recognition?

utezduyar commented 2 years ago

I think object detection is done on your network and object classification is done in the cloud.

Ref: https://support.apple.com/guide/security/camera-security-sec525461d19/web HomeKit decrypts the audio and video streams on the home hub and analyzes the video frames locally for any significant event.

mihailescu2m commented 2 years ago

Yes by object detection and object recognition I meant classification, vs motion detection. So the question is the same: Is there a way to have camera ui HSV plugin detecting motion using MQTT camera sensor instead of videoanalysis?

seydx commented 2 years ago

Yes by object detection and object recognition I meant classification, vs motion detection. So the question is the same: Is there a way to have camera ui HSV plugin detecting motion using MQTT camera sensor instead of videoanalysis?

https://github.com/seydx/homebridge-camera-ui/wiki/MQTT-Config

mihailescu2m commented 2 years ago

https://github.com/seydx/homebridge-camera-ui/wiki/MQTT-Config

I am using that :) Without HSV enabled, my config works and the motion sensor gets triggered. With HSV enabled, there is no recording being done, no motion detection taking place for HSV with MQTT, if videoanalysis is disabled.

EDIT: checked again and found a tiny typo. So now it works.

utezduyar commented 2 years ago

@mihailescu2m Does the mqtt client functionality work and trigger HSV classification even when the video analysis is off?

mihailescu2m commented 2 years ago

@utezduyar yes, and my cpu usage now is low

utezduyar commented 2 years ago

There is no MQTT broker support in camera.ui right, only client? You must be using an external broker.

mihailescu2m commented 2 years ago

Yes, I am running Homebridge in docker, so I added another container with mqqt broker and another one with onvif2mqtt :)

Rahulsharma0810 commented 2 years ago

@mihailescu2m can you share the conf for onvif2mqtt, I am trying to implement this for my camera.

mihailescu2m commented 2 years ago

@Rahulsharma0810

$ cat config.yml
mqtt:
  host: <mqtt_broker_ip>
  port: 1883
onvif:
  - name: <camera1_name>
    hostname: <camera1_ip>
    port: <camera1_onvif_port>
    username: <camera1_username>
    password: <camera1_password>
  - name: camera2
    hostname: 192.168.0.22
    port: 2020
    username: camera2user
    password: camera2pass
Rahulsharma0810 commented 2 years ago

@mihailescu2m thanks for it can you share your whole docker-compose setup, in my case even though both services are up, it is not detecting any event.

mihailescu2m commented 2 years ago

@Rahulsharma0810 I don't use docker-compose for this, just started a container with onvif2mqtt ...

Rahulsharma0810 commented 2 years ago

Thanks for the quick reply, I made it work, can you share your cameraui mqtt conf.

Thanks @mihailescu2m

mihailescu2m commented 2 years ago
      "mqtt": {
          "motionTopic": "onvif2mqtt/<camera1_name>/motion",
          "motionMessage": "ON",
          "motionResetTopic": "onvif2mqtt/<camera1_name>/motion",
          "motionResetMessage": "OFF"
      },
mkz212 commented 10 months ago

Probable solution: #855