Browse Source

add ebusd

master
Moritz Werner 3 years ago
commit
dc15c91206
3 changed files with 54 additions and 0 deletions
  1. +23
    -0
      ebusd/Dockerfile
  2. +20
    -0
      ebusd/config.json
  3. +11
    -0
      ebusd/run.sh

+ 23
- 0
ebusd/Dockerfile View File

@@ -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" ]

+ 20
- 0
ebusd/config.json View File

@@ -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"]
}

+ 11
- 0
ebusd/run.sh View File

@@ -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

Loading…
Cancel
Save