Integrar en Home Assistant On off switch zigbee SWITCH-WF-10A-ZB

Alla por el 2017 empecé a domotizar toda la vivienda , una de las primeras cosas con las que empecé fue con la lampara del sofá del salón para ello puse uno de los míticos sonoff Basic con el firmware Espurna que ha funcionado genial y sin problemas durante estos siete años.

En estos momentos estoy migrando hacia zigbee bastantes elementos , y encontre uno del mismo tamaño y muy similar al Basic , ese el onioff SWITCH-WF-10A-ZB

Después de una semana llego y es calcado al Basic , lo único que cambia aparte de ser Zigbee es el color de led que es azul en lugar del verde de sonoff , trae los cuatro tornillos para apretar la tapa donde va el elemento y un pequeño manual

Tenemos la entrada de 220V a la izquierda , y los dos bornes de salida para alimentar directamente la carga ( teóricamente hasta 10 Amp. )

Para emparejarlo teóricamente hay que pulsar para apagar y mantener tres segundos , pulsar para encender y mantener tres segundos , así cinco veces , a mi no me funciono y conseguí emparejarlo quitando tensión y manteniendo pulsado el pulsador durante unos diez segundos

Pondremos zigbee2mqtt en modo permitir emparejamiento y al momento nos aparece que se ha emparejado correctamente.

Y nos aparece un nuevo elemento que de forma no se parece en nada a nuestro switch , pero con las mismas funciones , esto pasa porque muchas veces son módulos genéricos

Este seria el modulo que nos constaria en nuestro sistema

https://www.zigbee2mqtt.io/devices/SWITCH-ZR03-1.html#ewelink-switch-zr03-1

Al momento ya vemos como empezamos a recibir información de el switch

Este seria el JSON que recibimos del nuevo dispositivo

{
  "device": {
    "applicationVersion": 1,
    "dateCode": "20210610-BL",
    "friendlyName": "0x7cb94c787dd90000",
    "hardwareVersion": 0,
    "ieeeAddr": "0x7cb94c787dd90000",
    "manufacturerID": 4742,
    "manufacturerName": "eWeLink",
    "model": "SWITCH-ZR03-1",
    "networkAddress": 26641,
    "powerSource": "Unknown",
    "softwareBuildID": "1.2.1",
    "stackVersion": 0,
    "type": "Router",
    "zclVersion": 8
  },
  "last_seen": "2024-03-15T21:29:23+01:00",
  "linkquality": 76,
  "power_on_behavior": "off",
  "state": "OFF"
}

Le cambiamos el nombre para hacerlo mas amigable

  '0x7cb94c787dd90000':
    friendly_name: 'rele_luz_sofa'

Y ya tenemos lista la parte de MQTT

Empezamos definiendo los sensores de calidad de señal y ultima conexión

  ### RELE LUZ SOFA
  
    - name: "rele_luz_sofa_estado"
      state_topic: "zigbee2mqtt/rele_luz_sofa"
      availability_topic: "zigbee2mqtt/bridge/state"
      icon: "mdi:signal"
      unit_of_measurement: "lqi"
      value_template: "{{ value_json.linkquality }}"
      
    - state_topic: "zigbee2mqtt/rele_luz_sofa"
      availability_topic: "zigbee2mqtt/bridge/state"
      icon: "mdi:calendar-clock"
      value_template: "{{ value_json.last_seen }}"
      name: "rele_luz_sofa_ultima_conexion"  

Después definimos el sensor de disponibilidad

    - state_topic: "zigbee2mqtt/rele_luz_sofa/availability"       
      availability_topic:  "zigbee2mqtt/rele_luz_sofa/availability"     
      name: rele_luz_sofa_disponibilidad      
      device_class: "connectivity"      
      payload_on: "online"
      payload_off: "offline" 

Pasamos a definir el switch mqtt

    - name: rele_luz_sofa_zb
      command_topic: "zigbee2mqtt/rele_luz_sofa/set"
      state_topic: "zigbee2mqtt/rele_luz_sofa"
      availability_topic: "zigbee2mqtt/bridge/state"
      icon: mdi:power-socket
      payload_on: "ON"
      payload_off: "OFF"
      value_template: "{{ value_json.state }}"
      retain: false

Este switch lo podemos mapear directamente como si fuese una luz , con ello todo será mas comprensible.

light:
    
  - platform: switch
    name: luz_sofa
    entity_id: switch.rele_luz_sofa_zb  

