Translate ONVIF events (from IP Cameras) to MQTT messages.
511
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.
Anything other than Motion Sensor has only been tested with a TAPO C120 on the latest firmware.
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 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.
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.
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
Content type
Image
Digest
sha256:bb00f91f6…
Size
419.1 MB
Last updated
over 1 year ago
docker pull kosdk/onvif2mqtt