Skip to content
Merged
Changes from all 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
17 changes: 8 additions & 9 deletions src/teslemetryenergy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,9 @@ function settleWithin<T>(step: () => Promise<T>, ms: number, signal?: AbortSigna
* With a signing key (see `EnergySpecific`), every device command except the
* four pre-pairing reads is signed with that key and sent through Teslemetry's
* `device_command` route. Without a key, a command uses its Teslemetry route.
* The `set_island_mode`, `backup_events` and `config` routes sign with
* Teslemetry's own key, which must be verified on the gateway, or the route
* answers 409 `energy_site_not_paired` and sends nothing. As of 2026-10-29 the
* `dispatch_battery_power`, `resume_battery_operation` and backup-event
* schedule and cancel routes still send unsigned, so Tesla answers HTTP 400:
* keyless dispatch does not work until Teslemetry signs those routes.
* Apart from the pre-pairing reads and the authorized-client routes, that route
* signs with Teslemetry's own key, which must be verified on the gateway, or it
* answers 409 `energy_site_not_paired` and sends nothing.
*/
export class TeslemetryEnergySite extends EnergySpecific {
/** Send a signed `RoutableMessage` through Teslemetry's route, which takes the flat body and adds Tesla's `data` wrapper itself. */
Expand Down Expand Up @@ -280,8 +277,9 @@ export class TeslemetryEnergySite extends EnergySpecific {

/**
* Request a timed battery power setpoint on the energy gateway. Without a
* signing key the Teslemetry route still sends unsigned and gets Tesla's HTTP
* 400 (2026-10-29). See `EnergySpecific.dispatch_battery_power`.
* signing key the Teslemetry route signs it, and answers 409
* `energy_site_not_paired` until Teslemetry's key is verified on the gateway.
* See `EnergySpecific.dispatch_battery_power`.
* @param power_watts Battery power in watts: positive discharges, negative charges.
* @param duration_seconds Whole seconds from 1 to 86400.
*/
Expand All @@ -295,7 +293,8 @@ export class TeslemetryEnergySite extends EnergySpecific {

/**
* Release a `dispatch_battery_power` setpoint. Without a signing key the
* Teslemetry route still sends unsigned and gets Tesla's HTTP 400 (2026-10-29).
* Teslemetry route signs it, and answers 409 `energy_site_not_paired` until
* Teslemetry's key is verified on the gateway.
*/
override async resume_battery_operation(): Promise<Record<string, any>> {
return this.signing ? super.resume_battery_operation() : this._post_route("resume_battery_operation");
Expand Down
Loading