Lo ponemos a nuestro gusto en el customize.yaml

switch.rele_luz_sofa_zb:
  friendly_name: Luz Sofa
light.luz_sofa:
  friendly_name: Luz Sofa
  # icon: mdi:lightbulb
  icon: 'bha:floor-lamp'

binary_sensor.rele_luz_sofa_disponibilidad: 
  friendly_name: "Rele luz sofa"
  

Lo añadiremos en la parte de estados via telegram

          {% if is_state("light.luz_sofa", "on") %}{{"\U0001f4a1"}} *Comedor sofa*: Encendida {% else %}{{"\u26ab"}} *Comedor sofa*: Apagada{% endif %}

Lo añadimos también en las estadísticas

          -------- LUZ SOFA ------
         {{"\U0001f4a1"}} *Sofa on/off hoy:* {{(states.sensor.hoy_contador_luz_sofa.state | int(0) | round(0,default=0)  )}}
         {{"\U0001f4a1"}} *Sofa hoy:* {{(states.sensor.hoy_luz_sofa.state )}}
         {{"\U0001f4a1"}} *Sofa > lunes:* {{(states.sensor.desde_el_lunes_luz_sofa.state )}}
         {{"\U0001f4a1"}} *Sofa mes:* {{(states.sensor.mes_actual_luz_sofa.state )}}        

También lo añadimos en la parte de automatizaciones para controlarlo desde el switch de Xiaomi

- alias: Luz sofa pulsador simple click
  id: Luz sofa pulsador simple click
  initial_state: 'on'
  trigger:
    - platform: state
      entity_id: sensor.pulsador_luz_sofa_evento
      to: 'single'
  action:
    - service: light.toggle
      entity_id: light.luz_sofa 

Lo añadimos en el sensor de fallos de dispositivos Zigbee

          {%-if is_state("binary_sensor.rele_luz_sofa_disponibilidad", "off") %}{{"\u26ab"}} *Rele luz sofa*: Sin conexión{{"\n"}}{% endif %}

Y en la rutina que nos envia a demanda el estado de todos los zigbee instalados

          {% if is_state("binary_sensor.rele_luz_sofa_disponibilidad", "on") %}{{"\U0001F7E2"}} *Rele luz sofa*: ON {% else %}{{"\U0001F534"}} *Puls. luz sofa*: OFF{% endif %} , {{ states.sensor.rele_luz_sofa_ultima_conexion_minutos.state }}

Y por ultimo añadimos el sensor de ultima conexión

  - platform: template
    sensors:
      rele_luz_sofa_ultima_conexion_minutos:
        value_template: >-
          {% set x1 = as_timestamp(states('sensor.rele_luz_sofa_ultima_conexion')) %}
          {% set x2 = as_timestamp(now()) %}
          {% set time = x2 - x1 | int(0) %}
          {% set days = (time/86400) | int %}
          {% set hours = (time / 3600 % 24) | int %}
          {% set minutes = (((time / 3600) % 1) * 60) | int %}
          {{ days ~ 'd ' ~ hours ~ 'h ' ~ minutes ~ 'm' }}        
        friendly_name: Ultima conexión rele luz sofa
        icon_template: "mdi:calendar-clock"

Ya nos tendría que aparecer en nuestro panel lovelace

Como todo el resto es heredado no tendremos que hacer nada mas , ya que las automatizaciones estan como light.luz_sofa y seguiran igual

Al esta conectado a 220V fijo nos actuara como router extendiendo nuestra red zigbee.

Y con esto y un bizcocho …….

Cambiar QNAP Survillance Station por Frigate

Después de cambiar el TVS-882 por un TVS-h674 resulta que de pronto la licencia para ocho cámaras de Survillance Station que tenia no me servia , y ahora me ofrecían los muy cachondos una licencia para un nuevo servicio llamado QVR Elite para dos cámaras y el resto a pasar por caja mensualmente , QNAP me estas tocando las bolas y lo peor es que no es con tu hardware , si no con la política a lo Netflix que tienes , mal vamos ehhhhhh…

A todo esto tengo en casa Motioneye que me va de p…. madre , pero quería buscar alguna alternativa , esta alternativa la encontre en Frigate , toda la documentación la podéis encontrar aquí

Lo primero será crear las carpetas para que el docker funcione correctamente

Crearemos un fichero de configuracion en /config/config.yml con la configuración mínima para que arranque

