-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from tesla-local-control/iain-dev
iain-dev->main
- Loading branch information
Showing
10 changed files
with
429 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,12 +37,13 @@ jobs: | |
- name: Build and push | ||
uses: docker/[email protected] | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
push: true | ||
build-args: | | ||
BUILDKIT_CONTEXT_KEEP_GIT_DIR=true | ||
tags: | | ||
ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:latest | ||
ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:${{ github.sha }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,12 +37,13 @@ jobs: | |
- name: Build and push | ||
uses: docker/[email protected] | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
platforms: linux/amd64 | ||
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
push: true | ||
build-args: | | ||
BUILDKIT_CONTEXT_KEEP_GIT_DIR=true | ||
tags: | | ||
ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:latest | ||
ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:${{ github.sha }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
## 0.1.0 | ||
|
||
### Changed | ||
|
||
<p>${\textsf{\color{red}WARNING WARNING WARNING}}$<br> | ||
DO NOT UPGRADE PRIOR TO READ THE BELOW UPGRADE INSTRUCTIONS, SEE AFTER LIST OF CHANGES | ||
<br>${\textsf{\color{red}WARNING WARNING WARNING}}$</p> | ||
|
||
- NEW Feature: Support for unlimited cars (VINs + MAC Addrs) | ||
- NEW Feature: Added a TTL for car presence, when gone the sensor in HA stays ON until the TTL expires | ||
- NEW Feature: Added "debug" entity which sends only one charge amps command: Issue [#19](https://github.com/tesla-local-control/tesla_ble_mqtt_core/issues/19) | ||
- NEW Setting: BLE Proximity Detection TTL (Detection is on by default; set to 0 to disable) | ||
- NEW Setting: Presence Detection Loop Delay (how often to check the presence of your car(s)) | ||
- NEW Setting: Toggle to enable/disable Home Assistant Features (Standalone version only) | ||
- CHG: Improved presence detection reliability (using car's MAC addr and BLE Local Name) | ||
- CHG: Support bashio::log w/ timestamp (HA add-on) | ||
- CHG: Reduce logging; Improved colors consistency; More to be removed once code is considered stable | ||
- CHG: Add bluez-deprecated pkg (ciptool hciattach hciconfig hcidump hcitool meshctl rfcomm sdptool) | ||
- CHG: Rename entities for consistency & better wording (see table below) | ||
- WARNING: [BLE device possible overheating](https://github.com/tesla-local-control/tesla-local-control-addon/issues/27) causing performance issues | ||
|
||
#### Upgrade Instructions & ${\textsf{\color{red}BREAKING CHANGES}}$ | ||
- **Before update** save your configuration values (VIN, MAC address and MQTT values) | ||
- You will need to adjust your configuration | ||
- Now supports **list** of VINS and MAC addresses. | ||
- Paste your current vin to vin_list, if you own more than 1 Tesla add them all! | ||
- Paste your current mac_addr to mac_addr_list (optional for presence detection) | ||
- Paste your MQTT values | ||
- Existing **entities** from v0.0.10f will not be affected with a few exceptions*** | ||
|
||
#### Entities renamed | ||
|
||
<p>For consistency, moving foward entity name uses only alphadigits and as a seperator - (no more _).<br> | ||
/!\ It will affect your current Home Assistant MQTT entities (if you use them)></p> | ||
|
||
| Old Entity Name | New Entity Name | | ||
|:------------------|:-------------------------| | ||
| auto_seat-climate | auto-seat-and-climate | | ||
| flash_lights | flash-lights | | ||
| heated_seat_left | heater-seat-front-left* | | ||
| heated_seat_right | heater-seat-front-right* | | ||
| sw_heater | steering-wheel-heater | | ||
* in preparation "someday" for rear seats | ||
|
||
## 0.0.10 | ||
|
||
### Changed | ||
|
||
- Toggle to enable/disable car presence detection | ||
- Added multi-level & multi-color logs | ||
- Initial core component release (git submodule) | ||
|
||
### Changed | ||
|
||
## 0.0.9 | ||
|
||
### Changed | ||
|
||
- Fixed useless tesla-control retries | ||
|
||
## 0.0.8b | ||
|
||
### Changed | ||
|
||
- The project has moved to an open source organisation "tesla-local-control". Please update the repo in HA to: https://github.com/tesla-local-control/tesla-local-control-addon | ||
|
||
## 0.0.8a | ||
|
||
### Changed | ||
|
||
- Updated doc for MAC addresses config | ||
|
||
## 0.0.8 | ||
|
||
### Changed | ||
|
||
- [Standalone] Fix broken deployment introduced in 0.0.7 | ||
- [Standalone] Add colored logging based on log level | ||
|
||
## 0.0.7a | ||
|
||
### Changed | ||
|
||
WARNING: broken for standalone deployment, stay on 0.0.6 | ||
OK for HA Addon | ||
|
||
- logging msg adjustments & fix logic for log.debug | ||
- logging add logic for log.debug to properly work | ||
|
||
## 0.0.7 | ||
|
||
### Changed | ||
|
||
WARNING: broken for standalone deployment, stay on 0.0.6 | ||
OK for HA Addon | ||
|
||
- Bump to latest updates from tesla_ble_mqtt_docker | ||
- Improve HA logging and error management | ||
- Add FR translation | ||
- Fix auto climate command | ||
|
||
## 0.0.6 | ||
|
||
### Changed | ||
|
||
- Fix typo | ||
- Harmonize docs | ||
|
||
## 0.0.5 | ||
|
||
### Changed | ||
|
||
- Fix extension stopping at first MQTT listening | ||
- Update logging and documentation | ||
- Improve pairing procedure doc and logging | ||
- Improve HA entities classification | ||
- Cleanup | ||
|
||
## 0.0.4 | ||
|
||
### Changed | ||
|
||
- Fix periodicity of BLE discovery (to cope with HA limits) | ||
- Fix set-amps for current above 5A | ||
|
||
## 0.0.3 | ||
|
||
### Changed | ||
|
||
- Bump sh content to match iainbullock's developments in separate github: https://github.com/iainbullock/tesla_ble_mqtt_docker | ||
- Enable presence discovery in home-assistant directly | ||
|
||
## 0.0.2 | ||
|
||
### Changed | ||
|
||
- Bump sh content to v1.0.14 https://github.com/iainbullock/tesla_ble_mqtt_docker | ||
|
||
|
||
## 0.0.1 | ||
|
||
### Changed | ||
|
||
- Initial dev version based on https://github.com/iainbullock/tesla_ble_mqtt_docker | ||
- WARN: standalone not tested |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
# Deploy using Dockerfile # | ||
## Deploy using Dockerfile via Command Line ## | ||
This is for those who can't (or don't want to) use the pre-built images from Dockerhub. For example you may have an architecture for which there is no image on Dockerhub | ||
i. Build the image from the command line `docker build -t tesla_ble_mqtt:latest https://github.com/tesla-local-control/tesla_ble_mqtt_docker.git`. Note this can take some time on slower machines, e.g. 65mins+ on a RPi1b. The output will look something like this: | ||
``` | ||
[+] Building 3977.9s (18/18) FINISHED docker:default | ||
=> CACHED [internal] load git source https://github.com/tesla-local-control/tesla_ble_mqtt_docker.git 3.5s | ||
=> [internal] load metadata for docker.io/library/alpine:3.20.0 1.7s | ||
=> [internal] load metadata for docker.io/library/golang:1.22.4-alpine3.20 1.8s | ||
=> [build 1/8] FROM docker.io/library/golang:1.22.4-alpine3.20@sha256:ace6cc3fe58d0c7b12303c57afe6d6724851152df55e08057b43990b927ad5e8 660.7s | ||
=> => resolve docker.io/library/golang:1.22.4-alpine3.20@sha256:ace6cc3fe58d0c7b12303c57afe6d6724851152df55e08057b43990b927ad5e8 0.6s | ||
=> => sha256:ace6cc3fe58d0c7b12303c57afe6d6724851152df55e08057b43990b927ad5e8 10.29kB / 10.29kB 0.0s | ||
=> => sha256:dcc11b8cc70ef07dac6273dc695fcb3ab6e46da300ab939708f5ad1be4bd53d5 1.92kB / 1.92kB 0.0s | ||
=> => sha256:ae51de63cd1eed172ccfbf3b0617e64e41ac77842f79618b49518c0442c96685 2.09kB / 2.09kB 0.0s | ||
=> => sha256:3d2af5f613c84e549fb09710d45b152d3cdf48eb7a37dc3e9c01e2b3975f4f76 3.37MB / 3.37MB 20.5s | ||
=> => sha256:fb26f139748033dd9f410aaee2fa9f225bf8b64a17b5e3f1adf1ef26427ce27e 293.61kB / 293.61kB 10.9s | ||
=> => sha256:743e448a2b4bba38b1783fb849b3f5093e7931cf69d898520c4f1462ad93a836 67.71MB / 67.71MB 235.0s | ||
=> => extracting sha256:3d2af5f613c84e549fb09710d45b152d3cdf48eb7a37dc3e9c01e2b3975f4f76 19.2s | ||
=> => sha256:e17aa4a6c18860c6004fb2b335568db1f1bcfcd78962c48ca4fe9172dda6d304 127B / 127B 30.4s | ||
=> => sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1 32B / 32B 31.0s | ||
=> => extracting sha256:fb26f139748033dd9f410aaee2fa9f225bf8b64a17b5e3f1adf1ef26427ce27e 9.1s | ||
=> => extracting sha256:743e448a2b4bba38b1783fb849b3f5093e7931cf69d898520c4f1462ad93a836 387.1s | ||
=> => extracting sha256:e17aa4a6c18860c6004fb2b335568db1f1bcfcd78962c48ca4fe9172dda6d304 0.1s | ||
=> => extracting sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1 0.0s | ||
=> [stage-1 1/5] FROM docker.io/library/alpine:3.20.0@sha256:77726ef6b57ddf65bb551896826ec38bc3e53f75cdde31354fbffb4f25238ebd 73.3s | ||
=> => resolve docker.io/library/alpine:3.20.0@sha256:77726ef6b57ddf65bb551896826ec38bc3e53f75cdde31354fbffb4f25238ebd 0.6s | ||
=> => sha256:4a6ffef76277d8c1d912ad489e0c09ddc09fdf7aefae51750a33dc47478c0cc0 528B / 528B 0.0s | ||
=> => sha256:31d13e3b0449067f05eecde6a52c560b2edc027e8943f40968f3dcd1861e4614 1.49kB / 1.49kB 0.0s | ||
=> => sha256:77726ef6b57ddf65bb551896826ec38bc3e53f75cdde31354fbffb4f25238ebd 1.85kB / 1.85kB 0.0s | ||
=> => sha256:b0da55d51ed2f4a2e9c4e3ca1e420bac26a1a37098e2f1437841049c51df7320 3.37MB / 3.37MB 29.4s | ||
=> => extracting sha256:b0da55d51ed2f4a2e9c4e3ca1e420bac26a1a37098e2f1437841049c51df7320 35.3s | ||
=> [build 4/8] ADD https://github.com/teslamotors/vehicle-command/archive/refs/heads/main.zip /tmp 19.7s | ||
=> [stage-1 2/5] RUN apk add --no-cache bluez bluez-deprecated mosquitto-clients openssl 105.7s | ||
=> [stage-1 3/5] RUN mkdir /data 28.2s | ||
=> [stage-1 4/5] COPY app liblog.sh libproduct.sh /app/ 14.4s | ||
=> [build 2/8] RUN apk add --no-cache unzip 28.2s | ||
=> [build 3/8] RUN mkdir -p /app/bin 10.4s | ||
=> [build 4/8] ADD https://github.com/teslamotors/vehicle-command/archive/refs/heads/main.zip /tmp 4.0s | ||
=> [build 5/8] RUN unzip /tmp/main.zip -d /app 15.5s | ||
=> [build 6/8] WORKDIR /app/vehicle-command-main 2.5s | ||
=> [build 7/8] RUN go get ./... 174.8s | ||
=> [build 8/8] RUN go build -o /app/bin ./... 3035.4s | ||
=> [stage-1 5/5] COPY --from=build /app/bin/tesla-control /usr/bin/ 6.0s | ||
=> exporting to image 19.5s | ||
=> => exporting layers 19.2s | ||
=> => writing image sha256:87b1c8676fba83a9903257dbc41e5a6bbd95339ca29eebe4da4aa4bf0aceb908 0.0s | ||
=> => naming to docker.io/library/tesla_ble_mqtt:latest | ||
``` | ||
ii. When completed, check it's there by issuing `docker images`. You will see somthing like this: | ||
``` | ||
REPOSITORY TAG IMAGE ID CREATED SIZE | ||
tesla_ble_mqtt latest 8032d3fc0fb8 14 minutes ago 35.4MB | ||
hello-world latest f0c407f2ecb9 4 months ago 8.95kB | ||
``` | ||
iii. Create a tesla_ble_mqtt_docker folder in your user directory and change directory into it: | ||
```shell | ||
cd ~ | ||
mkdir tesla_ble_mqtt_docker | ||
cd tesla_ble_mqtt_docker | ||
``` | ||
iv. Download docker-compose.yml and stack.env from the github repository: | ||
```shell | ||
curl -O https://raw.githubusercontent.com/tesla-local-control/tesla_ble_mqtt_docker/main/docker-compose.yml | ||
curl -O https://raw.githubusercontent.com/tesla-local-control/tesla_ble_mqtt_docker/main/stack.env | ||
``` | ||
v. You will need to edit docker-compose.yml. Change the line `image: "iainbullock/tesla_ble_mqtt:latest"` to `image: "tesla_ble_mqtt:latest"` | ||
vi. Update the environment variables in stack.env according to your needs. As a minimum enter the VIN of your car, and the connection details for your MQTT server. If you want BLE detection enter the BLE MAC address of the car (see below for instructions on how to find this TODO): | ||
```shell | ||
# Mandatory; if multiple VINs separate with , or white space | ||
# | ||
VIN_LIST= | ||
# Mandatory; Hostname or IP address | ||
# | ||
MQTT_SERVER= | ||
# Service port # or name | ||
# | ||
MQTT_PORT=1883 | ||
# If no username provided, anonymous mode. | ||
# | ||
MQTT_USERNAME= | ||
# If you have special characters, wrap with ' at both ends; escape ' if needed | ||
# | ||
MQTT_PASSWORD= | ||
# Optional for car presence detection; If multiple cars, separate with , or white space | ||
# | ||
BLE_MAC_LIST= | ||
# Default 5 (seconds) | ||
# | ||
BLE_CMD_RETRY_DELAY= | ||
# Default 120 (seconds) | ||
# | ||
PRESENCE_DETECTION_LOOP_DELAY= | ||
# Default 240 (seconds) | ||
# | ||
PRESENCE_DETECTION_TTL= | ||
# Your timezone | ||
# Ref: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones | ||
# | ||
TZ='Europe/London' | ||
### Default false | ||
# | ||
DEBUG= | ||
# | ||
# WARNING; If you run Home Assistant, keep this true unless you know what you're doing | ||
# | ||
ENABLE_HA_FEATURES=true | ||
``` | ||
vii. Create the Docker volume: `docker volume create tesla_ble_mqtt` | ||
viii. Create a symbolic link to the environment file: `ln -s stack.env env` | ||
ix. Start the container: `docker compose up -d` | ||
x. Check the logs `docker logs -t tesla_ble_mqtt`. Typical logs after start up look like this (when DEBUG=false): | ||
``` | ||
Configuration Options are: | ||
BLE_CMD_RETRY_DELAY=5 | ||
BLE_MAC_LIST=40:XX:XX:XX:XX:F9 | ||
DEBUG=false | ||
MQTT_SERVER=192.168.1.5 | ||
MQTT_PORT=1883 | ||
MQTT_PASSWORD=Not Shown | ||
MQTT_USERNAME=XXXXXX | ||
PRESENCE_DETECTION_LOOP_DELAY=120 | ||
PRESENCE_DETECTION_TTL=240 | ||
VIN_LIST=LRWXXXXXXXXXXX403 | ||
ENABLE_HA_FEATURES=true | ||
Setting up MQTT clients with authentication | ||
Presence detection is enable with a TTL of 240 seconds | ||
Setting up HA auto discovery for vin LRWXXXXXXXXXXX403 | ||
Discarding any unread MQTT messages for LRWXXXXXXXXXXX403 | ||
Listening for Home Assistant Start (in background) | ||
Entering main loop... | ||
Lauching background listen_to_mqtt_loop... | ||
Entering Listen to MQTT loop... | ||
Launch BLE scanning for car presence every 120 seconds | ||
Launching listen_to_mqtt | ||
``` | ||
|
||
## Deploy using Dockerfile via Portainer ## | ||
Again this is for those who can't (or don't want to) use the pre-built images from Dockerhub | ||
TODO |
Oops, something went wrong.