@
dfarkov,
Thank you for the post. This is the way I installed it in Docker and I see it running with MQTT Explorer. Great stuff.
Not sure this is the proper way to install it but it works for me.
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.dev.yml
7 - cp config.dev.yml /opt/onvif2mqtt/config/config.yml
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 continously restarting.
5420978e7f67 dfarkov/onvif2mqtt "docker-entrypoint.s…" 9 minutes ago Restarting (1) 53 seconds ago onvif2mqtt
10 - MQTT Explorer shows it running (well partially)
View attachment 58125
11- logs show errors...
thinking I messed up the IP of the camera and MQTT server...
}
{"level":30,"time":1585314771147,"msg":"Loading configuration. {\"configPath\":\"/config/config.yml\"}","v":1}
{"level":30,"time":1585314771158,"msg":"Validating configuration file.","v":1}
{"level":30,"time":1585314771466,"name":"Manager","msg":"Beginning initialization...","v":1}
{"level":30,"time":1585314771468,"name":"MQTT","hostname":"192.168.244.150:undefined","msg":"Connecting.","v":1}
{"level":30,"time":1585314771644,"name":"MQTT","hostname":"192.168.244.150:undefined","msg":"Successfully connected.","v":1}
{"level":30,"time":1585314771647,"name":"ONVIF/doorbell","hostname":"192.168.244.150","msg":"Attempting connection.","v":1}
{"level":20,"time":1585314771652,"name":"MQTT","hostname":"192.168.244.150:undefined","msg":"Publishing. {\"topic\":\"onvif2mqtt/doorbell/json\",\"value\":\"{\\n \\\"device\\\": \\\"doorbell\\\",\\n \\\"event\\\": \\\"motion\\\"\\n \\\"state\\\": \\\"false\\\"\\n}\",\"retain\":false}","v":1}
{"level":20,"time":1585314771654,"name":"MQTT","hostname":"192.168.244.150:undefined","msg":"Publishing. {\"topic\":\"onvif2mqtt/doorbell/motion\",\"value\":\"OFF\",\"retain\":true}","v":1}
{"level":50,"time":1585314771686,"name":"ONVIF/doorbell","hostname":"192.168.244.150","msg":"Failed to connect to doorbell {\"errno\":\"ECONNREFUSED\",\"code\":\"ECONNREFUSED\",\"syscall\":\"connect\",\"address\":\"192.168.244.150\",\"port\":80}","v":1}
{"level":30,"time":1585314771687,"name":"ONVIF/doorbell","hostname":"192.168.244.150","msg":"Successfully connected.","v":1}
/node_modules/onvif/lib/cam.js:185
? (this.uri[options.service] ? this.uri[options.service].path : options.service)
Duh....messed up the configuration yaml using the same IP for the MQTT server and camera...fat fingered it...looks to be running now...
docker ps shows...
19a8f406c00d dfarkov/onvif2mqtt "docker-entrypoint.s…" 2 minutes ago Up 2 minutes onvif2mqtt
docker logs onvif2mqtt looks ok but not understanding undefined.
{"level":30,"time":1585316096223,"msg":"Loading configuration. {\"configPath\":\"/config/config.yml\"}","v":1}
{"level":30,"time":1585316096234,"msg":"Validating configuration file.","v":1}
{"level":30,"time":1585316096564,"name":"Manager","msg":"Beginning initialization...","v":1}
{"level":30,"time":1585316096565,"name":"MQTT","hostname":"
192.168.244.150:undefined","msg":"Connecting.","v":1}
{"level":30,"time":1585316096738,"name":"MQTT","hostname":"192.168.244.150:undefined","msg":"Successfully connected.","v":1}
{"level":30,"time":1585316096741,"name":"ONVIF/doorbell","hostname":"192.168.244.152","msg":"Attempting connection.","v":1}
{"level":20,"time":1585316096747,"name":"MQTT","hostname":"192.168.244.150:undefined","msg":"Publishing. {\"topic\":\"onvif2mqtt/doorbell/json\",\"value\":\"{\\n \\\"device\\\": \\\"doorbell\\\",\\n \\\"event\\\": \\\"motion\\\"\\n \\\"state\\\": \\\"false\\\"\\n}\",\"retain\":false}","v":1}
{"level":20,"time":1585316096750,"name":"MQTT","hostname":"192.168.244.150:undefined","msg":"Publishing. {\"topic\":\"onvif2mqtt/doorbell/motion\",\"value\":\"OFF\",\"retain\":true}","v":1}
{"level":30,"time":1585316097048,"name":"ONVIF/doorbell","hostname":"192.168.244.152","msg":"Successfully connected.","v":1}
Have HA and my OmniPro2 / Samsung Smartthings hub running in docker. Homeseer is also reading the MQTT stuff.