commit dc15c91206030fa2afbf600c0818dc27813ede2a Author: Moritz Werner Date: Tue Jul 21 00:26:37 2020 +0200 add ebusd diff --git a/ebusd/Dockerfile b/ebusd/Dockerfile new file mode 100644 index 0000000..584685b --- /dev/null +++ b/ebusd/Dockerfile @@ -0,0 +1,23 @@ +ARG BUILD_FROM + +FROM john30/ebusd + +ENV LANG C.UTF-8 + +ARG BASHIO_VERSION=0.9.0 + +# For parse options +RUN apt-get update && apt-get install -y jq \ + && mkdir -p /tmp/bashio \ + && curl -L -s https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz | tar -xzf - --strip 1 -C /tmp/bashio \ + && mv /tmp/bashio/lib /usr/lib/bashio \ + && ln -s /usr/lib/bashio/bashio /usr/bin/bashio \ + && rm -rf /tmp/bashio + +WORKDIR /data + +# Copy data for add-on +COPY run.sh / +RUN chmod a+x /run.sh + +CMD [ "/run.sh" ] diff --git a/ebusd/config.json b/ebusd/config.json new file mode 100644 index 0000000..84e5ad9 --- /dev/null +++ b/ebusd/config.json @@ -0,0 +1,20 @@ +{ + "name": "ebusd", + "version": "1.0", + "slug": "ebusd", + "description": "ebusd", + "arch": ["armhf", "armv7", "aarch64", "amd64", "i386"], + "startup": "services", + "boot": "auto", + "options": { + "cmd": "--scanconfig --enablehex --enabledefine" + }, + "services": ["mqtt:need"], + "schema": { + "cmd": "str" + }, + "ports": { + "8888/tcp": 8888 + }, + "devices": ["/dev/ttyUSB1:/dev/ttyUSB0:rwm"] +} diff --git a/ebusd/run.sh b/ebusd/run.sh new file mode 100644 index 0000000..3f9a847 --- /dev/null +++ b/ebusd/run.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bashio + +CONFIG_PATH=/data/options.json + +MQTT_HOST=$(bashio::services mqtt "host") +MQTT_USER=$(bashio::services mqtt "username") +MQTT_PASSWORD=$(bashio::services mqtt "password") + +CMD="$(jq --raw-output '.cmd' $CONFIG_PATH)" + +ebusd $CMD --mqtthost=$MQTT_HOST --mqttlog --mqttuser=$MQTT_USER --mqttpass=$MQTT_PASSWORD --mqttport=1883 --foreground