Announcement

Collapse
No announcement yet.

ONVIF to MQTT

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    ONVIF to MQTT

    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.

    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]
    - Pete

    Auto mator
    Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
    Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
    HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

    HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
    HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

    X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant
Working...
X