Code Monkey home page Code Monkey logo

onvif2mqtt's People

Contributors

allcontributors[bot] avatar benedikt45 avatar bgilmer77 avatar brilthor avatar dependabot[bot] avatar djtim avatar dmitrif avatar fossabot avatar honky-bear avatar ksupipr avatar nikolaykash avatar xdanik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

onvif2mqtt's Issues

PullPointSubscription request freezes camera (Reolink E1 Zoom)

Every 5 seconds I am getting the following in the log and the camera becomes unresponsive:

{"level":50,"time":1621437546824,"name":"ONVIF/camera_reolink_living_room","hostname":"192.168.x.y","msg":"CreatePullPointSubscription camera_reolink_living_room","v":1}

Wont run on docker from a synology NAS

sudo docker run -v /opt/config:/config dfarkov/onvif2mqtt

[email protected] start /
node dist/index.js

{"level":30,"time":1589486125412,"msg":"Loading configuration. {"configPath":"/config/config.yml"}","v":1}
{"level":30,"time":1589486125493,"msg":"Validating configuration file.","v":1}
{"level":30,"time":1589486126244,"name":"Manager","msg":"Beginning initialization...","v":1}
{"level":30,"time":1589486126245,"name":"MQTT","hostname":"127.0.0.1:1883","msg":"Connecting.","v":1}

I get this output which starts on the docker and I can see it with docker ps command but it never shows up mqtt explorer and I believe it either is not loading the config or it has some prereq that is not met but it is not giving any output to explain whats going on. I have installed the node.js v8 on the synology so that should be all it needs.

Multiple devices?

I have two ONVIF devices including an EZVIZ doorbell camera.

What does the config file look like for multiple devices? Is it supported?
I tried two sections starting with -name.
That seemed to result in duplicate events generated when the first device detected motion.

FYI: I tested with an Amcrest 4mp and Amcrest 8mp POE camera. They both appear to work fine.
I also tested with a Reolink 5mp POE camera. It did not work with that camera.

TypeError: response.currentTime.getTime is not a function

Hi,

I just received a new camera which should support Onvif. It does, but initially an error is triggered.
I did some digging around and found a workaround by patching node_modules/onvif/lib/events.js.
Apparently the package "onvif" does not correctly parse the response and not parse date.
This patch worked:

function _terminationTime(response) {
                if (typeof response.currentTime === "string") {
                   response.currentTime = new Date(Date.parse(response.currentTime));
                }    
                if (typeof response.terminationTime === "string") {
                   response.terminationTime = new Date(Date.parse(response.terminationTime));
                }   
                return new Date(Date.now() - response.currentTime.getTime() + response.terminationTime.getTime());
        }

[Feature] Implement Mqtt standard specification

It would be interesting to implement in this project the specification describe here :
https://homieiot.github.io/

However, MQTT doesn’t define the structure and content of these messages and their relation. An IoT device publishes data and provides interaction possibilities but a controlling entity will need to be specifically configured to be able to interface with the device.

The Homie convention defines a standardized way of how IoT devices and services announce themselves and their data on the MQTT broker.

It is thereby a crucial aspect on top of the MQTT protocol for automatic discovery, configuration and usage of devices and services.

Some other xxx2mqtt already purpose this and I think specification for MQTT is the futur of home automation.
It would be not changing the way of this project work actually, but add another way to publish.

I'm from the open source project NextDom (home automation software) and we are working on another solution from scratch. We want to organize NextDom directly with MQTT and Node-Red (Nextdom becoming a kind of orchestrator. In this way, this standard for MQTT will be very interesting for us of course, but also for all others home automation software.

Thanks for reading and give me some feed back about that !

Reconnect After Camera Drops Wifi

When the doorbell drops wifi the onvif2mqtt client doesn't reconnect. When I restart onvif2mqtt everything is good until the next time the doorbell drops.

Is it possible to add a reconnect capability?

Thank you

JideTech ONVIF Camera -

I was playing around with my JideTech cameras and notices that the "simpleItem" they send in motion event is an array (see debug below)

[1609711795443] INFO  (ONVIF): ONVIF  onSubscriberEvent {"topic":{"_":"tns1:RuleEngine/CellMotionDetector/Motion","$":{"Dialect":"http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet"}},"message":{"message":{"$":{"UtcTime":"2021-01-03T22:09:55.676"},"source":{"simpleItem":[{"$":{"Name":"Window","Value":0}},{"$":{"Name":"Source","Value":"000"}},{"$":{"Name":"VideoSourceConfigurationToken","Value":"VideoSourceToken"}},{"$":{"Name":"VideoAnalyticsConfigurationToken","Value":"VideoAnalyticsToken"}},{"$":{"Name":"Rule","Value":"MyMotionDetectorRule"}}]},"data":{"simpleItem":[{"$":{"Name":"Motion","Value":1}},{"$":{"Name":"State","Value":true}},{"$":{"Name":"IsMotion","Value":true}}]}}}}

Is this allowed in ONVIF standard? If so, it will be nice to have a fix. For now, I hacked SubscriberGroup.js line from

    const eventValue = event.message.message.data.simpleItem.$.Value;

to

   const eventValue = event.message.message.data.simpleItem[0].$.Value;

And it worked for my camera - obviously this breaks other cameras that don't send an array. Perhaps a check on testing for array could be added as a fallback? Thanks

ADD Support for camera

Hi,
I have a new camera that I think is publish in a different way , and the event doesn't handle by the onvif2mqtt,
when I start onvif2mqtt the onvif2mqtt/camera/motion is "ON" , and when there is a motion detection onvif2mqtt send to the topic (onvif2mqtt/camera/motion) the value "OFF" , but it doesn't change the value after there is no motion.
pleas help me
this is the log from the camera :