mqtt:
  enabled: False

cameras:
  dummy_camera: # <--- this will be changed to your actual camera later
    enabled: False
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:554/rtsp
          roles:
            - detect

Para instalarlo en un NAS QNAP estas serian las instrucciones

QNAP NAS

These instructions were tested on a QNAP with an Intel J3455 CPU and 16G RAM, running QTS 4.5.4.2117.

QNAP has a graphic tool named Container Station to install and manage docker containers. However, there are two limitations with Container Station that make it unsuitable to install Frigate:

  1. Container Station does not incorporate GitHub Container Registry (ghcr), which hosts Frigate docker image version 0.12.0 and above.
  2. Container Station uses default 64 Mb shared memory size (shm-size), and does not have a mechanism to adjust it. Frigate requires a larger shm-size to be able to work properly with more than two high resolution cameras.

Because of above limitations, the installation has to be done from command line. Here are the steps:

Preparation

  1. Install Container Station from QNAP App Center if it is not installed.
  2. Enable ssh on your QNAP (please do an Internet search on how to do this).
  3. Prepare Frigate config file, name it config.yml.
  4. Calculate shared memory size according to documentation.
  5. Find your time zone value from https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  6. ssh to QNAP.

Installation

Run the following commands to install Frigate (using stable version as example):

# Download Frigate image
docker pull ghcr.io/blakeblackshear/frigate:stable
# Create directory to host Frigate config file on QNAP file system.
# E.g., you can choose to create it under /share/Container.
mkdir -p /share/Container/frigate/config
# Copy the config file prepared in step 2 into the newly created config directory.
cp path/to/your/config/file /share/Container/frigate/config
# Create directory to host Frigate media files on QNAP file system.
# (if you have a surveilliance disk, create media directory on the surveilliance disk.
# Example command assumes share_vol2 is the surveilliance drive
mkdir -p /share/share_vol2/frigate/media
# Create Frigate docker container.  Replace shm-size value with the value from preparation step 3.
# Also replace the time zone value for 'TZ' in the sample command.
# Example command will create a docker container that uses at most 2 CPUs and 4G RAM.
# You may need to add "--env=LIBVA_DRIVER_NAME=i965 \" to the following docker run command if you
# have certain CPU (e.g., J4125). See https://docs.frigate.video/configuration/hardware_acceleration.
docker run \
  --name=frigate \
  --shm-size=256m \
  --restart=unless-stopped \
  --env=TZ=America/New_York \
  --volume=/share/Container/frigate/config:/config:rw \
  --volume=/share/share_vol2/frigate/media:/media/frigate:rw \
  --network=bridge \
  --privileged \
  --workdir=/opt/frigate \
  -p 1935:1935 \
  -p 5000:5000 \
  -p 8554:8554 \
  -p 8555:8555 \
  -p 8555:8555/udp \
  --label='com.qnap.qcs.network.mode=nat' \
  --label='com.qnap.qcs.gpu=False' \
  --memory="4g" \
  --cpus="2" \
  --detach=true \
  -t \
  ghcr.io/blakeblackshear/frigate:stable

Log into QNAP, open Container Station. Frigate docker container should be listed under ‘Overview’ and running. Visit Frigate Web UI by clicking Frigate docker, and then clicking the URL shown at the top of the detail page.

Yo al final modifique la configuración para darle mas chicha al bicho y que fuera mas sobrado de recursos quedando asi :

docker run \
  --name=frigate \
  --shm-size=800m \
  --restart=always \
  --env=TZ='Europe/Madrid' \
  --volume=/share/camaras/frigate/config:/config:rw \
  --volume=/share/camaras/frigate/media:/media/frigate:rw \
  --network=bridge \
  --privileged \
  --workdir=/opt/frigate \
  -p 1935:1935 \
  -p 5100:5000 \
  -p 8554:8554 \
  -p 8555:8555 \
  -p 8555:8555/udp \
  --label='com.qnap.qcs.network.mode=nat' \
  --label='com.qnap.qcs.gpu=False' \
  --memory="6g" \
  --cpus="6" \
  --detach=true \
  ghcr.io/blakeblackshear/frigate:stable

Una vez arrancado ya podremos acceder mediante el navegador , en ese momento solo hay una cámara dummy creada , ahora toca la tarea de ir configurando todas las cámaras y las preferencias para que funcione como mejor nos vaya , desde el navegador definiremos tanto las zonas como las mascaras de cada cámara si así queremos que actué

