Sign inSign up

kosdk/onvif2mqtt

By kosdk

•Updated over 1 year ago

Translate ONVIF events (from IP Cameras) to MQTT messages.

Image
Security
Internet of things
0

511

kosdk/onvif2mqtt repository overview

⁠ONVIF2MQTT

Forked from Dmitri Farkov's original project. Modifications made to support ONVIF AI events for TAPO cameras, but can be easily extended for other devices.

⁠Supported Events

  • Motion Sensor
  • Person Detection
  • Line Cross
  • Vehicle Detection
  • Pet Detection

Anything other than Motion Sensor has only been tested with a TAPO C120 on the latest firmware.

⁠Installation

⁠Docker

The recommended method.

Pull the image from docker registry.

docker pull kosdk/onvif2mqtt:latest

Run the image, mounting a config volume containing your configuration (config.yml)

docker run -v PATH_TO_CONFIGURATION_FOLDER:/config dfarkov/onvif2mqtt

⁠Configuration

⁠Notes

Configuration can be placed into a config.yml file, containing valid YAML. This file should be placed into the host-mounted config volume; if another location is preferred then the file path can be provided as an environment variable CONFIG_PATH.

⁠MQTT Notes

By default this package publishes events to an topic onvif2mqtt/$ONVIF_DEVICE/$EVENT_TYPE/ with a value of on | off for each captured event type.

⁠Schema
api:
  templates:
    #Subtopics can be nested with `/` and are interpolated
    - subtopic: ${eventType}/json 
      # Should this message be retained by MQTT
      # Defaults to true
      retain: false
      # Template that should be published to the topic, 
      # values are interpolated
      template: >- 
        { 
          "device": "${onvifDeviceId}", 
          "eventType": "${eventType}", 
          "state": "${eventState}" 
        }
    # You can specify any number of custom subtopics.
    - subtopic: hello_world
      template: hello from ${onvifDeviceId}
# MQTT Broker configuration, 
# required due to nature of project.
mqtt:
  host: 192.168.0.57
  port: 1883
  username: user
  password: password
  clientId: clientId
# All of your ONVIF devices
onvif:
  # Name for the device (used in MQTT topic)
  - name: doorbell
    hostname: localhost
    port: 80
    username: admin
    password: admin

Tag summary

Content type

Image

Digest

sha256:bb00f91f6…

Size

419.1 MB

Last updated

over 1 year ago

docker pull kosdk/onvif2mqtt