(reply){
   CurrentTime = 2021-03-14 15:00:21
   TerminationTime = 2021-03-14 15:01:21
   NotificationMessage[] =
      (NotificationMessageHolderType){
         Topic =
            (Topic){
               value = "tns1:RuleEngine/TamperDetector/Tamper"
               _Dialect = "http://www.onvif.org/ver10/tev/topicExpression/Concre                                                                             teSet"
            }
         Message =
            (Message){
               Message =
                  (Message){
                     _UtcTime = "2021-03-14T13:00:21Z"
                     _PropertyOperation = "Initialized"
                     Source =
                        (Source){
                           SimpleItem[] =
                              (SimpleItem){
                                 _Name = "VideoSource"
                                 _Value = "V_SRC_000"
                              },
                              (SimpleItem){
                                 _Name = "Rule"
                                 _Value = "MyTamperDetectorRule"
                              },
                        }
                     Data =
                        (Data){
                           SimpleItem =
                              (SimpleItem){
                                 _Name = "IsTamper"
                                 _Value = "true"
                              }
                        }
                  }
            }
      },
      (NotificationMessageHolderType){
         Topic =
            (Topic){
               value = "tns1:RuleEngine/CellMotionDetector/Motion"
               _Dialect = "http://www.onvif.org/ver10/tev/topicExpression/Concre                                                                             teSet"
            }
         Message =
            (Message){
               Message =
                  (Message){
                     _UtcTime = "2021-03-14T13:00:21Z"
                     _PropertyOperation = "Initialized"
                     Source =
                        (Source){
                           SimpleItem[] =
                              (SimpleItem){
                                 _Name = "VideoSource"
                                 _Value = "V_SRC_000"
                              },
                              (SimpleItem){
                                 _Name = "Rule"
                                 _Value = "MyMotionDetectorRule"
                              },
                        }
                     Data =
                        (Data){
                           SimpleItem =
                              (SimpleItem){
                                 _Name = "State"
                                 _Value = "true"
                              }
                        }
                  }
            }
      },
      (NotificationMessageHolderType){
         Topic =
            (Topic){
               value = "tns1:VideoSource/MotionAlarm"
               _Dialect = "http://www.onvif.org/ver10/tev/topicExpression/Concre                                                                             teSet"
            }
         Message =
            (Message){
               Message =
                  (Message){
                     _UtcTime = "2021-03-14T13:00:21Z"
                     _PropertyOperation = "Initialized"
                     Source =
                        (Source){
                           SimpleItem =
                              (SimpleItem){
                                 _Name = "Source"
                                 _Value = "V_SRC_000"
                              }
                        }
                     Data =
                        (Data){
                           SimpleItem =
                              (SimpleItem){
                                 _Name = "State"
                                 _Value = "true"
                              }
                        }
                  }
            }
      },
      (NotificationMessageHolderType){
         Topic =
            (Topic){
               value = "tns1:Device/Trigger/DigitalInput"
               _Dialect = "http://www.onvif.org/ver10/tev/topicExpression/Concre                                                                             teSet"
            }
         Message =
            (Message){
               Message =
                  (Message){
                     _UtcTime = "2021-03-14T13:00:21Z"
                     _PropertyOperation = "Initialized"
                     Source =
                        (Source){
                           SimpleItem =
                              (SimpleItem){
                                 _Name = "InputToken"
                                 _Value = "DIGIT_INPUT_000"
                              }
                        }
                     Data =
                        (Data){
                           SimpleItem =
                              (SimpleItem){
                                 _Name = "LogicalState"
                                 _Value = "true"
                              }
                        }
                  }
            }
      },
      (NotificationMessageHolderType){
         Topic =
            (Topic){
               value = "tns1:RuleEngine/TamperDetector/Tamper"
               _Dialect = "http://www.onvif.org/ver10/tev/topicExpression/Concre                                                                             teSet"
            }
         Message =
            (Message){
               Message =
                  (Message){
                     _UtcTime = "2021-03-14T13:00:21Z"
                     _PropertyOperation = "Initialized"
                     Source =
                        (Source){
                           SimpleItem[] =
                              (SimpleItem){
                                 _Name = "VideoSource"
                                 _Value = "V_SRC_000"
                              },
                              (SimpleItem){
                                 _Name = "Rule"
                                 _Value = "MyTamperDetectorRule"
                              },
                        }
                     Data =
                        (Data){
                           SimpleItem =
                              (SimpleItem){
                                 _Name = "IsTamper"
                                 _Value = "true"
                              }
                        }
                  }
            }
      },
      (NotificationMessageHolderType){
         Topic =
            (Topic){
               value = "tns1:RuleEngine/CellMotionDetector/Motion"
               _Dialect = "http://www.onvif.org/ver10/tev/topicExpression/Concre                                                                             teSet"
            }
         Message =
            (Message){
               Message =
                  (Message){
                     _UtcTime = "2021-03-14T13:00:21Z"
                     _PropertyOperation = "Initialized"
                     Source =
                        (Source){
                           SimpleItem[] =
                              (SimpleItem){
                                 _Name = "VideoSource"
                                 _Value = "V_SRC_000"
                              },
                              (SimpleItem){
                                 _Name = "Rule"
                                 _Value = "MyMotionDetectorRule"
                              },
                        }
                     Data =
                        (Data){
                           SimpleItem =
                              (SimpleItem){
                                 _Name = "State"
                                 _Value = "true"
                              }
                        }
                  }
            }
      },
      (NotificationMessageHolderType){
         Topic =
            (Topic){
               value = "tns1:VideoSource/MotionAlarm"
               _Dialect = "http://www.onvif.org/ver10/tev/topicExpression/Concre                                                                             teSet"
            }
         Message =
            (Message){
               Message =
                  (Message){
                     _UtcTime = "2021-03-14T13:00:21Z"
                     _PropertyOperation = "Initialized"
                     Source =
                        (Source){
                           SimpleItem =
                              (SimpleItem){
                                 _Name = "Source"
                                 _Value = "V_SRC_000"
                              }
                        }
                     Data =
                        (Data){
                           SimpleItem =
                              (SimpleItem){
                                 _Name = "State"
                                 _Value = "true"
                              }
                        }
                  }
            }
      },
      (NotificationMessageHolderType){
         Topic =
            (Topic){
               value = "tns1:Device/Trigger/DigitalInput"
               _Dialect = "http://www.onvif.org/ver10/tev/topicExpression/Concre                                                                             teSet"
            }
         Message =
            (Message){
               Message =
                  (Message){
                     _UtcTime = "2021-03-14T13:00:21Z"
                     _PropertyOperation = "Initialized"
                     Source =
                        (Source){
                           SimpleItem =
                              (SimpleItem){
                                 _Name = "InputToken"
                                 _Value = "DIGIT_INPUT_000"
                              }
                        }
                     Data =
                        (Data){
                           SimpleItem =
                              (SimpleItem){
                                 _Name = "LogicalState"
                                 _Value = "true"
                              }
                        }
                  }
            }
      },
      (NotificationMessageHolderType){
         Topic =
            (Topic){
               value = "tns1:RuleEngine/TamperDetector/Tamper"
               _Dialect = "http://www.onvif.org/ver10/tev/topicExpression/Concre                                                                             teSet"
            }
         Message =
            (Message){
               Message =
                  (Message){
                     _UtcTime = "2021-03-14T13:00:21Z"
                     _PropertyOperation = "Initialized"
                     Source =
                        (Source){
                           SimpleItem[] =
                              (SimpleItem){
                                 _Name = "VideoSource"
                                 _Value = "V_SRC_000"
                              },
                              (SimpleItem){
                                 _Name = "Rule"
                                 _Value = "MyTamperDetectorRule"
                              },
                        }
                     Data =
                        (Data){
                           SimpleItem =
                              (SimpleItem){
                                 _Name = "IsTamper"
                                 _Value = "true"
                              }
                        }
                  }
            }
      },
      (NotificationMessageHolderType){
         Topic =
            (Topic){
               value = "tns1:RuleEngine/CellMotionDetector/Motion"
               _Dialect = "http://www.onvif.org/ver10/tev/topicExpression/Concre                                                                             teSet"
            }
         Message =
            (Message){
               Message =
                  (Message){
                     _UtcTime = "2021-03-14T13:00:21Z"
                     _PropertyOperation = "Initialized"
                     Source =
                        (Source){
                           SimpleItem[] =
                              (SimpleItem){
                                 _Name = "VideoSource"
                                 _Value = "V_SRC_000"
                              },
                              (SimpleItem){
                                 _Name = "Rule"
                                 _Value = "MyMotionDetectorRule"
                              },
                        }
                     Data =
                        (Data){
                           SimpleItem =
                              (SimpleItem){
                                 _Name = "State"
                                 _Value = "true"
                              }
                        }
                  }
            }
      },
      (NotificationMessageHolderType){
         Topic =
            (Topic){
               value = "tns1:VideoSource/MotionAlarm"
               _Dialect = "http://www.onvif.org/ver10/tev/topicExpression/Concre                                                                             teSet"
            }
         Message =
            (Message){
               Message =
                  (Message){
                     _UtcTime = "2021-03-14T13:00:21Z"
                     _PropertyOperation = "Initialized"
                     Source =
                        (Source){
                           SimpleItem =
                              (SimpleItem){
                                 _Name = "Source"
                                 _Value = "V_SRC_000"
                              }
                        }
                     Data =
                        (Data){
                           SimpleItem =
                              (SimpleItem){
                                 _Name = "State"
                                 _Value = "true"
                              }
                        }
                  }
            }
      },
      (NotificationMessageHolderType){
         Topic =
            (Topic){
               value = "tns1:Device/Trigger/DigitalInput"
               _Dialect = "http://www.onvif.org/ver10/tev/topicExpression/Concre                                                                             teSet"
            }
         Message =
            (Message){
               Message =
                  (Message){
                     _UtcTime = "2021-03-14T13:00:21Z"
                     _PropertyOperation = "Initialized"
                     Source =
                        (Source){
                           SimpleItem =
                              (SimpleItem){
                                 _Name = "InputToken"
                                 _Value = "DIGIT_INPUT_000"
                              }
                        }
                     Data =
                        (Data){
                           SimpleItem =
                              (SimpleItem){
                                 _Name = "LogicalState"
                                 _Value = "true"
                              }
                        }
                  }
            }
      },
      (NotificationMessageHolderType){
         Topic =
            (Topic){
               value = "tns1:RuleEngine/TamperDetector/Tamper"
               _Dialect = "http://www.onvif.org/ver10/tev/topicExpression/Concre                                                                             teSet"
            }
         Message =
            (Message){
               Message =
                  (Message){
                     _UtcTime = "2021-03-14T13:00:21Z"
                     _PropertyOperation = "Initialized"
                     Source =
                        (Source){
                           SimpleItem[] =
                              (SimpleItem){
                                 _Name = "VideoSource"
                                 _Value = "V_SRC_000"
                              },
                              (SimpleItem){
                                 _Name = "Rule"
                                 _Value = "MyTamperDetectorRule"
                              },
                        }
                     Data =
                        (Data){
                           SimpleItem =
                              (SimpleItem){
                                 _Name = "IsTamper"
                                 _Value = "true"
                              }
                        }
                  }
            }
      },
      (NotificationMessageHolderType){
         Topic =
            (Topic){
               value = "tns1:RuleEngine/CellMotionDetector/Motion"
               _Dialect = "http://www.onvif.org/ver10/tev/topicExpression/Concre                                                                             teSet"
            }
         Message =
            (Message){
               Message =
                  (Message){
                     _UtcTime = "2021-03-14T13:00:21Z"
                     _PropertyOperation = "Initialized"
                     Source =
                        (Source){
                           SimpleItem[] =
                              (SimpleItem){
                                 _Name = "VideoSource"
                                 _Value = "V_SRC_000"
                              },
                              (SimpleItem){
                                 _Name = "Rule"
                                 _Value = "MyMotionDetectorRule"
                              },
                        }
                     Data =
                        (Data){
                           SimpleItem =
                              (SimpleItem){
                                 _Name = "State"
                                 _Value = "true"
                              }
                        }
                  }
            }
      },
      (NotificationMessageHolderType){
         Topic =
            (Topic){
               value = "tns1:VideoSource/MotionAlarm"
               _Dialect = "http://www.onvif.org/ver10/tev/topicExpression/Concre                                                                             teSet"
            }
         Message =
            (Message){
               Message =
                  (Message){
                     _UtcTime = "2021-03-14T13:00:21Z"
                     _PropertyOperation = "Initialized"
                     Source =
                        (Source){
                           SimpleItem =
                              (SimpleItem){
                                 _Name = "Source"
                                 _Value = "V_SRC_000"
                              }
                        }
                     Data =
                        (Data){
                           SimpleItem =
                              (SimpleItem){
                                 _Name = "State"
                                 _Value = "true"
                              }
                        }
                  }
            }
      },
      (NotificationMessageHolderType){
         Topic =
            (Topic){
               value = "tns1:Device/Trigger/DigitalInput"
               _Dialect = "http://www.onvif.org/ver10/tev/topicExpression/Concre                                                                             teSet"
            }
         Message =
            (Message){
               Message =
                  (Message){
                     _UtcTime = "2021-03-14T13:00:21Z"
                     _PropertyOperation = "Initialized"
                     Source =
                        (Source){
                           SimpleItem =
                              (SimpleItem){
                                 _Name = "InputToken"
                                 _Value = "DIGIT_INPUT_000"
                              }
                        }
                     Data =
                        (Data){
                           SimpleItem =
                              (SimpleItem){
                                 _Name = "LogicalState"
                                 _Value = "true"
                              }
                        }
                  }
            }
      },
      (NotificationMessageHolderType){
         Topic =
            (Topic){
               value = "tns1:RuleEngine/TamperDetector/Tamper"
               _Dialect = "http://www.onvif.org/ver10/tev/topicExpression/Concre                                                                             teSet"
            }
         Message =
            (Message){
               Message =
                  (Message){
                     _UtcTime = "2021-03-14T13:00:20Z"
                     _PropertyOperation = "Initialized"
                     Source =
                        (Source){
                           SimpleItem[] =
                              (SimpleItem){
                                 _Name = "VideoSource"
                                 _Value = "V_SRC_000"
                              },
                              (SimpleItem){
                                 _Name = "Rule"
                                 _Value = "MyTamperDetectorRule"
                              },
                        }
                     Data =
                        (Data){
                           SimpleItem =
                              (SimpleItem){
                                 _Name = "IsTamper"
                                 _Value = "true"
                              }
                        }
                  }
            }
      },
      (NotificationMessageHolderType){
         Topic =
            (Topic){
               value = "tns1:RuleEngine/CellMotionDetector/Motion"
               _Dialect = "http://www.onvif.org/ver10/tev/topicExpression/Concre                                                                             teSet"
            }
         Message =
            (Message){
               Message =
                  (Message){
                     _UtcTime = "2021-03-14T13:00:20Z"
                     _PropertyOperation = "Initialized"
                     Source =
                        (Source){
                           SimpleItem[] =
                              (SimpleItem){
                                 _Name = "VideoSource"
                                 _Value = "V_SRC_000"
                              },
                              (SimpleItem){
                                 _Name = "Rule"
                                 _Value = "MyMotionDetectorRule"
                              },
                        }
                     Data =
                        (Data){
                           SimpleItem =
                              (SimpleItem){
                                 _Name = "State"
                                 _Value = "true"
                              }
                        }
                  }
            }
      },
      (NotificationMessageHolderType){
         Topic =
            (Topic){
               value = "tns1:VideoSource/MotionAlarm"
               _Dialect = "http://www.onvif.org/ver10/tev/topicExpression/Concre                                                                             teSet"
            }
         Message =
            (Message){
               Message =
                  (Message){
                     _UtcTime = "2021-03-14T13:00:20Z"
                     _PropertyOperation = "Initialized"
                     Source =
                        (Source){
                           SimpleItem =
                              (SimpleItem){
                                 _Name = "Source"
                                 _Value = "V_SRC_000"
                              }
                        }
                     Data =
                        (Data){
                           SimpleItem =
                              (SimpleItem){
                                 _Name = "State"
                                 _Value = "true"
                              }
                        }
                  }
            }
      },
      (NotificationMessageHolderType){
         Topic =
            (Topic){
               value = "tns1:Device/Trigger/DigitalInput"
               _Dialect = "http://www.onvif.org/ver10/tev/topicExpression/Concre                                                                             teSet"
            }
         Message =
            (Message){
               Message =
                  (Message){
                     _UtcTime = "2021-03-14T13:00:20Z"
                     _PropertyOperation = "Initialized"
                     Source =
                        (Source){
                           SimpleItem =
                              (SimpleItem){
                                 _Name = "InputToken"
                                 _Value = "DIGIT_INPUT_000"
                              }
                        }
                     Data =
                        (Data){
                           SimpleItem =
                              (SimpleItem){
                                 _Name = "LogicalState"
                                 _Value = "true"
                              }
                        }
                  }
            }
      },
 }

