Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update Home Assistant integration documentation with configuration URL and model name hints #4359

Merged
merged 6 commits into from
Nov 6, 2024
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- build(deps): bump cachix/install-nix-action from 27 to 30 (#4342)
- build(deps): bump tesla from 1.12.1 to 1.13.0 (#4335)
- build(deps): bump floki from 0.36.2 to 0.36.3 (#4336)
- feat: add CONTRIBUTING file to exclusion lists for treefmt (#4359 - @JakobLichterfeld)

#### Dashboards

Expand All @@ -30,6 +31,7 @@
#### Documentation

docs: add contributing guidelines link for GitHub (#4345 - @JakobLichterfeld)
docs: update Home Assistant integration documentation with configuration URL and model name hints (#4359 - @JakobLichterfeld)

## [1.31.1] - 2024-10-29

Expand Down
1 change: 1 addition & 0 deletions nix/flake-modules/formatter.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"*.dockerignore"
".envrc"
"*.node-version"
"CONTRIBUTING"
"Dockerfile"
"grafana/Dockerfile"
"Makefile"
Expand Down
1 change: 1 addition & 0 deletions treefmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ excludes = [
"*.dockerignore",
".envrc",
"*.node-version",
"CONTRIBUTING",
"Dockerfile",
"grafana/Dockerfile",
"Makefile",
Expand Down
25 changes: 15 additions & 10 deletions website/docs/integrations/home_assistant.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
---
title: HomeAssistant Integration
sidebar_label: HomeAssistant
title: Home Assistant Integration
sidebar_label: Home Assistant
---

Whilst HomeAssistant provides an official component for Tesla vehicles, the component has not been updated recently, and does not have the sophistication of TeslaMate's polling mechanism, resulting in the component's default values keeping the vehicle awake and draining the battery.
## Introduction

Whilst Home Assistant provides an official component for Tesla vehicles, the component has not been updated recently, and does not have the sophistication of TeslaMate's polling mechanism, resulting in the component's default values keeping the vehicle awake and draining the battery.

The ultimate goal of this guide is to consume as much of the TeslaMate polling data as possible to replace the majority of the official Tesla component's polling functionality.

If your intention is to only use read-only sensor values, those provided by TeslaMate via MQTT are sufficient, and you do not need to utilise the official Tesla component. If however you would like to be able to write values to the Tesla API (Lock/Unlock Doors or automate Climate), there is a solution which involves configuring an extremely high polling interval for the Tesla component and using automation to populate the values from the TeslaMate MQTT parameters.

**Screenshots**
### Screenshots

import useBaseUrl from '@docusaurus/useBaseUrl';

<img alt="HASS Screenshot" src={useBaseUrl('img/hass-dashboard.png')} />

**Current Status**
### Current Status

- Sensors: All sensors exposed by the Tesla component are available
- Locks: Not implemented
- Climate: Not implemented

## Configuration

The following configurations assume a car ID of 1 (`teslamate/cars/1`). It usually starts at 1, but it can be different if you have multiple cars in TeslaMate for example.

### configuration.yaml

Proximity sensors allow us to calculate the proximity of the Tesla `device_tracker` to defined zones. This can be useful for:
Expand Down Expand Up @@ -53,7 +57,7 @@ binary_sensor: !include binary_sensor.yaml

### mqtt_sensors.yaml (mqtt: section of configuration.yaml)

Don't forget to replace `<teslamate url>` and `<your tesla model>` with correct corresponding values.
Don't forget to replace `<teslamate url>`, `<your tesla model>` and `<your tesla name>` with correct corresponding values.

```yml title="mqtt_sensors.yaml"
- sensor:
Expand All @@ -66,10 +70,10 @@ Don't forget to replace `<teslamate url>` and `<your tesla model>` with correct
payload_not_available: "false"
device: &teslamate_device_info
identifiers: [teslamate_car_1]
configuration_url: https://teslamate.zxxz.io/
configuration_url: <teslamate url> # update this with your teslamate URL, e.g. https://teslamate.example.com/
manufacturer: Tesla
model: Model 3
name: Tesla Model 3
model: <your tesla model> # update this with your car model, e.g. Model 3
name: <your tesla name> # update this with your car name, e.g. Tesla Model 3
state_topic: "teslamate/cars/1/display_name"
icon: mdi:car

Expand Down Expand Up @@ -1045,7 +1049,8 @@ The following set of automations and scripts will detect when a Tesla door, frun

By default, the script will repeatedly notify every 5 minutes. Remove the recursive `script.turn_on` sequence in the `notify_tesla_open` script if you'd only like to be informed once.

We add the random 30 second interval after each notification to avoid clobbering the notification script when we have multiple things open at once. For example, opening the door will open the door and the window. If we don't delay the calls, we will only get a message about the window (as it is the last call to the script) and if we then close the window, we won't get notifications about other things left open. This results in more notifications but less chance on missing out on knowing something was left open.
We add the random 30 second interval after each notification to avoid clobbering the notification script when we have multiple things open at once.
For example, opening the door will open the door and the window. If we don't delay the calls, we will only get a message about the window (as it is the last call to the script) and if we then close the window, we won't get notifications about other things left open. This results in more notifications but less chance on missing out on knowing something was left open.

#### automation.yaml

Expand Down
Loading