Skip to content

Commit

Permalink
Initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
230delphi committed Sep 26, 2021
1 parent dc0a75a commit 4b74d8a
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/tmp/
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# docker build --build-arg BUILD_FROM="homeassistant/amd64-base:latest"
ARG BUILD_FROM
FROM $BUILD_FROM

ENV LANG C.UTF-8
LABEL maintainer="[email protected]"


#ENV SQUID_VERSION=5.0 \
# SQUID_CACHE_DIR=/var/spool/squid \
# SQUID_LOG_DIR=/var/log/squid \
# SQUID_USER=proxy

RUN apk add --no-cache golang


#COPY entrypoint.sh /sbin/entrypoint.sh
#RUN chmod 755 /sbin/entrypoint.sh

#EXPOSE 3128/tcp
#ENTRYPOINT ["/sbin/entrypoint.sh"]

# Copy data for add-on
COPY run.sh /
RUN chmod a+x /run.sh
CMD [ "/run.sh" ]
33 changes: 33 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "AlphaESS Proxy",
"version": "1",
"slug": "hello_world",
"description": "AlphaESS Proxy Data collector",
"arch": [
"armhf",
"armv7",
"aarch64",
"amd64",
"i386"
],
"startup": "application",
"boot": "auto",
"options": {
"MQTTAddress": "tcp://127.0.0.1:1883",
"MQTTUser": "myuser",
"MQTTPassword": "mypass",
"AlphaESSID": "alphaess1",
"MQTTTopicBase": "homeassistant/sensor/",
"TZLocation": "Europe/Dublin",
"ProxyIPPort": "0.0.0.0:17777"
},
"schema": {
"MQTTAddress": "str",
"MQTTUser": "str",
"MQTTPassword": "str",
"AlphaESSID": "str",
"MQTTTopicBase": "str",
"TZLocation": "str",
"ProxyIPPort": "str"
}
}
20 changes: 20 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/with-contenv bashio
git clone https://github.com/230delphi/alphaess-to-mqtt/
cd alphaess-to-mqtt
go build *.go
CONFIG="alphaESS-proxy.conf"

{
echo "l=${ProxyIPPort}";
echo "MQTTAddress=${MQTTAddress}";
echo "MQTTUser=${MQTTUser}";
echo "MQTTPassword=${MQTTPassword}";
echo "MQTTTopicBase=${MQTTTopicBase}";
echo "AlphaESSID=${AlphaESSID}";
echo "TZLocation=${TZLocation}";
echo "proxyConnection=MQTTReadProxyConnection";
} > "${CONFIG}"

# Start Proxy server
bashio::log.info "Starting Proxy server..."
alphaESS-proxy -config ${CONFIG} < /dev/null

0 comments on commit 4b74d8a

Please sign in to comment.