the log from onvif2mqtt:

onvif2mqtt       | {"level":30,"time":1615815275074,"name":"ONVIF/camera","hostname":"192.168.31.27","msg":"CreatePullPointSubscription camera","v":1}
onvif2mqtt       | {"level":20,"time":1615816834006,"name":"MQTT","hostname":"192.168.31.100:1883","msg":"Publishing. {\"topic\":\"onvif2mqtt/camera/motion\",\"value\":\"ON\",\"retain\":true}","v":1}
onvif2mqtt       | {"level":20,"time":1615834504440,"name":"MQTT","hostname":"192.168.31.100:1883","msg":"Publishing. {\"topic\":\"onvif2mqtt/camera/motion\",\"value\":\"OFF\",\"retain\":true}","v":1}
onvif2mqtt       | {"level":20,"time":1615834504478,"name":"MQTT","hostname":"192.168.31.100:1883","msg":"Publishing. {\"topic\":\"onvif2mqtt/camera/motion\",\"value\":\"OFF\",\"retain\":true}","v":1}
onvif2mqtt       | {"level":20,"time":1615834504479,"name":"MQTT","hostname":"192.168.31.100:1883","msg":"Publishing. {\"topic\":\"onvif2mqtt/camera/motion\",\"value\":\"OFF\",\"retain\":true}","v":1}
onvif2mqtt       | {"level":20,"time":1615834504488,"name":"MQTT","hostname":"192.168.31.100:1883","msg":"Publishing. {\"topic\":\"onvif2mqtt/camera/motion\",\"value\":\"OFF\",\"retain\":true}","v":1}
onvif2mqtt       | {"level":20,"time":1615834504489,"name":"MQTT","hostname":"192.168.31.100:1883","msg":"Publishing. {\"topic\":\"onvif2mqtt/camera/motion\",\"value\":\"OFF\",\"retain\":true}","v":1}
onvif2mqtt       | {"level":20,"time":1615834504490,"name":"MQTT","hostname":"192.168.31.100:1883","msg":"Publishing. {\"topic\":\"onvif2mqtt/camera/motion\",\"value\":\"OFF\",\"retain\":true}","v":1}

