Skip to content

Improve vehicle status, controls, and refresh behavior - #191

Open
orienw wants to merge 14 commits into
widewing:masterfrom
orienw:feat/capability-aware-vehicles
Open

Improve vehicle status, controls, and refresh behavior#191
orienw wants to merge 14 commits into
widewing:masterfrom
orienw:feat/capability-aware-vehicles

Conversation

@orienw

@orienw orienw commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR makes Toyota and Lexus vehicle handling generation- and capability-aware, adds 24MM AppSync status and remote-command support, and exposes supported remote actions as native Home Assistant controls. It also makes status updates resilient to partial or out-of-order Toyota responses and makes automatic vehicle wakes configurable.

Vehicle data and API routing

  • Preserve each vehicle's generation, region, brand, backdoor type, subscription state, and reported capabilities.
  • Preserve Lexus branding in Home Assistant while using Toyota's required API transport identity for both brands.
  • Route 24MM status and remote commands through AppSync while retaining the established transports for 17CY, 17CYPLUS, and 21MM vehicles.
  • Merge REST, telemetry, and AppSync state by observation time so older responses cannot replace newer door, window, fuel, odometer, or location values.
  • Preserve last-known values when Toyota returns a partial response, and leave unknown door and lock values unknown.
  • Restore Last Parked Location from telemetry, including for accounts without a remote subscription.
  • Apply AppSync vehicle-status updates to Home Assistant as they arrive.
  • Use generation- and region-correct diagnostics endpoints and redact the Toyota device ID.
  • Discover newly available entities without reloading the integration (fixes New and updated sensors aren't available if made available after the initial setup. #115).
  • Remove obsolete trunk entities from vehicles identified as tailgates.
  • Use Home Assistant native entity naming, including the vehicle device name for the primary lock (fixes Entity names do not follow home assistant naming convention #174).

Controls and vehicle wakes

  • Add button entities for Remote Start, Remote Stop, Flash Hazards, Find Vehicle, and Refresh Status.
  • Create and enable controls only when Toyota reports the required capability.
  • Add configurable automatic wake intervals and track scheduled wakes independently for each VIN.
  • Allow Cloud updates only mode to disable automatic wakes while retaining passive cloud polling, manual refreshes, and remote commands.
  • Schedule a delayed coordinator poll after successful commands and automatic wakes, and clear transitional state when Toyota rejects a command.

Compatibility and known limitations

Requires Home Assistant 2022.11 or newer.

Existing entity unique IDs and device identifiers are preserved.

Vehicle handling in this PR covers 17CY, 17CYPLUS, 21MM, and 24MM. GR86 and PRE17CY vehicles remain unsupported because no verified transport is available.

Newly reported capabilities can add entities without a reload. If Toyota later stops reporting a capability, its existing entity remains registered but becomes unavailable.

When telemetry is the only available location source, Current Location and Last Parked Location report the same coordinates.

Validation

  • python -m unittest discover -s tests -v - 59 tests passed
  • python -m compileall -q custom_components tests
  • Live-tested successfully in Home Assistant with a 2024 Lexus LC 500 using the 21MM US path

Broader physical testing is still needed for 24MM vehicles, Canada, EV/PHEV vehicles, 17CY, and 17CYPLUS.

A prerelease containing the current code is available as v2.8.0b4. It can be installed by adding the fork as a custom HACS repository.

Related PRs

PR Overlap and how this PR handles it Scope not included in this PR
#180 Both prevent stale telemetry window values from replacing newer REST status. #180 adds a response-level freshness check for windows; this PR instead tracks timestamps per feature across REST, telemetry, and AppSync, extends that ordering to doors, numeric values, and locations, and applies it to 17CY as well as newer generations. No additional user-facing behavior. #180 is a narrower alternative implementation of one part of this PR's state merge.
#182 Both add 24MM AppSync status queries and remote commands, current capability detection, EV/charging parsing, and tire-pressure parsing. This PR integrates that work into a generation-aware vehicle model, applies pushed status immediately, and adds cross-source timestamp ordering and partial-state preservation. #182 additionally adds stateful switch and cover entities for climate/start, hazards, power windows, and charging, plus horn and buzzer buttons. Those controls are not included here.
#184 Both address entity names, Last Parked telemetry, opening-state parsing, diagnostics routing, capability gating, button entities, and tailgate cleanup. This PR retains applicable contributions from @thatcoleyouknow, completes native entity naming with has_entity_name, and replaces parse-order precedence with per-feature timestamp merging. #184 additionally implements shared-VIN claiming, account assignment, Repair notices, and device pruning. This PR does not include that shared-account lifecycle.

@orienw
orienw marked this pull request as draft August 15, 2026 00:12
@orienw
orienw marked this pull request as ready for review August 15, 2026 01:03
@Savedyou

Copy link
Copy Markdown

Tried this commit with my 2026 RAV4 GR Sport and I finally have all my sensors with no issues.
Untitled

@orienw

orienw commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

@Savedyou nice! great to hear. let me know if you run into any issues later on.

@Savedyou

Copy link
Copy Markdown

Can confirm that remote commands work with no errors. Tested with turning on hazard lights from home assistant.

@pragyandeb

Copy link
Copy Markdown

Many thanks. Works perfectly for 2026 RAV4 PHEV SE. The main one needs to me fixed with this update.

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.

Entity names do not follow home assistant naming convention New and updated sensors aren't available if made available after the initial setup.

3 participants