Skip to content

Commit 2883477

Browse files
committed
feat(mqtt): add charging_state discovery entity
1 parent a9974b3 commit 2883477

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

lib/teslamate/mqtt/pubsub/home_assistant.ex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ defmodule TeslaMate.Mqtt.PubSub.HomeAssistant do
131131
{"sensor", "display_name",
132132
%{state_topic_key: :display_name, name: "Display Name", icon: "mdi:car"}},
133133
{"sensor", "state", %{state_topic_key: :state, name: "State", icon: "mdi:car-connected"}},
134+
{"sensor", "charging_state",
135+
%{state_topic_key: :charging_state, name: "Charging State", icon: "mdi:ev-station"}},
134136
{"sensor", "since",
135137
%{
136138
state_topic_key: :since,

website/docs/integrations/home_assistant.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ On startup, discovery configs are also cleared for cars that are no longer
5555
tracked, e.g. because they were removed from the Tesla account or because
5656
logging was disabled, so their entities are removed from Home Assistant.
5757

58+
The discovered entities cover the same set of `teslamate/cars/<id>/...` topics
59+
as the manual `mqtt_sensors.yaml` below, plus `charging_state`, which has no
60+
manual equivalent. The list is easy to extend in the future, as configs are
61+
published per entity.
62+
5863
:::note
5964

6065
Configs are only cleared at startup. A car removed while TeslaMate is running
@@ -145,6 +150,14 @@ Don't forget to replace `<teslamate url>`, `<your tesla model>` and `<your tesla
145150
state_topic: "teslamate/cars/1/state"
146151
icon: mdi:car-connected
147152
153+
- sensor:
154+
name: Charging State
155+
default_entity_id: sensor.tesla_charging_state
156+
unique_id: teslamate_1_charging_state
157+
device: *teslamate_device_info
158+
state_topic: "teslamate/cars/1/charging_state"
159+
icon: mdi:ev-station
160+
148161
- sensor:
149162
name: Since
150163
default_entity_id: sensor.tesla_since

0 commit comments

Comments
 (0)