Duplication of events

Hi,
Wondering if it is a bug or I'm using the application incorrectly. With the next config from the doc:

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}" 
        }
# MQTT Broker configuration, 
# required due to nature of project.
mqtt:
  host: 192.168.X.X
  port: 1883
  username: aaa
  password: bbb
# All of your ONVIF devices
onvif:
  # Name for the device (used in MQTT topic)
  - name: frontcamera
    hostname: 192.168.X.Y
    port: 80
    username: ccc
    password: ddd
  - name: backcamera
    hostname: 192.168.X.Z
    port: 80
    username: eee
    password: fff

when one(!) camera triggers an event in the mqtt I receive this event for both(!) cameras (it sends two events with different cameras name).

Probably I can create a docker container for each camera but might be it is just a small change will fix this behaviour.

Thank you,
Dmitry

ProvisionISR

Hi, a bit off-topic...

I saw that you have tested successfully 2 cameras of ProvisionISR. Can you please share with me the connection string you have used?

I have the following models:
I3-390IP536
I3-390IPSVF
I3-340IP5SVF

I trieed with this string: rtsp://[user]:[pass]@[IP]:[port]/profile1 but none work for me on Shinobi (it also doesn't find them with the ONVIF search wizard).

They all do stream correctly with that string using VLC or HomeAssistant's ONVIF integration.

