elad-bar / DahuaVTO2MQTT

Listens to events from Dahua VTO unit and publishes them via MQTT Message
103 stars 39 forks source link

Integrating Dahua IP cameras #39

Closed avico78 closed 3 years ago

avico78 commented 3 years ago

It would be really awesome if an integration with dahaua cameras will be added,

there is other dahua2mqtt project which provide solution for dahua cameraa: https://github.com/algirdasc/appdaemon-apps/blob/master/dahua_mqtt.py

which working with apdaemon and it covers most of Dahua ivs functionalities ,maybe some can take a look and see if it be reuse to this project,a single running docker which give full cover for Dahua cameras and vto would be awesome :)

elad-bar commented 3 years ago

great idea, will check it in the upcoming weeks (overloaded at work :))

thanks!

avico78 commented 3 years ago

great idea, will check it in the upcoming weeks (overloaded at work :))

thanks!

happy u see interest it , a stand alone docker which handle both cameras and VTO in one places is a serious enhancement than for solution exists for Dahua, actually for the cameras (the link i mention in top message) is actually best exists as it intrergearted with Home assistant ,support IVS events , the annoying side of it - u need Appdemon running for it.

elad-bar commented 3 years ago

ok... that was easy, it's already supported, use the DAHUA_VTO_* parameters of docker for the camera details, Per camera that you are connecting, i suggest to use different MQTT topic prefix (MQTT_BROKER_TOPIC_PREFIX) and it should work, below events sent by MQTT for the camera:

{
    "Action": "Start",
    "Code": "RtspSessionDisconnect",
    "Data": {
        "Device": "::ffff:x.x.x.x",
        "StreamType": "Main",
        "UTC": 1619275203.0,
        "UserAgent": " Lavf57.83.100"
    },
    "Index": 0,
    "Param": null,
    "deviceType": "IPC-HDBW4431R-ZS",
    "serialNumber": "xxxxxxx"
}
{
    "Action": "State",
    "Code": "VideoMotionInfo",
    "Data": [
        {
            "Id": 0,
            "Region": [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
            ],
            "RegionName": "Region1",
            "State": "Inactive",
            "Threshold": 0
        }
    ],
    "Index": 0,
    "deviceType": "IPC-HDBW4431R-ZS",
    "serialNumber": "xxxxxxx"
}
{
    "Action": "Stop",
    "Code": "VideoMotion",
    "Data": {
        "MachineName": "xxxxxx",
        "Name": "xxxxx",
        "RegionName": [
            "Region1"
        ],
        "UTC": 1619275453.0
    },
    "Index": 0,
    "deviceType": "IPC-HDBW4431R-ZS",
    "serialNumber": "xxxxxx"
}
HappySl0th commented 3 years ago

Will this work with the Hassio-addons branch you have?

elad-bar commented 3 years ago

yes, it's just a wrapper