I am using this docker application with my Hikvision Doorbell to detect motion from the DB built in PIR.
Never documented my installation.
Utilizing Hikvision Batch Configuration
1 - enable ONVIF and save configuration.
2 - create and adjust the motion detection.
onvif2mqtt
1 - docker pull dfarkov/onvif2mqtt:latest
2 - cd /opt
3 - git clone dmitrif/onvif2mqtt
4 - mkdir /opt/onvif2mqtt/config
5 - cd /opt/onvif2mqtt
6 - nano config.yml
create config.yml
mqtt:
host: www.xxx.yyy.zzz
port: 1883
onvif:
- name: Doorbell
hostname: IP of Doorbell
port: 80
username: admin
password: password
log: trace
8 -
docker run -d --name="onvif2mqtt" -v /opt/onvif2mqtt:/config -v /etc/localtime:/etc/localtime:ro --net=host --restart always dfarkov/onvif2mqtt
9 - docker ps shows it running
10 - MQTT Explorer shows it running
11 - docker logs onvif2mqtt will show it running with no errors if configured correctly.
Never documented my installation.
Utilizing Hikvision Batch Configuration
1 - enable ONVIF and save configuration.
2 - create and adjust the motion detection.
onvif2mqtt
1 - docker pull dfarkov/onvif2mqtt:latest
2 - cd /opt
3 - git clone dmitrif/onvif2mqtt
4 - mkdir /opt/onvif2mqtt/config
5 - cd /opt/onvif2mqtt
6 - nano config.yml
create config.yml
mqtt:
host: www.xxx.yyy.zzz
port: 1883
onvif:
- name: Doorbell
hostname: IP of Doorbell
port: 80
username: admin
password: password
log: trace
8 -
docker run -d --name="onvif2mqtt" -v /opt/onvif2mqtt:/config -v /etc/localtime:/etc/localtime:ro --net=host --restart always dfarkov/onvif2mqtt
9 - docker ps shows it running
10 - MQTT Explorer shows it running
11 - docker logs onvif2mqtt will show it running with no errors if configured correctly.
Code:
[SIZE=11px][I]> onvif-cam@1.0.4 start /onvif2mqtt > node dist/index.js {"level":30,"time":1618714516800,"msg":"Loading configuration. {\"configPath\":\"/config/config.yml\"}","v":1} {"level":30,"time":1618714516805,"msg":"Validating configuration file.","v":1} {"level":30,"time":1618714516809,"name":"Manager","msg":"Beg inning initialization...","v":1} {"level":30,"time":1618714516810,"name":"MQTT","hostname":"1 92.168.244.150:1883","msg":"Connecting.","v":1} {"level":30,"time":1618714516849,"name":"MQTT","hostname":"1 92.168.244.150:1883","msg":"Successfully connected.","v":1} {"level":20,"time":1618714516850,"name":"MQTT","hostname":"1 92.168.244.150:1883","msg":"Publishing. {\"topic\":\"onvif2mqtt/status\",\"value\":\"ON\",\"retain\":true}","v":1} {"level":30,"time":1618714516851,"name":"ONVIF/Doorbell","hostname":"192.168.244.152","msg":"Attempting connection.","v":1} {"level":20,"time":1618714516852,"name":"MQTT","hostname":"1 92.168.244.150:1883","msg":"Publishing. {\"topic\":\"onvif2mqtt/Doorbell/motion\",\"value\":\"OFF\",\"retain\":true}","v":1} {"level":30,"time":1618714517076,"name":"ONVIF/Doorbell","hostname":"192.168.244.152","msg":"Successfully connected.","v":1} {"level":30,"time":1618714520212,"name":"ONVIF/Doorbell","hostname":"192.168.244.152","msg":"CreatePullPoin tSubscription Doorbell","v":1} > onvif-cam@1.0.4 start /onvif2mqtt > node dist/index.js {"level":30,"time":1618715500006,"msg":"Loading configuration. {\"configPath\":\"/config/config.yml\"}","v":1} {"level":30,"time":1618715500011,"msg":"Validating configuration file.","v":1} {"level":30,"time":1618715500015,"name":"Manager","msg":"Beg inning initialization...","v":1} {"level":30,"time":1618715500015,"name":"MQTT","hostname":"1 92.168.244.150:1883","msg":"Connecting.","v":1} {"level":30,"time":1618715500057,"name":"MQTT","hostname":"1 92.168.244.150:1883","msg":"Successfully connected.","v":1} {"level":20,"time":1618715500057,"name":"MQTT","hostname":"1 92.168.244.150:1883","msg":"Publishing. {\"topic\":\"onvif2mqtt/status\",\"value\":\"ON\",\"retain\":true}","v":1} {"level":30,"time":1618715500059,"name":"ONVIF/Doorbell","hostname":"192.168.244.152","msg":"Attempting connection.","v":1} {"level":20,"time":1618715500060,"name":"MQTT","hostname":"1 92.168.244.150:1883","msg":"Publishing. {\"topic\":\"onvif2mqtt/Doorbell/motion\",\"value\":\"OFF\",\"retain\":true}","v":1} {"level":30,"time":1618715500313,"name":"ONVIF/Doorbell","hostname":"192.168.244.152","msg":"Successfully connected.","v":1} {"level":30,"time":1618715500405,"name":"ONVIF/Doorbell","hostname":"192.168.244.152","msg":"CreatePullPoin tSubscription Doorbell","v":1}[/I][/SIZE]