Any help will be very appreciated.

mqtts connection yaml parameters

Hi mate,
Is it possible to provide connection parameters for mqtts connection? Could not t it working with different option from MQTT.js doc.

Thank you,
Dmitry

Add Support For Helm

Generally, people like me use this fantastic code with Homebridge's Camera UI and mosquito mqtt.

The issue I am facing with this repo is that this docker image doesn't fit Kubernetes home lab architecture.

It would be nice to have the following features:

  • Current onvif camera conf is static, it would be easier if it can be set up through Env Variables.
  • Add Helm support to this tool.

Thanks,
Regards

Specify MQTT client ID

Would it be possible to specify and use the MQTT client id in config? By default this is s.th. like: "clientId: 'mqttjs_' + Math.random().toString(16).substr(2, 8)" and changes on every restart, which causes some MQTT bridges to create a new device on every restart .

Onvif2mqtt on RPi2 docker

Hello dmitrif,

Got it working fine on my Intel CPU based HA device. When I configure the plugin in Docker on a RPi getting an error relating to running the docker instance in Arm.

Do you have an RPi version of the plugin that I could try? Trying this remotely on a IPCam Talk forum users set up.

Pete

Dynamic loading of changes of config.yml

Hi!
Great job! This is what I was looking for a very long time.
Is it possible to add config.yml monitoring?
The task is to dynamically add/remove camera's subscriptions without restarting container
Thanks!

The requested image's platform (linux/amd64) does not match the detected host platform

Today tried to install the Docker. But did not succeed. Getting this error:
pi@raspberrypi4:/Onvif2Mqtt $ sudo docker run -v /Onvif2Mqtt/config dfarkov/onvif2mqtt
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm/v7) and no specific platform was requested
exec /usr/local/bin/docker-entrypoint.sh: exec format error

My machine is a Rpi4b with Linux raspberrypi4 5.15.32-v7l+

How can I get the right version for my Rpi?

bell button

Can you implement event for when the ring button is pressed?

Multiple camera issue seems to have returned

Most recent version:

Run with a single camera, no issues.

mqtt:
  host: 127.0.0.1
  port: 1883
onvif:
  - name: "Master Bathroom Door"
    hostname: reolink-master-bath.dante.local
    port: 8000
    username: user
    password: password
root@ha:/srv/onvif2mqtt# npm run dev

> [email protected] dev
> cross-env CONFIG_PATH=./config.dev.yml nodemon -e js,yml --exec babel-node src/index.js | pino-pretty

[nodemon] 2.0.2
[nodemon] to restart at any time, enter `rs`
[nodemon] watching dir(s): *.*
[nodemon] watching extensions: js,yml
[nodemon] starting `babel-node src/index.js`
[1644111564667] INFO : Loading configuration. {"configPath":"./config.dev.yml"}
[1644111564675] INFO : Validating configuration file.
[1644111564680] INFO  (Manager): Beginning initialization...
[1644111564681] INFO  (MQTT on 127.0.0.1:1883 ): Connecting.
[1644111564723] INFO  (MQTT on 127.0.0.1:1883 ): Successfully connected.
[1644111564725] INFO  (ONVIF/Master Bathroom Door on reolink-master-bath.dante.local): Attempting connection.
[1644111564984] INFO  (ONVIF/Master Bathroom Door on reolink-master-bath.dante.local): Successfully connected.
[1644111567388] INFO  (ONVIF/Master Bathroom Door on reolink-master-bath.dante.local): CreatePullPointSubscription Master Bathroom Door

Add a second camera:

mqtt:
  host: 127.0.0.1
  port: 1883
onvif:
  - name: "Master Bathroom Door"
    hostname: reolink-master-bath.dante.local
    port: 8000
    username: user
    password: password
  - name: "Back Yard"
    hostname: reolink-back-yard.dante.local
    port: 8000
    username: user
    password: password

Connects but can't successfully createa a PullPointSubscription

root@ha:/srv/onvif2mqtt# npm run dev

> [email protected] dev
> cross-env CONFIG_PATH=./config.dev.yml nodemon -e js,yml --exec babel-node src/index.js | pino-pretty