Al final mi fichero de config.yml quedo así

mqtt:
  enabled: true
  user: xxxxxxxxxx
  password: xxxxxxxxxx
  host: xxxxxxxxxx.duckdns.org
  port: 21883
  # timestamp: true
  # bounding_box: true
  # crop: true
  # height: 500
  # quality: 100

# Optional: Detectors configuration. Defaults to a single CPU detector
# detectors:
  # # Required: name of the detector
  # detector_name:
    # # Required: type of the detector
    # # Frigate provided types include 'cpu', 'edgetpu', 'openvino' and 'tensorrt' (default: shown below)
    # # Additional detector types can also be plugged in.
    # # Detectors may require additional configuration.
    # # Refer to the Detectors configuration page for more information.
    # type: cpu

# Optional: Database configuration
database:
  # The path to store the SQLite DB (default: shown below)
  path: /config/frigate.db

# Optional: logger verbosity settings
logger:
  # Optional: Default log verbosity (default: shown below)
  default: debug
  # Optional: Component specific logger overrides
  logs:
    frigate.event: debug
    frigate.mqtt: debug
    frigate.app: debug
    frigate.object_detection: debug

timestamp_style:
  # Optional: Position of the timestamp (default: shown below)
  #           "tl" (top left), "tr" (top right), "bl" (bottom left), "br" (bottom right)
  position: tl
  # Optional: Format specifier conform to the Python package "datetime" (default: shown below)
  #           Additional Examples:
  #           german: "%d.%m.%Y %H:%M:%S"
  format: '%d/%m/%Y %H:%M:%S'
  # Optional: Color of font
  color:
    # All Required when color is specified (default: shown below)
    red: 255
    green: 255
    blue: 255
  # Optional: Line thickness of font (default: shown below)
  thickness: 2
  # Optional: Effect of lettering (default: shown below)
  #           None (No effect),
  #           "solid" (solid background in inverse color of font)
  #           "shadow" (shadow for font)
  effect: solid

motion:
  # Optional: The threshold passed to cv2.threshold to determine if a pixel is different enough to be counted as motion. (default: shown below)
  # Increasing this value will make motion detection less sensitive and decreasing it will make motion detection more sensitive.
  # The value should be between 1 and 255.
  threshold: 30
  mqtt_off_delay: 5
  lightning_threshold: 0.8

record:
  enabled: true
  retain:
    days: 7
    mode: all
  events:
    retain:
      default: 30
      mode: motion
  sync_recordings: true

snapshots:
  # Optional: Enable writing jpg snapshot to /media/frigate/clips (default: shown below)
  enabled: true
  # Optional: save a clean PNG copy of the snapshot image (default: shown below)
  clean_copy: true
  # Optional: print a timestamp on the snapshots (default: shown below)
  timestamp: true
  # Optional: draw bounding box on the snapshots (default: shown below)
  bounding_box: true
  # Optional: crop the snapshot (default: shown below)
  crop: false
  # Optional: height to resize the snapshot to (default: original size)
  # height: 175
  # Optional: Restrict snapshots to objects that entered any of the listed zones (default: no required zones)
  required_zones: []
  # Optional: Camera override for retention settings (default: global values)
  retain:
    # Required: Default retention days (default: shown below)
    default: 30
    # Optional: Per object retention days
    objects:
      person: 30
  # Optional: quality of the encoded jpeg, 0-100 (default: shown below)
  quality: 100

rtmp:
  # Optional: Enable the RTMP stream (default: False)
  enabled: false

