Agent DVR + Deepstack

How do I configure Agent DVR to work with Deepstack?
How can I display a list of identified persons without brackets?

  1. Go to the general settings of Agent DVR

  2. Choosing intelligence

  3. We specify the IP and port of the deepstack of our server and save it

  4. Go to the camera settings

  5. Click edit camera

  6. Choosing actions

  7. Adding the actions we need

  8. Creating an action for face recognition. We will transmit to HA via MQTT. You can create any topic. It is important to correctly specify the topics when creating an MQTT sensor.

  9. Creating an action for face recognition. When the movement stops, the status will be turned off. If this is not done, the name of the identified person will remain. You don’t have to use this action if you don’t want the name to disappear when the movement stops

  10. Creating a motion detection sensor. This will be useful for us in order to launch the Deepstack Face integration for face recognition in HA

  11. Creating a sensor for stopping motion detection.

  12. Open the"Face Recognition" section

  13. In the face recognition settings, select detect, specify confidence and enable the face recognition function

  14. Open the "Tracking device"section

  15. We specify to fix only objects. If we specify a simple mode, then everything will be recorded, even turning on and off lights and animals. Objects capture only what we specified in the objects filters, it can only be people or people and a dog or a car. Recognizes only the specified object from the filter.

  16. Open the "Objects"section

  17. In this “Objects” section, we specify which objects the camera should respond to.

  18. Then we need to apply the saved parameters. You can also restart the Agent DVR

  19. Reloading the Agent DVR

We create sensors for Agent DVR and output them to Lovelace

# Sensors via MQTT
sensor:
  - platform: mqtt
    name: "agentdvr eufy camera hall motion"
    state_topic: "Agent/cameras/eufy camera hall/motion"
    icon: mdi:webcam

  - platform: mqtt
    name: "agentdvr eufy camera hall face detected"
    state_topic: "Agent/cameras/eufy camera hall/face"
    icon: mdi:webcam

  - platform: mqtt
    name: "agentdvr eufy camera hall motion detected"
    state_topic: "Agent/cameras/eufy camera hall/motion detected"
    icon: mdi:webcam

  - platform: mqtt
    name: "agentdvr eufy camera hall object detected"
    state_topic: "Agent/cameras/eufy camera hall/object detected"
    icon: mdi:webcam

This is how the panel and the sensor itself look in the developer panel
image
image

How can I add identified persons to the list without brackets?
image

A visual example in the template. Without brackets and with brackets

If we use this code, a list without brackets will be displayed

{% for k, v in state_attr("image_processing.detect_face_eufy_camera", "matched_faces").items() -%}
{{ k }}: {{ v }}
{% endfor %}

This code will display a list with brackets
{{ state_attr("image_processing.detect_face_eufy_camera", "matched_faces") }}

Текст на русском (Text in Russian)

Как настроить Agent DVR для работы с Deepstack?
Как вывести список опознанных лиц без скобок?

  1. Заходим в общие настройки Agent DVR

  2. Выбираем интеллект

  3. Указываем IP и порт deepstack своего сервера и сохраняемся

  4. Заходим в настройки камеры

  5. Нажимаем редактировать камеру

  6. Выбираем действия

  7. Добавляем нужные нам действия

  8. Создаем действие для распознавание лица. Передавать в ХА будем через MQTT. Топик можно создать любой. Важно при создании MQTT сенсора верно указать топики.

  9. Создаем действие для распознавания лица. При прекращении движения, статус будет выключен. Если этого не сделать, то имя опознанного лица останется. Можете не использовать это действие, если не хотите, чтобы имя исчезало при прекращении движения

  10. Создаем сенсор обнаружения движения. Это нам пригодится для того, чтобы запускать в ХА интеграцию Deepstack Face для распознавания лица

  11. Создаем сенсор прекращения обнаружения движения.

  12. Открываем раздел “Распознавание лиц”

  13. В настройках распознавание лиц выбираем детектировать, указываем уверенность и включаем функцию распознавание лица

  14. Открываем раздел “Следящее устройство”

  15. Указываем фиксировать только объекты. Если укажем простой режим, то фиксировать будет все, даже включение и выключение света и животных. Объекты фиксируют только то, что мы указали в фильтры объекты, это может быть только люди или люди и собака или машина. Распознает только указанный объект из фильтра.

  16. Открываем раздел “Объекты”

  17. В этом разделе “Объекты” мы указываем на какие объекты камера должна реагировать.

  18. Потом нам надо применить сохраненные параметры. Можно еще и перезапустить Agent DVR

  19. Перезагружаем Agent DVR

Создаем сенсоры для Agent DVR и выводим их в Lovelace

# Сенсоры через MQTT
sensor:
  - platform: mqtt
    name: "agentdvr eufy camera hall motion"
    state_topic: "Agent/cameras/eufy camera hall/motion"
    icon: mdi:webcam

  - platform: mqtt
    name: "agentdvr eufy camera hall face detected"
    state_topic: "Agent/cameras/eufy camera hall/face"
    icon: mdi:webcam

  - platform: mqtt
    name: "agentdvr eufy camera hall motion detected"
    state_topic: "Agent/cameras/eufy camera hall/motion detected"
    icon: mdi:webcam

  - platform: mqtt
    name: "agentdvr eufy camera hall object detected"
    state_topic: "Agent/cameras/eufy camera hall/object detected"
    icon: mdi:webcam

Вот так выглядит панель и сам сенсор в панели разработчика
image
image

Как вывести опознанные лица в список без скобок?
image

Наглядный пример в шаблоне. Без скобок и со скобками

Если будем использовать этот код, то отобразится список без скобок

{% for k, v in state_attr("image_processing.detect_face_eufy_camera", "matched_faces").items() -%}
{{ k }}: {{ v }}
{% endfor %}

Этот код отобразится список со скобками
{{ state_attr("image_processing.detect_face_eufy_camera", "matched_faces") }}

3 Likes

This is absolutely amazing… MORE than what I was looking for… what a legend, Thanks!