[nodemon] 2.0.2
[nodemon] to restart at any time, enter `rs`
[nodemon] watching dir(s): *.*
[nodemon] watching extensions: js,yml
[nodemon] starting `babel-node src/index.js`
[1644111833516] INFO : Loading configuration. {"configPath":"./config.dev.yml"}
[1644111833524] INFO : Validating configuration file.
[1644111833530] INFO  (Manager): Beginning initialization...
[1644111833530] INFO  (MQTT on 127.0.0.1:1883 ): Connecting.
[1644111833575] INFO  (MQTT on 127.0.0.1:1883 ): Successfully connected.
[1644111833578] INFO  (ONVIF/Master Bathroom Door on reolink-master-bath.dante.local): Attempting connection.
[1644111833578] INFO  (ONVIF/Back Yard on reolink-back-yard.dante.local): Attempting connection.
[1644111833810] INFO  (ONVIF/Master Bathroom Door on reolink-master-bath.dante.local): Successfully connected.
[1644111833812] INFO  (ONVIF/Back Yard on reolink-back-yard.dante.local): Successfully connected.
[1644111834416] ERROR (ONVIF/Back Yard on reolink-back-yard.dante.local): CreatePullPointSubscription Back Yard
[1644111836600] ERROR (ONVIF/Master Bathroom Door on reolink-master-bath.dante.local): CreatePullPointSubscription Master Bathroom Door
[1644111838402] ERROR (ONVIF/Back Yard on reolink-back-yard.dante.local): CreatePullPointSubscription Back Yard
[1644111838593] ERROR (ONVIF/Back Yard on reolink-back-yard.dante.local): CreatePullPointSubscription Back Yard
[1644111839101] ERROR (ONVIF/Master Bathroom Door on reolink-master-bath.dante.local): CreatePullPointSubscription Master Bathroom Door
[1644111839120] ERROR (ONVIF/Back Yard on reolink-back-yard.dante.local): CreatePullPointSubscription Back Yard
[1644111842275] ERROR (ONVIF/Master Bathroom Door on reolink-master-bath.dante.local): CreatePullPointSubscription Master Bathroom Door
[1644111843220] ERROR (ONVIF/Back Yard on reolink-back-yard.dante.local): CreatePullPointSubscription Back Yard
[1644111845202] ERROR (ONVIF/Back Yard on reolink-back-yard.dante.local): CreatePullPointSubscription Back Yard
[1644111845764] ERROR (ONVIF/Master Bathroom Door on reolink-master-bath.dante.local): CreatePullPointSubscription Master Bathroom Door
[1644111845917] ERROR (ONVIF/Master Bathroom Door on reolink-master-bath.dante.local): CreatePullPointSubscription Master Bathroom Door
[1644111846619] ERROR (ONVIF/Master Bathroom Door on reolink-master-bath.dante.local): CreatePullPointSubscription Master Bathroom Door
[1644111849547] ERROR (ONVIF/Master Bathroom Door on reolink-master-bath.dante.local): CreatePullPointSubscription Master Bathroom Door
[1644111849865] ERROR (ONVIF/Back Yard on reolink-back-yard.dante.local): CreatePullPointSubscription Back Yard
[1644111850653] ERROR (ONVIF/Master Bathroom Door on reolink-master-bath.dante.local): CreatePullPointSubscription Master Bathroom Door
^C
root@ha:/srv/onvif2mqtt#

What's interesting is that I have to reboot cameras or wait a long time (45 minutes) before a new subscription can be established. This only happens after adding a second camera.

Putting the config back the way it was (single camera) and running it again:

root@ha:/srv/onvif2mqtt# npm run dev

> [email protected] dev
> cross-env CONFIG_PATH=./config.dev.yml nodemon -e js,yml --exec babel-node src/index.js | pino-pretty

[nodemon] 2.0.2
[nodemon] to restart at any time, enter `rs`
[nodemon] watching dir(s): *.*
[nodemon] watching extensions: js,yml
[nodemon] starting `babel-node src/index.js`
[1644112141246] INFO : Loading configuration. {"configPath":"./config.dev.yml"}
[1644112141254] INFO : Validating configuration file.
[1644112141259] INFO  (Manager): Beginning initialization...
[1644112141260] INFO  (MQTT on 127.0.0.1:1883 ): Connecting.
[1644112141302] INFO  (MQTT on 127.0.0.1:1883 ): Successfully connected.
[1644112141304] INFO  (ONVIF/Master Bathroom Door on reolink-master-bath.dante.local): Attempting connection.
[1644112141548] INFO  (ONVIF/Master Bathroom Door on reolink-master-bath.dante.local): Successfully connected.
[1644112143993] ERROR (ONVIF/Master Bathroom Door on reolink-master-bath.dante.local): CreatePullPointSubscription Master Bathroom Door
[1644112147732] ERROR (ONVIF/Master Bathroom Door on reolink-master-bath.dante.local): CreatePullPointSubscription Master Bathroom Door
[1644112152234] ERROR (ONVIF/Master Bathroom Door on reolink-master-bath.dante.local): CreatePullPointSubscription Master Bathroom Door
[1644112153668] ERROR (ONVIF/Master Bathroom Door on reolink-master-bath.dante.local): CreatePullPointSubscription Master Bathroom Door
[1644112158024] ERROR (ONVIF/Master Bathroom Door on reolink-master-bath.dante.local): CreatePullPointSubscription Master Bathroom Door
^C
root@ha:/srv/onvif2mqtt#

Note, the above does not happen (I can restart onvif2mqtt all I want) if I never add a second camera.

I did do a tcpdump and captured the following response from the CreatePullPointSubscription request that keeps failing:

