尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證Find the nearest SWM (Stadtwerke München) EV charger and navigate there with one tap – built for the Tesla browser.
翻譯準備中
取自儲存庫 README
正在載入完整 README。
檢視完整 README ↗Find the nearest SWM (Stadtwerke München) EV charger and start navigating with one tap – built for the Tesla in-car browser.
Live demo → https://megatony.github.io/swm-charge-finder/
tr, and the choice is remembered on the device. Numbers and times follow the selected language.lat, lng coordinates when GPS is unavailable or denied.?lat=48.137&lng=11.575 runs a search immediately./api/nearest and a send-to-car endpoint.Bundesnetzagentur CSV ──► scripts/build-static.py ──► public/stations.json (621 SWM sites, 1,533 charge points)
│
Browser (public/index.html + core.js) ◄───────────────────┘ ranks by straight-line distance, client-side
│
└── GET MobiData BW OCPDB (no key, CORS *) near the user’s position
source datex2_e_clearing_net, operator SWM
match the nearest location within 50 m
AVAILABLE = free · CHARGING/BLOCKED = occupied · OUTOFORDER/UNKNOWN = unavailable
server.js (optional) ── lib/live.js LIVE_SOURCE=ocpdb (default) ──► the same OCPDB query, with a User-Agent
│ datex2 / file remain available (see Alternatives)
└── POST /api/send-nearest-to-car ──► Tesla vehicle-command proxy ──► Fleet API navigation_gps_request
scripts/build-static.py reads the official charging-station register CSV, keeps operational SWM-operated sites, groups charge points by location, and fixes rows that were geocoded to the city centre. Those rows are moved to a twin entry at the same address, or dropped.public/core.js (shared with Node) ranks stations by haversine distance and optional minimum power. On GitHub Pages it all runs in the browser. Live status is a second request to MobiData BW’s Open ChargePoint DataBase, limited to a radius that covers the nearest register sites (cached for 60 seconds). e-clearing.net ids look like CO_1391, not Bundesnetzagentur EVSE ids, so a station is paired with the nearest SWM location within 50 m. REMOVED charge points are ignored. If that request fails, the page hides live badges and still lists the nearest sites.server.js serves the UI and GET /api/nearest. lib/live.js defaults to LIVE_SOURCE=ocpdb and sends User-Agent: swm-charge-finder/1.0 (+https://github.com/megatony/swm-charge-finder). The same 60-second cache applies. With live data, the endpoint prefers stations that have a free point.POST /api/send-nearest-to-car picks the nearest (free) charger and sends it to the car's navigation through the Tesla Fleet API (navigation_gps_request, signed by Tesla's vehicle-command proxy). It hasn't been tested against a real car yet.Requirements: Node 18+ (no npm dependencies). Python 3 is needed only to rebuild the data.
git clone https://github.com/megatony/swm-charge-finder.git
cd swm-charge-finder
# Static only: serve public/ with anything
python3 -m http.server -d public 8080 # → http://localhost:8080
# Backend + UI
node server.js # → http://localhost:8080 (PORT to change)
curl "http://localhost:8080/api/nearest?lat=48.137&lng=11.575&limit=3&minKw=0"
# Tests
node test/test.js
# Rebuild public/stations.json from a fresh register download
# CSV: https://www.bundesnetzagentur.de/ladesaeulenkarte → "Liste der Ladesäulen (CSV)"
python3 scripts/build-static.py path/to/Ladesaeulenregister.csv
Deployment: every push to main runs the tests and publishes public/ to GitHub Pages via .github/workflows/pages.yml.
| Endpoint | Description |
|---|---|
GET /api/nearest?lat=&lng=&limit=3&minKw=0 | Nearest stations as JSON (limit ≤ 10). With a live feed (the default), only stations with a free point. Each result includes freeCount, occupiedCount, unavailableCount, and statusUpdated. |
POST /api/send-nearest-to-car?lat=&lng= | Header X-Api-Secret required. Sends the nearest station to the car via Tesla Fleet API. |
All configuration is through environment variables (names only; never commit values):
| Variable | Purpose |
|---|---|
PORT | HTTP port (default 8080) |
LIVE_SOURCE | ocpdb (default, MobiData BW), datex2 (Mobilithek), file (local DATEX/OCPI JSON), or none |
MOBILITHEK_URL | Subscription URL of the Mobilithek AFIR dynamic feed |
MOBILITHEK_CERT, MOBILITHEK_KEY | Client certificate and key (PEM paths) for Mobilithek mTLS |
MOBILITHEK_PFX, MOBILITHEK_PASS | Alternative: PKCS#12 bundle path and its passphrase |
LIVE_FILE | Path to a downloaded feed when LIVE_SOURCE=file |
API_SECRET | Shared secret expected in X-Api-Secret for send-to-car |
TESLA_PROXY_URL | Base URL of Tesla's vehicle-command HTTP proxy |
TESLA_ACCESS_TOKEN | Tesla Fleet API user access token |
TESLA_VIN | Target vehicle VIN |
lib/live.js also contains googleNearbyAvailable(), an unused adapter for the Google Places API (New) evChargeOptions that needs your own API key.
source_uid=datex2_e_clearing_net). No API key. Queried by position and radius rather than for the whole city.RESERVED (rare in this feed) counts as occupied. REMOVED points are left out of the counts.The OCPDB feed is the one the app uses. Two older adapters are still in lib/live.js if you need them:
LIVE_SOURCE=datex2). A direct subscription to the Mobilithek AFIR recharging dynamic feed, with an mTLS client certificate (MOBILITHEK_URL plus MOBILITHEK_CERT/MOBILITHEK_KEY or MOBILITHEK_PFX/MOBILITHEK_PASS). That feed matches on EVSE id. Only a minority of register charge points have one (324 of 1,533), so coverage stays incomplete without an AFIR static feed. The subscription was never set up; OCPDB replaces it for day-to-day use. LIVE_SOURCE=file reads a saved DATEX II / OCPI JSON file from LIVE_FILE instead.googleNearbyAvailable()). An unused adapter for the Places API (New) evChargeOptions. It needs your own API key and a billing account.This is an independent hobby project. It isn't affiliated with or endorsed by Stadtwerke München, Tesla, or the Bundesnetzagentur.
/api/nearest/api/send-nearest-to-car, and Tesla Fleet API sends the route straight to the car's navigationCode: MIT © 2026 Bahadır Akın Akgül. Station data: CC BY 4.0, Bundesnetzagentur.de.