amcrest2mqtt

amcrest2mqtt

Docker app from digiblur's Repository

Overview

Expose all events from an Amcrest device to an MQTT broker. Supports autodiscovery via Home Assistant. Multiple docker containers will need to be installed to support more than one Amcrest device. No WebUI is necessary.

amcrest2mqtt

A simple app to expose all events generated by an Amcrest device to MQTT using the python-amcrest library.

It supports the following environment variables:

  • AMCREST_HOST (required)
  • AMCREST_PORT (optional, default = 80)
  • AMCREST_USERNAME (optional, default = admin)
  • AMCREST_PASSWORD (required)
  • MQTT_USERNAME (required)
  • MQTT_PASSWORD (optional, default = empty password)
  • MQTT_HOST (optional, default = 'localhost')
  • MQTT_QOS (optional, default = 0)
  • MQTT_PORT (optional, default = 1883)
  • MQTT_TLS_ENABLED (required if using TLS) - set to true to enable
  • MQTT_TLS_CA_CERT (required if using TLS) - path to the ca certs
  • MQTT_TLS_CERT (required if using TLS) - path to the private cert
  • MQTT_TLS_KEY (required if using TLS) - path to the private key
  • HOME_ASSISTANT (optional, default = false)
  • HOME_ASSISTANT_PREFIX (optional, default = 'homeassistant')
  • STORAGE_POLL_INTERVAL (optional, default = 3600) - how often to fetch storage data (in seconds) (set to 0 to disable functionality)
  • DEVICE_NAME (optional) - override the default device name used in the Amcrest app

It exposes events to the following topics:

  • amcrest2mqtt/[SERIAL_NUMBER]/event - all events
  • amcrest2mqtt/[SERIAL_NUMBER]/doorbell - doorbell status (if AD110 or AD410)
  • amcrest2mqtt/[SERIAL_NUMBER]/human - human detection (if AD410)
  • amcrest2mqtt/[SERIAL_NUMBER]/motion - motion events (if supported)
  • amcrest2mqtt/[SERIAL_NUMBER]/config - device configuration information

Device Support

The app supports events for any Amcrest device supported by python-amcrest.

Home Assistant

The app has built-in support for Home Assistant discovery. Set the HOME_ASSISTANT environment variable to true to enable support. If you are using a different MQTT prefix to the default, you will need to set the HOME_ASSISTANT_PREFIX environment variable.

Running the app

The easiest way to run the app is via Docker Compose, e.g.

version: "3"
services:
    amcrest2mqtt:
        container_name: amcrest2mqtt
        image: dchesterton/amcrest2mqtt:latest
        restart: unless-stopped
        environment:
            AMCREST_HOST: 192.168.0.1
            AMCREST_PASSWORD: password
            MQTT_HOST: 192.168.0.2
            MQTT_USERNAME: admin
            MQTT_PASSWORD: password
            HOME_ASSISTANT: "true"

Out of Scope

Multiple Devices

The app will not support multiple devices. You can run multiple instances of the app if you need to expose events for multiple devices.

Non-Docker Environments

Docker is the only supported way of deploying the application. The app should run directly via Python but this is not supported.

Home Assistant Addons

There are a couple of Home Assistant Addons that use my code to be able to port this software into Supervised versions of Home Assistant. I do not specifically support the add-ons themselves, only the base software in the original docker format. Please contact the authors of those add-ons for support if using that method.

https://github.com/ikifar2012/amcrest2mqtt-addon/blob/master/README.md Open your Home Assistant instance and show the add add-on repository dialog with a specific repository URL pre-filled.

https://github.com/robsonke/hassio-addons/blob/master/amcrest2mqtt/README.md Open your Home Assistant instance and show the add add-on repository dialog with a specific repository URL pre-filled.

Buy Me A Coffee Beer 🍻

A few people have kindly requested a way to donate a small amount of money. If you feel so inclined I've set up a "Buy Me A Coffee" page where you can donate a small sum. Please do not feel obligated to donate in any way - I work on the app because it's useful to myself and others, not for any financial gain - but any token of appreciation is much appreciated 🙂

Install Amcrest2mqtt on Unraid in a few clicks.

Find Amcrest2mqtt in Community Apps on your Unraid server, review the template, and click Install. Unraid handles the Docker app or plugin setup from the published template.

Open the Apps tab on your Unraid server Search Community Apps for Amcrest2mqtt Review the template variables and paths Click Install

Download Statistics

666,817
Total Downloads
2,027
This Month
1,891
Avg / Month

Total Downloads Over Time

Loading chart...

Related apps

Details

Repository
dchesterton/amcrest2mqtt
Last Updated2022-03-23
First Seen2021-05-23

Runtime arguments

Network
bridge
Privileged
false
Extra Params
--restart unless-stopped

Template configuration

Amcrest Device IPVariable

IP or DNS of Amcrest Device

Target
AMCREST_HOST
Amcrest Device PasswordVariable

Amcrest Device Local Password

Target
AMCREST_PASSWORD
MQTT Broker IPVariable

MQTT Broker IP or DNS Name

Target
MQTT_HOST
MQTT UsernameVariable

MQTT Username

Target
MQTT_USERNAME
MQTT PasswordVariable

MQTT Password

Target
MQTT_PASSWORD
Home Assistant AutodiscoveryVariable

Enabled HA Autodiscovery: true or false

Target
HOME_ASSISTANT
Default
true
Value
true