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

Add Tesla Fleet grid status #126438

Draft
wants to merge 15 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions homeassistant/components/tesla_fleet/icons.json
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,19 @@
},
"wall_connector_state": {
"default": "mdi:ev-station"
},
"storm_mode_active": {
"default": "mdi:weather-lightning"
},
"island_status": {
"default": "mdi:help-circle",
"state": {
"on_grid": "mdi:transmission-tower",
"off_grid": "mdi:transmission-tower-off",
"off_grid_unintentional": "mdi:transmission-tower-off",
"island_status_unknown": "mdi:help-circle",
"off_grid_intentional": "mdi:account-cancel"
JEMcats marked this conversation as resolved.
Show resolved Hide resolved
}
}
},
"switch": {
Expand Down
11 changes: 11 additions & 0 deletions homeassistant/components/tesla_fleet/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,17 @@ class TeslaFleetTimeEntityDescription(SensorEntityDescription):
device_class=SensorDeviceClass.POWER,
entity_registry_enabled_default=False,
),
SensorEntityDescription(
key="island_status",
options=[
"island_status_unknown",
"on_grid",
"off_grid",
"off_grid_unintentional",
"off_grid_intentional",
],
device_class=SensorDeviceClass.ENUM,
),
)

WALL_CONNECTOR_DESCRIPTIONS: tuple[SensorEntityDescription, ...] = (
Expand Down
13 changes: 13 additions & 0 deletions homeassistant/components/tesla_fleet/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,19 @@
"vehicle_state_odometer": {
"name": "Odometer"
},
"island_status": {
"name": "Grid Status",
"state": {
"island_status_unknown": "Unknown",
"on_grid": "Connected",
"off_grid": "Disconnected",
"off_grid_unintentional": "Disconnected",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this really be translated same as the one above?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it should be, I'd suggest adding the intentional / unintentional aspect to the translation.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you talking about off_grid and off_grid_unintentional?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the key name contains unintentional I guess it would be logic to add that as a word to the translation.

"off_grid_intentional": "Disconnected intentionally"
}
},
"storm_mode_active": {
"name": "Storm Watch active"
},
"vehicle_state_tpms_pressure_fl": {
"name": "Tire pressure front left"
},
Expand Down