HTTP/1.1 400 Bad Request
Server: gSOAP/2.8
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 3079
Connection: close

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:ns1="http://www.onvif.org/ver10/actionengine/wsdl" xmlns:ns10="http://www.onvif.org/ver10/events/wsdl/PullPointBinding" xmlns:ns11="http://www.onvif.org/ver10/events/wsdl/CreatePullPointBinding" xmlns:ns12="http://www.onvif.org/ver10/events/wsdl/PausableSubscriptionManagerBinding" xmlns:ns13="http://www.onvif.org/ver10/network/wsdl/RemoteDiscoveryBinding" xmlns:ns14="http://www.onvif.org/ver10/network/wsdl/DiscoveryLookupBinding" xmlns:ns3="http://www.onvif.org/ver20/analytics/wsdl/RuleEngineBinding" xmlns:ns4="http://www.onvif.org/ver20/analytics/wsdl/AnalyticsEngineBinding" xmlns:ns5="http://www.onvif.org/ver10/events/wsdl/PullPointSubscriptionBinding" xmlns:ns6="http://www.onvif.org/ver10/events/wsdl/EventBinding" xmlns:ns7="http://www.onvif.org/ver10/events/wsdl/SubscriptionManagerBinding" xmlns:ns8="http://www.onvif.org/ver10/events/wsdl/NotificationProducerBinding" xmlns:ns9="http://www.onvif.org/ver10/events/wsdl/NotificationConsumerBinding" xmlns:tad="http://www.onvif.org/ver10/analyticsdevice/wsdl" xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl" xmlns:tdn="http://www.onvif.org/ver10/network/wsdl" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:ter="http://www.onvif.org/ver10/error" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xmlns:tls="http://www.onvif.org/ver10/display/wsdl" xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl" xmlns:tns1="http://www.onvif.org/ver10/topics" xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl" xmlns:trc="http://www.onvif.org/ver10/recording/wsdl" xmlns:trp="http://www.onvif.org/ver10/replay/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:trv="http://www.onvif.org/ver10/receiver/wsdl" xmlns:tse="http://www.onvif.org/ver10/search/wsdl" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsdd="http://schemas.xmlsoap.org/ws/2005/04/discovery" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsrfbf="http://docs.oasis-open.org/wsrf/bf-2" xmlns:wsrfr="http://docs.oasis-open.org/wsrf/r-2" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xmime="http://tempuri.org/xmime.xsd" xmlns:xmime5="http://www.w3.org/2005/05/xmlmime" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <SOAP-ENV:Header />
   <SOAP-ENV:Body>
      <SOAP-ENV:Fault>
         <SOAP-ENV:Code>
            <SOAP-ENV:Value>SOAP-ENV:Sender</SOAP-ENV:Value>
         </SOAP-ENV:Code>
         <SOAP-ENV:Reason>
            <SOAP-ENV:Text xml:lang="en" />
         </SOAP-ENV:Reason>
      </SOAP-ENV:Fault>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Debounce does not work

I noticed that there are too many of the same events posted

I checked this code and it always skips return.

if (currentMotionStates[onvifDeviceId] === motionState) {

I changed it a bit like

if (currentMotionStates[onvifDeviceId] !== undefined) { if (currentMotionStates[onvifDeviceId].IsMotion == motionState.IsMotion) { return; } }

and now an update is sent only when the state is changed.

Confirming new camera

Hi mate,

Confirming the next cameras work correctly with the docker:
Provision ISR: I3-340IP536+, I4-340IP5MVF

Thank you!

Support for custom events

Hello, I have a couple of ReoLink cameras & doorbell :-)

and they have a lot of custom events e.g.

  • RuleEngine/MyRuleDetector/Visitor doorbell
  • RuleEngine/MyRuleDetector/FaceDetect doorbell
  • RuleEngine/MyRuleDetector/PeopleDetect cam
  • RuleEngine/MyRuleDetector/VehicleDetect cam
  • RuleEngine/MyRuleDetector/DogCatDetect cam

I make it work locally (without config), I would like to create PR with config proposal with some mapping e.g.

// top level configuration
topics:
  <eventName>: <topicName>
// device level configuration
devices:
  - name: Doorbell
    topics:
      <eventName>: <topicName>

any comments before I will create PR? :)

New Installation

Great application.

Been using it since the beginning and it has worked well for me with the Hikvision DB2 doorbell camera / PIR

Last week moved the installation to another computer.

Installed the docker version and all appeared OK seeing it running in mqtt Explorer.

Only thing noticed is that the motion trigger never changed from off to on with motion.

So today installed baremetal ==>
1 - apt install npm
2 - npt install

restarted docker version and tested for motion looking at mqtt explorer.

This time it worked right out of the box.

Curious why I had to install NPM for docker version to work?

I've added another piece here installing paho mqtt on an openwrt router and using a script to trigger a relay on an ESP01 which is hardwired connected to alarm panel. Works well and just is another option for use.

Confirming working cameras.

Baremetal installation.
v1.0.4, OpenLumi build.

Honeywell HED1PR3, onvif port 80:
{"level":20,"time":1641413362710,"name":"MQTT","hostname":"127.0.0.1:1883","msg":"Publishing. {\"topic\":\"onvif2mqtt/HED1PR3/motion\",\"value\":\"ON\",\"retain\":true}","v":1} {"level":20,"time":1641413362714,"name":"MQTT","hostname":"127.0.0.1:1883","msg":"Publishing. {\"topic\":\"onvif2mqtt/HED1PR3/motion\",\"value\":\"ON\",\"retain\":true}","v":1} {"level":20,"time":1641413365809,"name":"MQTT","hostname":"127.0.0.1:1883","msg":"Publishing. {\"topic\":\"onvif2mqtt/HED1PR3/motion\",\"value\":\"OFF\",\"retain\":true}","v":1} {"level":20,"time":1641413366254,"name":"MQTT","hostname":"127.0.0.1:1883","msg":"Publishing. {\"topic\":\"onvif2mqtt/HED1PR3/motion\",\"value\":\"OFF\",\"retain\":true}","v":1}

Tapo c210, onvif port 2020:
{"level":20,"time":1641415654890,"name":"MQTT","hostname":"127.0.0.1:1883","msg":"Publishing. {\"topic\":\"onvif2mqtt/tapo/motion\",\"value\":\"ON\",\"retain\":true}","v":1} {"level":20,"time":1641415654956,"name":"MQTT","hostname":"127.0.0.1:1883","msg":"Publishing. {\"topic\":\"onvif2mqtt/tapo/motion\",\"value\":\"ON\",\"retain\":true}","v":1} {"level":20,"time":1641415655019,"name":"MQTT","hostname":"127.0.0.1:1883","msg":"Publishing. {\"topic\":\"onvif2mqtt/tapo/motion\",\"value\":\"OFF\",\"retain\":true}","v":1}

