Skip to content

v0.2.0 - Manual full-charge override with phone control PWA

Choose a tag to compare

@Haraheriz Haraheriz released this 27 Jun 07:36
· 9 commits to main since this release
7929b74

Deployed and merged via PR #2:

  • Manual full-charge override switchable from a phone: control_server.py + override_state.py, sharing override_state.json with the charging script. Toggling it makes tesla_solar_charger.py ignore solar surplus and charge at full power, waking the vehicle if needed.
  • PWA support: manifest, service worker, and icons so the control page can be added to the home screen and launched standalone.
  • Fixed a bug found right after deploying: while override was on, the charger script re-forced MAX_AMPS every cycle even after the driver manually lowered the charge current via the Tesla app. Now MAX_AMPS is only applied when starting/resuming charging.
  • Reworked the control page: safe-area insets (no more text under the iPhone Dynamic Island/notch or Android cutouts), larger text matching iOS/Android body-text guidelines, a status/button split (status always states the current fact, the button always states the resulting action), WAI-ARIA roles/live-region/aria-pressed, and a centered layout (was left-shifted).
  • Added Tailscale: tailscale serve HTTPS-exposes the control server within the tailnet (Funnel intentionally not enabled), since Android requires a secure context for full PWA install.
  • Added show_control_url.sh to print the tokenized control URL and a terminal QR code.

PR #2でマージ・本番反映:

  • スマホから切替えられるマニュアル・オーバーライド(フル充電モード):control_server.py + override_state.pyoverride_state.jsonを充電スクリプトと共有。ONにするとtesla_solar_charger.pyが太陽光の余剰計算を無視してフル充電(必要なら車両を起動)する。
  • PWA対応:マニフェスト・Service Worker・アイコンを追加し、操作画面をホーム画面に追加してアプリのように起動できるようにした。
  • デプロイ直後に見つけたバグを修正:オーバーライドON中、毎サイクルMAX_AMPSを強制再設定していたため、Teslaアプリで手動で電流を下げても元に戻ってしまっていた。充電開始・再開時のみMAX_AMPSを適用するように修正。
  • 操作画面を改善:セーフエリア対応(iPhoneのDynamic Island/ノッチ、Androidのカットアウトに重ならない)、iOS/Android基準のフォントサイズ拡大、状態とボタンの役割分離(状態は常に事実、ボタンは常に結果のアクション)、WAI-ARIA対応、中央揃え(以前は左にずれていた)。
  • Tailscaleを導入:tailscale serveでtailnet内のみHTTPS公開(Funnelは意図的に不採用)。AndroidでPWAを正式インストールするにはHTTPSが必要なための対応。
  • show_control_url.shを追加し、トークン付きURLと端末上のQRコードを表示できるようにした。