Skip to content

Add Bluetooth connection binary sensor for Teslemetry BLE vehicles - #989

Draft
Bre77 wants to merge 4 commits into
fm/ble-d9-6-funnelfrom
fm/ble-d9-7-connectivity
Draft

Add Bluetooth connection binary sensor for Teslemetry BLE vehicles#989
Bre77 wants to merge 4 commits into
fm/ble-d9-6-funnelfrom
fm/ble-d9-7-connectivity

Conversation

@Bre77

@Bre77 Bre77 commented Aug 23, 2026

Copy link
Copy Markdown
Owner

Breaking change

Proposed change

Add a per-vehicle Bluetooth connection binary sensor for BLE-paired Teslemetry
vehicles. It reports whether the vehicle is currently reachable over its local
Bluetooth link, reading TeslemetryBLEDataManager.connected and re-evaluating
on the manager's async_on_connection_change subscription. The device already
carries several connectivity sensors (cellular, Wi-Fi, GPS, and the awake state
mapped from VCSEC sleep), so the entity is named "Bluetooth connection" and
keyed bluetooth_connection to be unambiguous among them; it is diagnostic and
observe-only.

Unlike every other BLE-driven entity, this one deliberately does not go
unavailable when the link drops — a connectivity sensor that went unavailable on
disconnect could never report the one thing it exists to report. It stays
available and reads off, and is only absent when a vehicle is not BLE-paired at
all (no manager, so no entity). A regression test asserts exactly that: on
disconnect the sensor is available and off, not unavailable.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:
  • Link to developer documentation pull request:
  • Link to frontend pull request:

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

Bre77 added 4 commits August 23, 2026 11:58
Shared by teslemetry, tesla_fleet and tessie, so all three manifests move
together. 1.11.0 adds the ObservationFunnel the closure covers adopt in the
following commit.
Route the Bluetooth charge-port and front-trunk covers through a per-vehicle
tesla_fleet_api ObservationFunnel with BleBroadcastPublisher and
VehicleDataResultPublisher attached, so each renders a value from either the
BLE broadcast or vehicle_data and survives the loss of one source. Demand
signalling drives both sources: the BLE publisher subscribes only while a
field is listened to, and a demand observer gates the vehicle_data feed.

The lock and rear trunk stay on the existing single-source BLE path.
The funnel keeps its structure and BLE broadcast publisher, but the
VehicleDataResultPublisher and the coordinator-fed path that existed
only to feed it are removed: streaming signals, not vehicle_data, are
the intended second source and no stream publisher exists yet.

While the funnel is single-source BLE, the funnelled charge-port-door
and front-trunk entities re-impose the BLE connection-generation tie so
a dropped link clears the value, matching ble.py; this is removed once a
second source is attached.
@Bre77
Bre77 force-pushed the fm/ble-d9-6-funnel branch from 09b1cb6 to 8a87adb Compare August 28, 2026 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant