feat: broadcast worst-case OBC temperature on 0x211 byte 7 #7

Merged
bastian merged 1 commits from feat/skudak-broadcast-obc-temp into main 2026-05-14 15:53:53 -04:00
Owner

Summary

Surfaces OBC heatsink temperature to the Polarity VCU and through to the app's STATUS_SCREEN. Until now the 9 temperature probes the Tesla OBC publishes internally (3 modules × {tmp1, tmp2, tmpin} on CAN 0x237/0x239/0x23B) were received by the teslacharger but never forwarded — the VCU's OBC-temp and DCDC-temp fields rendered 0 °C on OI-OBC cars.

Changes

  • New derived value Param::tmpobcmax (id 2051) — max across the 9 probes, computed each Ms100Task tick. Probes reading -40 °C (sensor absent / module not present) are skipped so an absent module doesn't drag the worst-case down.
  • Maps to 0x211 byte 7 (previously reserved, last unused byte of the 7-byte frame). Wire encoding uses the Tesla OBC convention wire = °C + 40 (offset 40) so consumers can decode with the same formula the upstream c[123]tmp* mappings already use.
  • Bumps VERSTR to -S5 so the right firmware is visually confirmable in the OpenInverter web UI.

Wire-protocol impact

Purely additive. Existing 0x211 consumers that read only bytes 0-6 continue to work unchanged. The VCU's paired RX-side change lands in stm32-hal-vcu PR #47.

Test plan

  • Build clean (verified locally).
  • Flash to bench teslacharger; OpenInverter web UI shows version 4=1.20.R-S5.
  • Charging session: tmpobcmax value in web UI is non-zero and tracks pack heating realistically.
  • Polarity app's STATUS screen shows OBC temperature once the VCU-side decode lands.
  • Regression: existing 0x211 bytes 0-6 (state, udc, idc, uaux, soc) decode identically on the VCU side.
## Summary Surfaces OBC heatsink temperature to the Polarity VCU and through to the app's STATUS_SCREEN. Until now the 9 temperature probes the Tesla OBC publishes internally (3 modules × {tmp1, tmp2, tmpin} on CAN 0x237/0x239/0x23B) were received by the teslacharger but never forwarded — the VCU's OBC-temp and DCDC-temp fields rendered 0 °C on OI-OBC cars. ## Changes - New derived value `Param::tmpobcmax` (id 2051) — max across the 9 probes, computed each `Ms100Task` tick. Probes reading -40 °C (sensor absent / module not present) are skipped so an absent module doesn't drag the worst-case down. - Maps to **0x211 byte 7** (previously reserved, last unused byte of the 7-byte frame). Wire encoding uses the Tesla OBC convention `wire = °C + 40` (offset 40) so consumers can decode with the same formula the upstream `c[123]tmp*` mappings already use. - Bumps VERSTR to `-S5` so the right firmware is visually confirmable in the OpenInverter web UI. ## Wire-protocol impact Purely additive. Existing 0x211 consumers that read only bytes 0-6 continue to work unchanged. The VCU's paired RX-side change lands in stm32-hal-vcu PR #47. ## Test plan - [ ] Build clean (verified locally). - [ ] Flash to bench teslacharger; OpenInverter web UI shows version `4=1.20.R-S5`. - [ ] Charging session: `tmpobcmax` value in web UI is non-zero and tracks pack heating realistically. - [ ] Polarity app's STATUS screen shows OBC temperature once the VCU-side decode lands. - [ ] Regression: existing 0x211 bytes 0-6 (state, udc, idc, uaux, soc) decode identically on the VCU side.
bastian added 1 commit 2026-05-14 15:48:59 -04:00
feat: broadcast worst-case OBC temperature on 0x211 byte 7
Build Firmware / Build stm32-teslacharger (pull_request) Successful in 59s
b7fcd2b301
The Tesla OBC hardware already publishes 9 temperature probes (3
modules × {tmp1, tmp2, tmpin}) on CAN 0x237/0x239/0x23B which the
teslacharger receives as c[123]tmp[12,in]. Until now none of these
were forwarded downstream — the Polarity VCU's STATUS_SCREEN OBC-temp
and DCDC-temp fields rendered 0 °C on OI-OBC cars.

This commit:

- Adds Param::tmpobcmax — derived value computed each Ms100Task tick
  as the max across the 9 probes, skipping any that read -40 °C
  (sensor absent / module not present).
- Maps it to 0x211 byte 7 (previously reserved, the last unused byte
  of the 7-byte frame). Wire encoding uses the Tesla OBC convention
  of offset 40 (wire = °C + 40), matching c[123]tmp* upstream so
  receivers can decode with the same formula.
- Bumps VERSTR to -S5 so the right firmware is visually confirmable
  in the OpenInverter web UI.

The new byte is purely additive — existing 0x211 consumers that read
only bytes 0-6 continue to work unchanged.

The Polarity VCU's 0x211 RX handler grows a corresponding decode +
display path in a paired stm32-hal-vcu commit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
bastian merged commit 2c9e7a8bbe into main 2026-05-14 15:53:53 -04:00
bastian deleted branch feat/skudak-broadcast-obc-temp 2026-05-14 15:53:53 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Skudak/stm32-openinverter-teslacharger#7