-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
62 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
FROM php:7.2.2-apache | ||
ARG BUILD_FROM | ||
FROM $BUILD_FROM | ||
|
||
MAINTAINER Elad Bar <[email protected]> | ||
|
||
WORKDIR /app | ||
|
@@ -14,4 +16,5 @@ ENV MQTT_BROKER_PORT=1883 | |
ENV MQTT_BROKER_USERNAME=Username | ||
ENV MQTT_BROKER_PASSWORD=Password | ||
|
||
CMD php -f /app/DahuaVTO.php | ||
COPY data/run.sh . | ||
CMD ./run.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"name": "DahuaVTO2MQTT", | ||
"version": "1.0.1", | ||
"slug": "dahua_mqtt", | ||
"description": "Listens to events from Dahua VTO unit and publishes them via MQTT Message", | ||
"arch": [ | ||
"armhf", | ||
"armv7", | ||
"aarch64", | ||
"amd64", | ||
"i386" | ||
], | ||
"startup": "services", | ||
"boot": "auto", | ||
"options": { | ||
"intercom": { | ||
"host": "192.168.1.110", | ||
"username": "admin", | ||
"password": "admin" | ||
}, | ||
"mqtt": { | ||
"host": "core-mosquitto", | ||
"port": "1883", | ||
"username": "homeassistant", | ||
"password": "homeassistant" | ||
} | ||
}, | ||
"schema": { | ||
"intercom": { | ||
"host": "str?", | ||
"username": "str?", | ||
"password": "str?" | ||
}, | ||
"mqtt": { | ||
"host": "str?", | ||
"port": "int?", | ||
"username": "str?", | ||
"password": "str?" | ||
} | ||
}, | ||
"image": "eladbar/{arch}-addon-dahuavto2mqtt" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bashio | ||
|
||
export DAHUA_VTO_HOST=$(bashio::config 'intercom.host') | ||
export DAHUA_VTO_USERNAME=$(bashio::config 'intercom.username') | ||
export DAHUA_VTO_PASSWORD=$(bashio::config 'intercom.password') | ||
export MQTT_BROKER_HOST=$(bashio::config 'mqtt.host') | ||
export MQTT_BROKER_PORT=$(bashio::config 'mqtt.port') | ||
export MQTT_BROKER_USERNAME=$(bashio::config 'mqtt.username') | ||
export MQTT_BROKER_PASSWORD=$(bashio::config 'mqtt.password') | ||
|
||
bashio::log.info "Staring Dahua to MQTT" | ||
bashio::log.debug "Connecting to Intercom ${DAHUA_VTO_HOST} with username ${DAHUA_VTO_USERNAME}" | ||
bashio::log.debug "Connecting to Broker ${MQTT_BROKER_HOST} with username ${MQTT_BROKER_USERNAME}" | ||
php -f ./DahuaVTO.php | ||
bashio::log.info "Finished Dahua to MQTT" |