Thank you.

Error: You should create pull-point subscription first!

first, thank you for this component.
trying to use with DS-KB6003-WIP (https://www.hikvision.com/en/products/Video-Intercom-Products/Doorbells/Value-Series/DS-KB6003-WIP/)

its connecting to mqtt and seems to connect to the doorbell but then it exits with the above error. See below docker logs

{"level":30,"time":1593969526432,"msg":"Validating configuration file.","v":1}
{"level":30,"time":1593969526480,"name":"Manager","msg":"Beginning initialization...","v":1}
{"level":30,"time":1593969526480,"name":"MQTT","hostname":"192.168.1.100:1883","msg":"Connecting.","v":1}
{"level":30,"time":1593969526505,"name":"MQTT","hostname":"192.168.1.100:1883","msg":"Successfully connected.","v":1}
{"level":30,"time":1593969526505,"name":"ONVIF/frontdoor","hostname":"192.168.1.17","msg":"Attempting connection.","v":1}
{"level":20,"time":1593969526506,"name":"MQTT","hostname":"192.168.1.100:1883","msg":"Publishing. {\"topic\":\"onvif2mqtt/frontdoor/motion\",\"value\":\"OFF\",\"retain\":true}","v":1}
{"level":30,"time":1593969526694,"name":"ONVIF/frontdoor","hostname":"192.168.1.17","msg":"Successfully connected.","v":1}

/onvif2mqtt/node_modules/onvif/lib/events.js:139
			throw new Error('You should create pull-point subscription first!');
			^
Error: You should create pull-point subscription first!
    at Cam.pullMessages (/onvif2mqtt/node_modules/onvif/lib/events.js:139:10)
    at Cam._eventPull (/onvif2mqtt/node_modules/onvif/lib/events.js:262:9)
    at Cam.<anonymous> (/onvif2mqtt/node_modules/onvif/lib/events.js:100:13)
    at parseSOAPString (/onvif2mqtt/node_modules/onvif/lib/utils.js:98:3)
    at IncomingMessage.<anonymous> (/onvif2mqtt/node_modules/onvif/lib/cam.js:214:4)
    at IncomingMessage.emit (events.js:323:22)
    at endReadableNT (_stream_readable.js:1204:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node dist/index.js`
npm ERR! Exit status 1

npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-07-05T17_18_46_719Z-debug.log
> [email protected] start /onvif2mqtt
> node dist/index.js

Testing AVTech AVM2453

Hi! I have a couple of AVTech AVM2453 cameras with ONVIF support which don't show up on mqtt.

They do connect successfully:
{"level":30,"time":1607202992810,"name":"ONVIF/camera-driveway","hostname":"10.10.10.10","msg":"Successfully connected.","v":1}

But I think the ONVIF messages these cameras send are non-compliant. The camera's config page shows tnsav:MotionDetection as the topic for motion events, and this is configurable.

But when I check out the actual messages being sent, they're sending out tns1:VideoAnalytics/tnsav:MotionDetection as the topic.
Screen Shot 2020-12-05 at 22 31 49

I tried setting the topic to the more standard tns1:VideoSource/MotionAlarm but then the cameras send out tns1:VideoAnalytics/tns1:VideoSource/MotionAlarm, which isn't picked up by onvif2mqtt either.
Screen Shot 2020-12-05 at 22 31 03

The question here is: how can I edit onvif2mqtt to pick up the tns1:VideoAnalytics prefix?

config.yml location

Hi, I am getting below error, i cannot find out where to put this config.yml file. I have config.dev.yml and it is working. I am running baremetal on RPI3b.

npm run dev - works perfectly fine - getting motion on HomeKit all good

I think I have to run the below production one to be able to run this on startup, which i would appreciate if you can also tell me how to run this on each reboot automatically and without debug mode.

So the issue is like below:

npm run build - also compiles successfully but following below command returns following error
CONFIG_FILE=./config.dev.yml npm run start

[email protected] start
node dist/index.js

{"level":30,"time":1635326028505,"msg":"Loading configuration. {"configPath":"/config/config.yml"}","v":1}
node:internal/fs/utils:344
throw err;
^

Error: ENOENT: no such file or directory, open '/config/config.yml'
at Object.openSync (node:fs:585:3)
at Object.readFileSync (node:fs:453:35)
at Config._loadUserConfig (/home/pi/onvif2mqtt/dist/Config.js:63:40)
at Config._loadConfig (/home/pi/onvif2mqtt/dist/Config.js:106:28)
at new Config (/home/pi/onvif2mqtt/dist/Config.js:145:23)
at new Manager (/home/pi/onvif2mqtt/dist/Manager.js:207:17)
at Object. (/home/pi/onvif2mqtt/dist/index.js:7:1)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32) {
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: '/config/config.yml'
}

Config probelm

Hi, i can try To start onvif2mqtt but when i do the command:
CONFIG_PATH=/home/pi/onvif2mqtt/default-config.yml npm run start
I have this log:

[email protected] start
node dist/index.js

{"level":30,"time":1639595095591,"msg":"Loading configuration. {"configPath":"/home/pi/onvif2mqtt/default-config.yml"}","v":1}
{"level":30,"time":1639595095620,"msg":"Validating configuration file.","v":1}
{"level":50,"time":1639595095628,"msg":"Config validation failed...","v":1}
{"level":50,"time":1639595095629,"msg":"log must be one of [trace,debug,info,warn,error,fatal] {"path":"log"}","v":1}

my default-config.yml is this:

mqtt:
host: 127.0.0.1
port: 1883
onvif:

  • name: Videocamera
    ���hostname: 192.168.1.10
    ���port: 2020
    ���username: xxx
    ���password: xxx

how i can fix it?
I’m in raspberry..

ERROR for "CreatePullPointSubscription"

Hi, after I start the application, it connects to MQTT and my ONVIF camera device. But then it shows

[1641555221859] ERROR (ONVIF/ on xxx.xxx.xxx.xxx): CreatePullPointSubscription

How can I find out more on the root cause for that ERROR? Looks for me like it can't establish a "Subscription" to the Camera.
Any log, where I can find more information? Or a way, how I can enable more Debug infos?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.