From 1416aface12ed758c8ba6c69236be960602ea724 Mon Sep 17 00:00:00 2001 From: Max Winterstein Date: Thu, 31 Dec 2020 00:28:30 +0100 Subject: [PATCH] Add eufy-ha-mqtt-bridge --- README.md | 5 +++- eufy-ha-mqtt-bridge/CHANGELOG.md | 4 ++++ eufy-ha-mqtt-bridge/Dockerfile | 7 ++++++ eufy-ha-mqtt-bridge/README.md | 10 ++++++++ eufy-ha-mqtt-bridge/config.json | 30 ++++++++++++++++++++++++ eufy-ha-mqtt-bridge/docker-entrypoint.sh | 13 ++++++++++ 6 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 eufy-ha-mqtt-bridge/CHANGELOG.md create mode 100644 eufy-ha-mqtt-bridge/Dockerfile create mode 100644 eufy-ha-mqtt-bridge/README.md create mode 100644 eufy-ha-mqtt-bridge/config.json create mode 100644 eufy-ha-mqtt-bridge/docker-entrypoint.sh diff --git a/README.md b/README.md index 9829fa0..28e15e6 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ # homeassistant-addons -Home Assistant Addon repository -- currently only for my `ioBroker` playground. +Home Assistant Addon repository containing + +* ioBroker (iobroker.net) +* eufy-ha-mqtt-bridge (https://github.com/matijse/eufy-ha-mqtt-bridge) \ No newline at end of file diff --git a/eufy-ha-mqtt-bridge/CHANGELOG.md b/eufy-ha-mqtt-bridge/CHANGELOG.md new file mode 100644 index 0000000..9a77b7b --- /dev/null +++ b/eufy-ha-mqtt-bridge/CHANGELOG.md @@ -0,0 +1,4 @@ +# Changelog + +## [0.1.0] - 2020-12-31 +- Initial release \ No newline at end of file diff --git a/eufy-ha-mqtt-bridge/Dockerfile b/eufy-ha-mqtt-bridge/Dockerfile new file mode 100644 index 0000000..099eda1 --- /dev/null +++ b/eufy-ha-mqtt-bridge/Dockerfile @@ -0,0 +1,7 @@ +FROM matijse/eufy-ha-mqtt-bridge + +RUN apt-get update && apt-get install -y jq sqlite3 +RUN npm install json2yaml + +COPY docker-entrypoint.sh / +ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/eufy-ha-mqtt-bridge/README.md b/eufy-ha-mqtt-bridge/README.md new file mode 100644 index 0000000..86fcecc --- /dev/null +++ b/eufy-ha-mqtt-bridge/README.md @@ -0,0 +1,10 @@ +# Home Assistant Add-on: eufy-ha-mqtt-bridge + +--- +## 🚨 This is some experimental release! 🚨 +--- + +Quick wrapp around https://github.com/matijse/eufy-ha-mqtt-bridge. + +Application data will be written to `/share/eufy-ha-mqtt-bridge/` so log and other files can be accessed from other addons, e.g. the `Samba share` addon, or view it at the `Visual Studio Code` add-on. +🚨 This also contains some plaintext configuration file with login credentials, so take care who can access your files! 🚨 \ No newline at end of file diff --git a/eufy-ha-mqtt-bridge/config.json b/eufy-ha-mqtt-bridge/config.json new file mode 100644 index 0000000..e345578 --- /dev/null +++ b/eufy-ha-mqtt-bridge/config.json @@ -0,0 +1,30 @@ +{ + "name":"eufy-ha-mqtt-bridge", + "version":"0.1.0", + "slug":"eufy-ha-mqtt-bridge", + "description":"eufy-ha-mqtt-bridge", + "arch":[ + "armhf", + "armv7", + "aarch64", + "amd64", + "i386" + ], + "startup":"application", + "boot":"auto", + "options":{ + "eufy":{ + "username":"mail@example.org", + "password":"iliketurtles" + }, + "mqtt":{ + "url":"mqtt://192.168.x.x:1883", + "username":"homeassistant", + "password":"homeassistant" + } + }, + "schema":false, + "stage":"experimental", + "url":"https://github.com/matijse/eufy-ha-mqtt-bridge/", + "map": ["share:rw"] +} \ No newline at end of file diff --git a/eufy-ha-mqtt-bridge/docker-entrypoint.sh b/eufy-ha-mqtt-bridge/docker-entrypoint.sh new file mode 100644 index 0000000..97b6d6b --- /dev/null +++ b/eufy-ha-mqtt-bridge/docker-entrypoint.sh @@ -0,0 +1,13 @@ +#!/bin/sh +set -e + +echo "Symlinking data dir" +mkdir -p /share/eufy-ha-mqtt-bridge/data +rm -rfv /app/data +ln -s /share/eufy-ha-mqtt-bridge/data /app # symlink data mount from share + +echo "exporting environment vars form options file" +/app/node_modules/.bin/json2yml /data/options.json > /app/data/config.yml + +echo "starting original stuff..." +exec npm run start \ No newline at end of file