diff --git a/README.md b/README.md index e612ddd..f0b10f4 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,19 @@ $ go install github.com/brandon1024/OpenEVT/cmd/openevt@latest $ openevt --addr 192.168.2.54:14889 --serial-number 31583078 ``` +### Home Assistant App +First add the Home assistant App repository: + +[![Add this repo to Home Assistant](https://my.home-assistant.io/badges/supervisor_add_addon_repository.svg)](https://my.home-assistant.io/redirect/supervisor_add_addon_repository/?repository_url=https%3A%2F%2Fgithub.com%2Fbrandon1024%2Fopenevt) + +Then go to the apps page and install it: + +[![Go to app installation page](https://my.home-assistant.io/badges/supervisor_addon.svg)](https://my.home-assistant.io/redirect/supervisor_addon/?addon=fe3706e6_openevt&repository_url=https%3A%2F%2Fgithub.com%2Fbrandon1024%2Fopenevt) + +After installing it, go to the configuration tab and set the inverters address and serial number. + +Finally hit start and consider letting it start up on boot and enable watchdag to have it restart if there are any issues. + ### Docker ```shell diff --git a/openevt/Dockerfile b/openevt/Dockerfile new file mode 100644 index 0000000..6e8b2ca --- /dev/null +++ b/openevt/Dockerfile @@ -0,0 +1,12 @@ +ARG BUILD_FROM=ghcr.io/home-assistant/base:latest +ARG BUILD_VERSION +FROM brandon1024/openevt:$BUILD_VERSION AS builder + +FROM $BUILD_FROM + +COPY --from=builder /usr/bin/openevt /usr/bin/openevt + +COPY run.sh / +RUN chmod a+x /run.sh + +CMD [ "/run.sh" ] diff --git a/openevt/README.md b/openevt/README.md new file mode 100644 index 0000000..b7dd05e --- /dev/null +++ b/openevt/README.md @@ -0,0 +1,12 @@ +# OpenEVT + +This app scrapes data from compatible Envertech inverters and provides the data for home assistant users (and as prometheus metrics as well). + +Users have to set up home assistants configuration with a rest scraping config as per [documentation](https://github.com/brandon1024/OpenEVT?tab=readme-ov-file#prometheus--home-assistant-integrations) + +## Configuration + +Set the following options in the UI when installing the app: + +- address: Address including port for the Envertech inverter +- serial number: Serial number for the Envertech inverter diff --git a/openevt/config.yaml b/openevt/config.yaml new file mode 100644 index 0000000..07e95da --- /dev/null +++ b/openevt/config.yaml @@ -0,0 +1,20 @@ +name: OpenEVT +version: "1.0.0" +slug: openevt +description: >- + OpenEVT app. Connects to a compatible Envertech inverter and exposes + its data to Home Assistant. + See https://github.com/brandon1024/OpenEVT?tab=readme-ov-file#prometheus--home-assistant-integrations + for how to integrate it (requires configuration.yaml adjustments). +arch: + - amd64 + - aarch64 +ports: + 9090/tcp: 9090 +options: + address: "" + serial_number: "" +schema: + address: str + serial_number: str +init: false diff --git a/openevt/run.sh b/openevt/run.sh new file mode 100755 index 0000000..6a7cf40 --- /dev/null +++ b/openevt/run.sh @@ -0,0 +1,9 @@ +#!/usr/bin/with-contenv bashio + +# Export configured environment variables for the container +export OPENEVT_ADDR="$(bashio::config 'address')" +export OPENEVT_SERIALNUMBER="$(bashio::config 'serial_number')" + +echo "Starting OpenEVT with address: $OPENEVT_ADDR serial: $OPENEVT_SERIALNUMBER" + +exec /usr/bin/openevt diff --git a/openevt/translations/en.yaml b/openevt/translations/en.yaml new file mode 100644 index 0000000..f57f32b --- /dev/null +++ b/openevt/translations/en.yaml @@ -0,0 +1,7 @@ +configuration: + address: + name: Inverter address + description: Address + port of the microinverter (e.g. 192.168.1.99:14889). + serial_number: + name: Inverter serial number + description: Serial number of the microinverter (e.g. 31583078). diff --git a/repository.yaml b/repository.yaml new file mode 100644 index 0000000..cc53c58 --- /dev/null +++ b/repository.yaml @@ -0,0 +1,3 @@ +name: OpenEVT +url: https://github.com/brandon1024/openevt +maintainer: Brandon