cameras:
  # dummy_camera: # <--- this will be changed to your actual camera later
    # enabled: False
    # ffmpeg:
      # inputs:
        # - path: rtsp://127.0.0.1:554/rtsp


  # Required: name of the camera

  foscam_1:
    # Optional: Enable/Disable the camera (default: shown below).
    # If disabled: config is used but no live stream and no capture etc.
    # Events/Recordings are still viewable.
    enabled: true
    # Required: ffmpeg settings for the camera
    ffmpeg:
      # Required: A list of input streams for the camera. See documentation for more information.
      inputs:
        # Required: the path to the stream
        # NOTE: path may include environment variables or docker secrets, which must begin with 'FRIGATE_' and be referenced in {}
      - path: rtsp://xxxxxxxxxx:yyyyyyyyyyy@ZZ.ZZ.ZZ.71:88/videoMain
        roles:
        - audio
        - detect
        - record
        - rtmp

    # to be replaced by a newer image. (default: shown below)
    best_image_timeout: 60
    # Optional: URL to visit the camera web UI directly from the system page. Might not be available on every camera.
    webui_url: ''
    ui:
      order: 0
      dashboard: true

    # Optional: Configuration for how to sort the cameras in the Birdseye view.
    birdseye:
      order: 0
    motion:
      mask:
      - 1920,0,1647,320,1152,0
      - 1920,1080,970,1080,1920,0
      - 0,1080,398,1080,0,409
    zones:
      zone_patio_entrada_2:
        coordinates: 599,119,739,388,973,699,778,817,444,978,384,903,260,738,120,496,23,259
    snapshots:
      enabled: true

    mqtt:
      # Optional: Enable publishing snapshot via mqtt for camera (default: shown below)
      # NOTE: Only applies to publishing image data to MQTT via 'frigate/<camera_name>/<object_name>/snapshot'.
      # All other messages will still be published.
      enabled: true
      # Optional: print a timestamp on the snapshots (default: shown below)
      timestamp: true
      # Optional: draw bounding box on the snapshots (default: shown below)
      bounding_box: true
      # Optional: crop the snapshot (default: shown below)
      # crop: true
      # Optional: height to resize the snapshot to (default: shown below)
      # height: 270
      # Optional: jpeg encode quality (default: shown below)
      quality: 100
      # Optional: Restrict mqtt messages to objects that entered any of the listed zones (default: no required zones)
      required_zones: []


  foscam_2:
    # Optional: Enable/Disable the camera (default: shown below).
    # If disabled: config is used but no live stream and no capture etc.
    # Events/Recordings are still viewable.
    enabled: true
    # Required: ffmpeg settings for the camera
    ffmpeg:
      # Required: A list of input streams for the camera. See documentation for more information.
      inputs:
        # Required: the path to the stream
        # NOTE: path may include environment variables or docker secrets, which must begin with 'FRIGATE_' and be referenced in {}
      - path: rtsp://xxxxxxxxxx:yyyyyyyyyyy@ZZ.ZZ.ZZ.72:88/videoMain
        roles:
        - audio
        - detect
        - record
        - rtmp

    # to be replaced by a newer image. (default: shown below)
    best_image_timeout: 60
    # Optional: URL to visit the camera web UI directly from the system page. Might not be available on every camera.
    webui_url: ''
    ui:
      order: 0
      dashboard: true
    # Optional: Configuration for how to sort the cameras in the Birdseye view.
    birdseye:
      order: 0
    motion:
      mask:
      - 175,321,468,0,258,0,153,0,76,0,0,0,0,228,0,353,0,720,82,720
      - 1280,0,1280,720,782,678,771,649,754,0
      - 0,696,876,685,1161,625,1280,611,1280,686,1280,720,0,720
    zones:
      zone_entrada_calle_2:
        coordinates: 311,255,314,417,393,571,395,720,108,683,174,428
    snapshots:
      enabled: true

    mqtt:
      # Optional: Enable publishing snapshot via mqtt for camera (default: shown below)
      # NOTE: Only applies to publishing image data to MQTT via 'frigate/<camera_name>/<object_name>/snapshot'.
      # All other messages will still be published.
      enabled: true
      # Optional: print a timestamp on the snapshots (default: shown below)
      timestamp: true
      # Optional: draw bounding box on the snapshots (default: shown below)
      bounding_box: true
      # Optional: crop the snapshot (default: shown below)
      # crop: true
      # Optional: height to resize the snapshot to (default: shown below)
      # height: 270
      # Optional: jpeg encode quality (default: shown below)
      quality: 100
      # Optional: Restrict mqtt messages to objects that entered any of the listed zones (default: no required zones)
      required_zones: []


  foscam_3:
    # Optional: Enable/Disable the camera (default: shown below).
    # If disabled: config is used but no live stream and no capture etc.
    # Events/Recordings are still viewable.
    enabled: true
    # Required: ffmpeg settings for the camera
    ffmpeg:
      # Required: A list of input streams for the camera. See documentation for more information.
      inputs:
        # Required: the path to the stream
        # NOTE: path may include environment variables or docker secrets, which must begin with 'FRIGATE_' and be referenced in {}
      - path: rtsp://xxxxxxxxxx:yyyyyyyyyyy@ZZ.ZZ.ZZ.73:88/videoMain
        roles:
        - audio
        - detect
        - record
        - rtmp

    # to be replaced by a newer image. (default: shown below)
    best_image_timeout: 60
    # Optional: URL to visit the camera web UI directly from the system page. Might not be available on every camera.
    webui_url: ''
    ui:
      order: 0
      dashboard: true

    # Optional: Configuration for how to sort the cameras in the Birdseye view.
    birdseye:
      order: 0

    motion:
      mask:
      - 22,0,0,1080,455,1080,273,666,229,494,376,438,791,270,1098,134,1293,37,1497,0
    snapshots:
      enabled: true
    zones:
      zone_puerta_terraza_2:
        coordinates: 1920,133,1920,479,1700,469,1737,126

    mqtt:
      # Optional: Enable publishing snapshot via mqtt for camera (default: shown below)
      # NOTE: Only applies to publishing image data to MQTT via 'frigate/<camera_name>/<object_name>/snapshot'.
      # All other messages will still be published.
      enabled: true
      # Optional: print a timestamp on the snapshots (default: shown below)
      timestamp: true
      # Optional: draw bounding box on the snapshots (default: shown below)
      bounding_box: true
      # Optional: crop the snapshot (default: shown below)
      # crop: true
      # Optional: height to resize the snapshot to (default: shown below)
      # height: 270
      # Optional: jpeg encode quality (default: shown below)
      quality: 100
      # Optional: Restrict mqtt messages to objects that entered any of the listed zones (default: no required zones)
      required_zones: []

        
  HIKVISION_1:
    # Optional: Enable/Disable the camera (default: shown below).
    # If disabled: config is used but no live stream and no capture etc.
    # Events/Recordings are still viewable.
    enabled: true
    # Required: ffmpeg settings for the camera
    ffmpeg:
      # Required: A list of input streams for the camera. See documentation for more information.
      inputs:
        # Required: the path to the stream
        # NOTE: path may include environment variables or docker secrets, which must begin with 'FRIGATE_' and be referenced in {}
      - path: rtsp://xxxxxxxxxx:yyyyyyyyyyy@ZZ.ZZ.ZZ.155:554
        roles:
        - audio
        - detect
        - record
        - rtmp

    # to be replaced by a newer image. (default: shown below)
    best_image_timeout: 60
    # Optional: URL to visit the camera web UI directly from the system page. Might not be available on every camera.
    webui_url: ''
    ui:
      order: 0
      dashboard: true

    # Optional: Configuration for how to sort the cameras in the Birdseye view.
    birdseye:
      order: 0

    motion:
      mask:
      - 0,2160,278,2160,412,2160,287,1965,268,1915,240,1834,281,1809,318,1775,493,1684,667,1563,814,1416,1007,1226,1054,951,1734,917,2311,880,2844,870,3275,855,3634,861,3840,867,3840,552,3840,0,2735,0,2377,0,1488,0,855,0,0,0,0,767,0,1129,0,1438
    zones:
      zone_patio_entrada:
        coordinates: 1285,1715,880,2160,421,2160,218,1762,749,1538
    snapshots:
      enabled: true

    mqtt:
      # Optional: Enable publishing snapshot via mqtt for camera (default: shown below)
      # NOTE: Only applies to publishing image data to MQTT via 'frigate/<camera_name>/<object_name>/snapshot'.
      # All other messages will still be published.
      enabled: true
      # Optional: print a timestamp on the snapshots (default: shown below)
      timestamp: true
      # Optional: draw bounding box on the snapshots (default: shown below)
      bounding_box: true
      # Optional: crop the snapshot (default: shown below)
      # crop: true
      # Optional: height to resize the snapshot to (default: shown below)
      # height: 270
      # Optional: jpeg encode quality (default: shown below)
      quality: 100
      # Optional: Restrict mqtt messages to objects that entered any of the listed zones (default: no required zones)
      required_zones: []


  HIKVISION_2:
    # Optional: Enable/Disable the camera (default: shown below).
    # If disabled: config is used but no live stream and no capture etc.
    # Events/Recordings are still viewable.
    enabled: true
    # Required: ffmpeg settings for the camera
    ffmpeg:
      # Required: A list of input streams for the camera. See documentation for more information.
      inputs:
        # Required: the path to the stream
        # NOTE: path may include environment variables or docker secrets, which must begin with 'FRIGATE_' and be referenced in {}
      - path: rtsp://xxxxxxxxxx:yyyyyyyyyyy@ZZ.ZZ.ZZ.156:554
        roles:
        - audio
        - detect
        - record
        - rtmp

    # to be replaced by a newer image. (default: shown below)
    best_image_timeout: 60
    # Optional: URL to visit the camera web UI directly from the system page. Might not be available on every camera.
    webui_url: ''
    ui:
      order: 0
      dashboard: true

    # Optional: Configuration for how to sort the cameras in the Birdseye view.
    birdseye:
      order: 0
    motion:
      mask:
      - 2626,0,3543,0,3662,0,3840,0,3840,958,0,437,0,0
      - 0,2160,1076,2160,1095,1740,0,1506
    zones:
      zone_entrada_calle:
        coordinates: 2632,1394,2748,2160,1653,2160,1703,1338
    snapshots:
      enabled: true

    mqtt:
      # Optional: Enable publishing snapshot via mqtt for camera (default: shown below)
      # NOTE: Only applies to publishing image data to MQTT via 'frigate/<camera_name>/<object_name>/snapshot'.
      # All other messages will still be published.
      enabled: true
      # Optional: print a timestamp on the snapshots (default: shown below)
      timestamp: true
      # Optional: draw bounding box on the snapshots (default: shown below)
      bounding_box: true
      # Optional: crop the snapshot (default: shown below)
      # crop: true
      # Optional: height to resize the snapshot to (default: shown below)
      # height: 270
      # Optional: jpeg encode quality (default: shown below)
      quality: 100
      # Optional: Restrict mqtt messages to objects that entered any of the listed zones (default: no required zones)
      required_zones: []
  IC-3116W:
    # Optional: Enable/Disable the camera (default: shown below).
    # If disabled: config is used but no live stream and no capture etc.
    # Events/Recordings are still viewable.
    enabled: true
    # Required: ffmpeg settings for the camera
    ffmpeg:
      # Required: A list of input streams for the camera. See documentation for more information.
      inputs:
        # Required: the path to the stream
        # NOTE: path may include environment variables or docker secrets, which must begin with 'FRIGATE_' and be referenced in {}
      - path: rtsp://xxxxxxxxxx:yyyyyyyyyyy@ZZ.ZZ.ZZ.253:554/ipcam_mjpeg.sdp
        roles:
        - audio
        - detect
        - record
        - rtmp

    # to be replaced by a newer image. (default: shown below)
    best_image_timeout: 60
    # Optional: URL to visit the camera web UI directly from the system page. Might not be available on every camera.
    webui_url: ''
    ui:
      order: 0
      dashboard: true

    # Optional: Configuration for how to sort the cameras in the Birdseye view.
    birdseye:
      order: 0

    motion:
      mask:
      - 0,186,521,132,550,109,640,109,640,0,297,0,0,0
    zones:
      zone_puerta_terraza:
        coordinates: 640,188,585,412,115,397,118,158
    snapshots:
      enabled: true

    mqtt:
      # Optional: Enable publishing snapshot via mqtt for camera (default: shown below)
      # NOTE: Only applies to publishing image data to MQTT via 'frigate/<camera_name>/<object_name>/snapshot'.
      # All other messages will still be published.
      enabled: true
      # Optional: print a timestamp on the snapshots (default: shown below)
      timestamp: true
      # Optional: draw bounding box on the snapshots (default: shown below)
      bounding_box: true
      # Optional: crop the snapshot (default: shown below)
      # crop: true
      # Optional: height to resize the snapshot to (default: shown below)
      # height: 270
      # Optional: jpeg encode quality (default: shown below)
      quality: 100
      # Optional: Restrict mqtt messages to objects that entered any of the listed zones (default: no required zones)
      required_zones: []

una vez abramos el navegador accederemos a la vista principal de la cámaras donde podremos gestionarlas.

En el botón eventos veremos todos aquellos eventos que ha ido detectando el sistema

En sistema veremos la velocidad de interferencia y los frames que se tiene que saltar por no tener recursos , al principio le asigne 4 cpu’s y se saltaba algunos frames dando bastantes falsos positivos , fue asignarle 6 cpu’s y a funcionar como una seda

Este seria el consumo de recursos en el TVS-h674 , ni se inmuta ….

Una de las cosas que echo en falta respecto a motioneye es que no tiene autenticación , por eso si lo vais a abrir al exterior ( cosa que yo no haría ) , se puede solventar con la autenticación básica de Traefik

Y con esto y un bizcocho ….