An open API service indexing awesome lists of open source software.

https://github.com/will-white/dahua-companion

Small, simple, and fast event driven Dahua (Amcrest) doorbell processor for home automation integration
https://github.com/will-white/dahua-companion

containerization event-driven golang mqtt pubsub stream-processing

Last synced: about 1 month ago
JSON representation

Small, simple, and fast event driven Dahua (Amcrest) doorbell processor for home automation integration

Awesome Lists containing this project

README

          

# Dahua Companion

The Dahua Companion allows you to integrate your [Dahua](https://www.dahuasecurity.com/) and [Amcrest](https://amcrest.com/wifi-video-doorbell-cameras.html) doorbell's button/ring/buzzer with any home automation that can listen to queue / events.

The Dahua Companion will listen for the button/ring/buzzer and then send a message/event/topic via MQTT e.g. `doorbell/pressed` with no payload.

## How it works

Dahua cameras report events via a long polling HTTP connection. And what you subscribe to effects what events the camera reports back with.

Dahua's API is included in the documentation folder.

For this project we're only concerned with the `AlarmLocal` event (This is the buzzer/ringer/button pressed event). And more specifically we publish only the `AlarmLocal` started events since we don't care when Dahua decides an alarm is "over".

After we receive an event we publish a `doorbell/pressed` to the MQTT broker.

This project also has wrappers around the HTTP subscription and MQTT broker to always make sure it's connected. The only thing we don't have is an internal queue to monitor in between MQTT outages. Since it doesn't make sense to send events that no longer matter.

## Home Assistant Example

```
alias: Doorbell buzzer
triggers:
- trigger: mqtt
topic: doorbell/pressed
actions:
- action: notify.echos
metadata: {}
data:
message: Someone is at the front door
data:
type: tts
mode: single
```