mirror of
https://github.com/lildude/ha-addon-teslamate.git
synced 2026-10-13 21:19:16 -04:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d97377bc0e | ||
|
|
0aca1dd417 | ||
|
|
556a2f23af | ||
|
|
a73430c34d | ||
|
|
2b40dd2668 | ||
|
|
1757ed78ff | ||
|
|
f48e92dc71 | ||
|
|
306653220b |
@@ -14,7 +14,7 @@
|
||||
"customType": "regex",
|
||||
"fileMatch": "^build.json$",
|
||||
"matchStrings": [
|
||||
"\"teslamate_version\": \"(?<currentValue>\\d+\\.\\d+\\.\\d+)\"",
|
||||
"\"teslamate_version\": \"(?<currentValue>\\d+\\.\\d+\\.\\d+)\""
|
||||
],
|
||||
"datasourceTemplate": "github-releases",
|
||||
"depNameTemplate": "teslamate-org/teslamate"
|
||||
|
||||
@@ -35,14 +35,14 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v3.2.0
|
||||
uses: docker/login-action@v3.3.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and publish
|
||||
uses: home-assistant/builder@master
|
||||
uses: home-assistant/builder@2024.08.2
|
||||
with:
|
||||
args: |
|
||||
--${{ matrix.arch }} \
|
||||
|
||||
@@ -51,7 +51,7 @@ jobs:
|
||||
git push --tags
|
||||
working-directory: ${{ github.workspace }}/teslamate
|
||||
- name: Create release
|
||||
uses: softprops/action-gh-release@v2.0.7
|
||||
uses: softprops/action-gh-release@v2.0.8
|
||||
with:
|
||||
tag_name: v${{ steps.semver.outputs.semver }}
|
||||
body_path: CHANGELOG.txt
|
||||
|
||||
@@ -35,7 +35,7 @@ jobs:
|
||||
uses: actions/checkout@v4.1.7
|
||||
|
||||
- name: Build add-on
|
||||
uses: home-assistant/builder@master
|
||||
uses: home-assistant/builder@2024.08.2
|
||||
with:
|
||||
args: |
|
||||
--test \
|
||||
|
||||
@@ -29,7 +29,7 @@ Remember to restart the add-on when the configuration is changed.
|
||||
|
||||
- `database_port`: The port your PostgreSQL server is listening on. Default: `5432`.
|
||||
|
||||
- `database_host`: The hostname of your PostgreSQL server. Default: `29b65938-postgres` for the [PostgreSQL add-on][postgres].
|
||||
- `database_host`: The hostname of your PostgreSQL server.
|
||||
|
||||
- `database_name`: The name of the PostgreSQL database. Default: `teslamate`.
|
||||
|
||||
@@ -115,6 +115,15 @@ Once you have Grafana up and running, you'll need to configure a data source to
|
||||
|
||||
- `import_dir`: (Optional) The path to the directory where TeslaMate should look for the TeslaMate export CSV file. Default: `/share/teslamate`.
|
||||
|
||||
- `env_vars`: (Optional) Set additional environment variables for TeslaMate which aren't currently exposed by the configuration options in this add-on.
|
||||
|
||||
Each entry is made up of a name and value:
|
||||
|
||||
- `name`: The case-sensitive environment variable name.
|
||||
- `value`: The value to be set in the environment variable.
|
||||
|
||||
Note: These will also overwrite any environment variable set using the configuration options above.
|
||||
|
||||
## Data Import from TeslaFi
|
||||
|
||||
It is now possible to import CSV data from TeslaFi, refer to the [official docs][teslafi-import].
|
||||
@@ -135,9 +144,8 @@ Follow this process:
|
||||
[docker]: https://hub.docker.com/r/teslamate/teslamate
|
||||
[elixir]: https://elixir-lang.org/
|
||||
[grafana-addon]: https://github.com/hassio-addons/addon-grafana
|
||||
[grafana-datasource]: https://raw.githubusercontent.com/lildude/hassio-addon-teslamate/main/imgs/grafana-postgres.png
|
||||
[grafana-datasource]: https://raw.githubusercontent.com/lildude/ha-addon-teslamate/main/imgs/grafana-postgres.png
|
||||
[mosquitto-docs]: https://github.com/home-assistant/addons/blob/master/mosquitto/DOCS.md
|
||||
[postgres]: https://github.com/matt-FFFFFF/hassio-addon-postgres
|
||||
[samba-addon]: https://github.com/home-assistant/addons/blob/master/samba/DOCS.md
|
||||
[ssh-addon]: https://github.com/home-assistant/addons/blob/master/ssh/DOCS.md
|
||||
[teslafi-import]: https://docs.teslamate.org/docs/import/teslafi
|
||||
|
||||
@@ -25,9 +25,7 @@ Thanks to @matt-FFFFFF for maintaining this add-on in the past.
|
||||
## Requirements
|
||||
|
||||
TeslaMate needs a PostgreSQL database.
|
||||
All development and testing has been done using [PostgreSQL add-on][postgres] for convenience but you're welcome to use your own.
|
||||
|
||||
For convenience, my [add-ons repository][addons-repo] includes configuration that points to the [PostgreSQL add-on][postgres] so you can install everything from one repo.
|
||||
I recommend using the [PostgreSQL add-on][alexbelgium-postgres] from @alexbelgium's repository if you aren't already using Postgres.
|
||||
|
||||
To get the full experience, it is recommended that you also install the community [Grafana add-on][grafana-addon] and [MQTT integration][mqtt].
|
||||
|
||||
@@ -69,13 +67,13 @@ Everything should pick up where it was before.
|
||||
|
||||
[addon]: https://my.home-assistant.io/redirect/supervisor_add_addon_repository/?repository_url=https%3A%2F%2Fgithub.com%2Flildude%2Fha-addons
|
||||
[addons-repo]: https://github.com/lildude/ha-addons
|
||||
[alexbelgium-postgres]: https://github.com/alexbelgium/hassio-addons/tree/master/postgres
|
||||
[archs]: https://img.shields.io/badge/dynamic/json?color=green&label=Arch&query=%24.arch&url=https%3A%2F%2Fraw.githubusercontent.com%2Flildude%2Fha-addon-teslamate%2Fmain%2Fconfig.json
|
||||
[docker]: https://hub.docker.com/r/teslamate/teslamate
|
||||
[elixir]: https://elixir-lang.org/
|
||||
[grafana-addon]: https://github.com/hassio-addons/addon-grafana
|
||||
[ingres-badge]: https://img.shields.io/badge/dynamic/json?label=Ingress&query=%24.ingress&url=https%3A%2F%2Fraw.githubusercontent.com%2Flildude%2Fha-addon-teslamate%2Fmain%2Fconfig.json
|
||||
[mqtt]: https://www.home-assistant.io/integrations/mqtt
|
||||
[postgres]: https://github.com/matt-FFFFFF/hassio-addon-postgres
|
||||
[repo-btn]: https://my.home-assistant.io/badges/supervisor_add_addon_repository.svg
|
||||
[sponsor-badge]: https://img.shields.io/badge/Sponsor_Me-%E2%9D%A4-ec6cb9?logo=GitHub
|
||||
[teslamate-backup]: https://docs.teslamate.org/docs/maintenance/backup_restore
|
||||
|
||||
+8
-3
@@ -17,7 +17,7 @@
|
||||
"database_user": null,
|
||||
"database_pass": null,
|
||||
"database_name": "teslamate",
|
||||
"database_host": "29b65938-postgres",
|
||||
"database_host": null,
|
||||
"database_port": 5432,
|
||||
"database_ssl": false,
|
||||
"grafana_import_dashboards": true,
|
||||
@@ -36,7 +36,8 @@
|
||||
"timezone": "Europe/London",
|
||||
"import_dir": "/share/teslamate",
|
||||
"default_geofence": "",
|
||||
"encryption_key": ""
|
||||
"encryption_key": "",
|
||||
"env_vars": []
|
||||
},
|
||||
"schema": {
|
||||
"database_user": "str",
|
||||
@@ -61,7 +62,11 @@
|
||||
"timezone": "str",
|
||||
"import_dir": "str",
|
||||
"default_geofence": "str?",
|
||||
"encryption_key": "password?"
|
||||
"encryption_key": "password?",
|
||||
"env_vars": [{
|
||||
"name": "str?",
|
||||
"value": "str?"
|
||||
}]
|
||||
},
|
||||
"map": [
|
||||
"share:rw"
|
||||
|
||||
@@ -44,6 +44,14 @@ export DATABASE_HOST DATABASE_NAME DATABASE_PASS DATABASE_PORT DATABASE_USER \
|
||||
DISABLE_MQTT MQTT_HOST MQTT_NAMESPACE MQTT_PASSWORD MQTT_TLS_ACCEPT_INVALID_CERTS \
|
||||
MQTT_TLS MQTT_USERNAME IMPORT_DIR PORT TZ DEFAULT_GEOFENCE ENCRYPTION_KEY URL_PATH
|
||||
|
||||
# These are optional and applied last so we can override those set above if needed.
|
||||
for env_var in $(bashio::config 'env_vars|keys'); do
|
||||
name=$(bashio::config "env_vars[${env_var}].name")
|
||||
value=$(bashio::config "env_vars[${env_var}].value")
|
||||
bashio::log.debug "Setting Env Variable ${name} to ${value}"
|
||||
export "${name}=${value}"
|
||||
done
|
||||
|
||||
# Import dashboards
|
||||
if bashio::config.true 'grafana_import_dashboards'; then
|
||||
/dashboards.sh restore
|
||||
|
||||
@@ -67,3 +67,6 @@ configuration:
|
||||
import_dir:
|
||||
name: TeslaFi Import Directory
|
||||
description: The directory which holds the TeslaFi export you would like to import into TeslaMate.
|
||||
env_vars:
|
||||
name: Environment Variables
|
||||
description: Set additional environment variables for TeslaMate which aren't currently exposed by the configuration options in this add-on.
|
||||
|
||||
Reference in New Issue
Block a user