尚未检测到更新。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.